Page MenuHomePhabricator

Missing Central Notice banner breaks translatable pages on testwiki
Closed, DuplicatePublic

Description

On https://test.wikipedia.org/w/index.php?title=Special:Translate&group=page-Translate+from+English&language=it&action=page&filter= or any other page, my translation is forever yellow.

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data[Learn More] load.php:82:23 	TranslateEditor.prototype.validateTranslation/< https://test.wikipedia.org/w/load.php:82:23 	jQuery.Callbacks/fire https://test.wikipedia.org/w/load.php:45:104 	jQuery.Callbacks/self.fireWith https://test.wikipedia.org/w/load.php:46:431 	done https://test.wikipedia.org/w/load.php:135:757 	.send/callback https://test.wikipedia.org/w/load.php:141:562
Use of the "edit" token is deprecated. Use "csrf" instead.  load.php:291:850

Or with debug=true:

Use of the "edit" token is deprecated. Use "csrf" instead.  api.js:47:4
mw.Api error:  tpt-unknown-page Object { error: Object, servedby: "mw1289" }  load.php:13281:4
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data[Learn More]  ext.translate.editor.js:918:17
	TranslateEditor.prototype.validateTranslation/< https://test.wikipedia.org/w/extensions/Translate/resources/js/ext.translate.editor.js:918:17
	jQuery.Callbacks/fire https://test.wikipedia.org/w/load.php:3148:10
	jQuery.Callbacks/self.fireWith https://test.wikipedia.org/w/load.php:3260:7
	done https://test.wikipedia.org/w/load.php:9314:5
	.send/callback

Underlying exception:

[0a928423683454d558266c34] [no req]   BannerExistenceException from line 349 of /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/CentralNotice/includes/Banner.php: No banner exists where tmp_name = WikiCon. Could not load.
Backtrace:
#0 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/CentralNotice/includes/Banner.php(177): Banner->populateBasicData()
#1 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/CentralNotice/includes/Banner.php(832): Banner->getName()
#2 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/CentralNotice/includes/Banner.php(819): Banner->getMessageFieldsCacheKey()
#3 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/CentralNotice/includes/BannerMessageGroup.php(43): Banner->getMessageFieldsFromCache()
#4 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/Translate/utils/MessageIndex.php(286): BannerMessageGroup->getKeys()
#5 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/Translate/utils/MessageIndex.php(174): MessageIndex->checkAndAdd(array, BannerMessageGroup)
#6 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/Translate/scripts/createMessageIndex.php(29): MessageIndex->rebuild()
#7 /srv/mediawiki-staging/php-1.30.0-wmf.7/maintenance/doMaintenance.php(111): CreateMessageIndex->execute()
#8 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/Translate/scripts/createMessageIndex.php(34): require_once(string)
#9 /srv/mediawiki-staging/multiversion/MWScript.php(99): require_once(string)
#10 {main}

Event Timeline

The page is not known as translatable page.

The page is not known as translatable page.

Translate is clearly enabled on https://test.wikipedia.org/wiki/Translate_from_English: see https://test.wikipedia.org/w/index.php?title=Special%3ALog&type=pagetranslation&page=Translate+from+English

But https://test.wikipedia.org/w/api.php?action=translationaids&format=jsonfm&title=Translations%3ATranslate+from+English%2F1%2Ffr gives

{
    "error": {
        "code": "nomessagefortitle",
        "info": "Title does not correspond to a translatable message",
        "*": "See https://test.wikipedia.org/w/api.php for API usage."
    },
    "servedby": "mw1191"
}

The same API request works on other pages where Translate has been enabled: https://test.wikipedia.org/w/api.php?action=translationaids&format=jsonfm&title=Translations%3AFinnish+translation+test%2F1%2Ffr

Nemo_bis renamed this task from Special:Translate fails to save translations on testwiki to One translatable page on testwiki is not known as such.Mar 29 2017, 8:58 AM

I've tried removing and re-adding the unit and the page as a whole, without success.
https://test.wikipedia.org/w/index.php?title=Special:Log&page=Translate+from+English

TTO renamed this task from One translatable page on testwiki is not known as such to Various translatable pages on testwiki are not known as such.Mar 29 2017, 9:03 AM

The page Test de traduction bis is also affected.

@Nikerabbit, do you think this is a configuration issue specific to testwiki, or a DB inconsistency? Or something else?

[0a928423683454d558266c34] [no req]   BannerExistenceException from line 349 of /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/CentralNotice/includes/Banner.php: No banner exists where tmp_name = WikiCon. Could not load.
Backtrace:
#0 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/CentralNotice/includes/Banner.php(177): Banner->populateBasicData()
#1 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/CentralNotice/includes/Banner.php(832): Banner->getName()
#2 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/CentralNotice/includes/Banner.php(819): Banner->getMessageFieldsCacheKey()
#3 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/CentralNotice/includes/BannerMessageGroup.php(43): Banner->getMessageFieldsFromCache()
#4 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/Translate/utils/MessageIndex.php(286): BannerMessageGroup->getKeys()
#5 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/Translate/utils/MessageIndex.php(174): MessageIndex->checkAndAdd(array, BannerMessageGroup)
#6 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/Translate/scripts/createMessageIndex.php(29): MessageIndex->rebuild()
#7 /srv/mediawiki-staging/php-1.30.0-wmf.7/maintenance/doMaintenance.php(111): CreateMessageIndex->execute()
#8 /srv/mediawiki-staging/php-1.30.0-wmf.7/extensions/Translate/scripts/createMessageIndex.php(34): require_once(string)
#9 /srv/mediawiki-staging/multiversion/MWScript.php(99): require_once(string)
#10 {main}

Sounds like a missing CentralNotice banner.

I could add try-catch to Translate, but given it only affects testwiki, it would be better to be fixed at the source. I am not familiar with CentralNotice, so I hope someone else would look into it.

Nikerabbit renamed this task from Various translatable pages on testwiki are not known as such to Missing Central Notice banner breaks translatable pages on testwiki.Jul 11 2017, 8:19 AM
Nikerabbit updated the task description. (Show Details)