Page MenuHomePhabricator

Translation suggestions fail to load
Closed, InvalidPublic

Description

Setup

  • MediaWiki 1.27.1 (8c593e7) 22:49, 26 October 2016
  • PHP 7.0.8-0ubuntu0.16.04.3 (apache2handler)
  • MySQL 5.7.16-0ubuntu0.16.04.1
  • Translate MLEB 2016.10 (rETRA81b64d5ba8c0) 16:34, 28 October 2016

Issue
Both Ch 53 and Fx 50 (other browsers untested) fail to load translations suggestions available from locally made translations.

Stacktrace

Exception in module-execute in module site:  load.php:178:411
ReferenceError: importStylesheet is not defined ReferenceError: importStylesheet is not defined
Stack-Trace:
@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un line 4 > eval:2:77
.globalEval/<@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:4:666
.globalEval@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:4:632
execute/runScript/<@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:163:291
jQuery.Callbacks/fire@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:45:104
jQuery.Callbacks/self.add@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:45:656
.Deferred/promise.always@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:46:865
execute/runScript@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:162:944
execute/</checkCssHandles@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:163:774
execute/</cssHandle/<@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:163:904
jQuery.Callbacks/fire@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:45:104
jQuery.Callbacks/self.fireWith@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:46:431
jQuery.Callbacks/self.fire@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:46:474
fireCallbacks@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:157:607
addEmbeddedCSS@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:158:681
addEmbeddedCSS/cssBufferTimer<@https://www.semantic-mediawiki.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=Id8%2BT9Un:157:832
  load.php:178:449

This error only occurs after last weeks update of the server from Ubuntu 15.10 to 16.04, i.e. PHP 5.5 to PHP 5.7, at least that's the only change in the setup that occurred since it was working cool.

Event Timeline

Please see [Wikitech-l] [BREAKING CHANGE] Legacy wikibits will no longer loaded by default on Wikimedia wikis and MediaWiki 1.27

To me it seems Translate is just taking collateral damage from JavaScript error elsewhere.

Kghbln closed this task as Invalid.EditedDec 15 2016, 2:39 PM

Please see [[ https://lists.wikimedia.org/pipermail/wikitech-l/2016-March/085113.html | [Wikitech-l] [BREAKING CHANGE] Legacy wikibits will no longer loaded by default on Wikimedia wikis and MediaWiki 1.27 ]]

To me it seems Translate is just taking collateral damage from JavaScript error elsewhere.

I do not think that this is the reason. We wiki is on MW 1.27.1 for quite some time and it worked until the server upgrade last week. Also setting $wgIncludeLegacyJavaScript = true; did not change anything. So there is something else in the water. Still if you believe that the Translate extension is not causing this I trust you assessment. So there something else in the water and I must find it since the feature was pretty important and not having it is a show stopper.

Closing as invalid.

With debug=true I see:

Error loading translation aids http Objectexception: SyntaxError: Unexpected token E in JSON at position 0
   at JSON.parse (<anonymous>)
   at jQuery.parseJSON (https://www.semantic-mediawiki.org/w/load.php?debug=true&lang=fi&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=r4TV5Wku:8520:22)
   at ajaxConvert (https://www.semantic-mediawiki.org/w/load.php?debug=true&lang=fi&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=r4TV5Wku:8846:19)
   at done (https://www.semantic-mediawiki.org/w/load.php?debug=true&lang=fi&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=r4TV5Wku:9264:15)
   at XMLHttpRequest.callback (https://www.semantic-mediawiki.org/w/load.php?debug=true&lang=fi&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=r4TV5Wku:9718:8)textStatus: "parsererror"xhr: Object__proto__: Object

And inspecting the request I see:

Exception encountered, of type "Error"
[87bf2d3dcfa247fae34bc881] /w/api.php?action=translationaids&format=json&title=Translations%3ASemantic+MediaWiki+2%2E4%2E4+released%2F3%2Ffi Error from line 418 of /var/www/html/02310/w/includes/libs/MultiHttpClient.php: Call to undefined function curl_multi_init()
Backtrace:
#0 /var/www/html/02310/w/includes/libs/MultiHttpClient.php(138): MultiHttpClient->getCurlMulti()
#1 /var/www/html/02310/w/extensions/Translate/webservices/QueryAggregator.php(56): MultiHttpClient->runMulti(array)
#2 /var/www/html/02310/w/extensions/Translate/api/ApiQueryTranslationAids.php(75): QueryAggregator->run()
#3 /var/www/html/02310/w/includes/api/ApiMain.php(1372): ApiTranslationAids->execute()
#4 /var/www/html/02310/w/includes/api/ApiMain.php(473): ApiMain->executeAction()
#5 /var/www/html/02310/w/includes/api/ApiMain.php(439): ApiMain->executeActionWithErrorHandling()
#6 /var/www/html/02310/w/api.php(83): ApiMain->execute()
#7 {main}

Might be worth checking whether curl plugin is installed.

Might be worth checking whether curl plugin is installed.

No, this cannot be the reason either since curl is installed and at "7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3"

Command line curl package does not imply that the php curl module is available.

Command line curl package does not imply that the php curl module is available.

Omg, php curl. Yeah, did not think of this one and wonder why the upgrade kicked this one. This was indeed not installed. After doing so everything is in fluff. Cool, thanks a lot!!!

I added a little note about it to the requirements section. Of cause you may change, relocate or remove it if you believe so. I am not too familiar with the documentation here.

I am going to transform more and more pages to use the Translate extension so I'd like to note at this point that this one is another great one in the MediaWikiverse.