Page MenuHomePhabricator

Replies impossible: The content format json is not supported by the content model
Closed, ResolvedPublic

Description

2016-08-25 11:58:42 translatewiki.net translatewiki_net-bw_: [5449ed90d94335f951d72516] [no req]   ErrorPageError from line 1005 of /srv/mediawiki/tags/2016-08-25_08:54:50/includes/EditPage.php: The content format json is not supported by the content model wikitexte.
#0 /srv/mediawiki/tags/2016-08-25_08:54:50/includes/EditPage.php(525): EditPage->importFormData(WebRequest)
#1 /srv/mediawiki/tags/2016-08-25_08:54:50/extensions/LiquidThreads/classes/View.php(669): EditPage->edit()
#2 /srv/mediawiki/tags/2016-08-25_08:54:50/extensions/LiquidThreads/classes/View.php(399): LqtView->showReplyForm(Thread)
#3 /srv/mediawiki/tags/2016-08-25_08:54:50/extensions/LiquidThreads/classes/View.php(467): LqtView->doInlineEditForm()
#4 /srv/mediawiki/tags/2016-08-25_08:54:50/extensions/LiquidThreads/api/ApiThreadAction.php(835): LqtView::getInlineEditForm(Article, string, string)
#5 /srv/mediawiki/tags/2016-08-25_08:54:50/extensions/LiquidThreads/api/ApiThreadAction.php(55): ApiThreadAction->actionInlineEditForm(array, array)
#6 /srv/mediawiki/tags/2016-08-25_08:54:50/includes/api/ApiMain.php(1426): ApiThreadAction->execute()
#7 /srv/mediawiki/tags/2016-08-25_08:54:50/includes/api/ApiMain.php(510): ApiMain->executeAction()
#8 /srv/mediawiki/tags/2016-08-25_08:54:50/includes/api/ApiMain.php(481): ApiMain->executeActionWithErrorHandling()
#9 /srv/mediawiki/tags/2016-08-25_08:54:50/api.php(83): ApiMain->execute()
#10 {main}

Correlating with access logs I see some are caused by:
"POST /w/api.php HTTP/2.0" 200 759 "https://translatewiki.net/wiki/Special:NewMessages" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0" ECDHE-RSA-AES128-GCM-SHA256 0.090

But there is always an earlier (≲30s) error which does not correlate with web request.

wikitexte seems to be the French localisation of the content model. I would expect English text in an exception.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 25 2016, 1:06 PM
Nikerabbit added a subscriber: Tpt.Aug 25 2016, 1:06 PM

Looks like @Tpt added localisation for this in c5f80c16251b02a1fcadeebb238e3a917b899acc. That's perhaps not a good idea given this code does not have a say in which language the actual text is displayed.

Change 307053 had a related patch set uploaded (by Tpt):
Do not localize content model name inside of english exception messages

https://gerrit.wikimedia.org/r/307053

Is this bug about the localization issue or the LQT fatal?

Change 307053 merged by jenkins-bot:
Do not localize content model name inside of english exception messages

https://gerrit.wikimedia.org/r/307053

About the fatal, the localisation thingie was just an additional observation.

Nemo_bis renamed this task from The content format json is not supported by the content model wikitexte. to Replies impossible: The content format json is not supported by the content model.Aug 29 2016, 8:54 AM
Nemo_bis triaged this task as Unbreak Now! priority.
Restricted Application added subscribers: Jay8g, Luke081515, TerraCodes. · View Herald TranscriptAug 29 2016, 8:54 AM

Only major change to LQT recently was conversion to extension.json. However, the issue persisted even after I checked out version before that.

Nikerabbit added a subscriber: aaron.

I git bisected the core and it found this:

f2f810181aa4188053da2af94faa6e3bad33d1a3 is the first bad commit
commit f2f810181aa4188053da2af94faa6e3bad33d1a3
Author: Kunal Mehta <legoktm@member.fsf.org>
Date:   Tue Aug 23 17:56:38 2016 -0700

    EditPage: Use context instead of globals (1/4)
    
    Change-Id: Ie4e9c492679a75d753b69fb09f510564b9e7f0a8

Looks like LQT is still messing with some globals that needs to be fixed.

CC:ing the people who worked on that patch.

It seems that $this->contentFormat = $request->getText( 'format', $this->contentFormat ); now returns json from the real API request, not from the FauxRequest which is possibly set up by LQT itself or in the API.

LqtView::getInlineEditForm does some fiddling with $wgRequest, but that does not seem to be the cause.

LqtView::doInlineEditForm overrides bunch of globals. It seems the fix should be LqtView::showReplyForm to override the context of the Article object it creates. That requires some refactoring to pass the context around.

Should we revert the core patch until this is fixed, or can somebody come up with a fix for LQT soon? I can test it.

greg added a subscriber: greg.Aug 29 2016, 6:25 PM

Should we revert the core patch until this is fixed, or can somebody come up with a fix for LQT soon? I can test it.

Revert now. If this is UBN! I don't think we can count on "somebody" to come up with a solution to LQT in a reasonable amount of time.

hashar added a subscriber: hashar.Aug 30 2016, 12:00 PM

Is the issue that MediaWiki core changes f2f810181aa4188053da2af94faa6e3bad33d1a3 is not supported/break LiquidThreads?

Good news I have reproduced it on the beta cluster.

https://test.wikimedia.beta.wmflabs.org/wiki/User_talk:Hashar

On the first message hit reply. That triggers an async background call to get the form. It results in a stacktrace in https://logstash-beta.wmflabs.org/

{ "file": "/srv/mediawiki/php-master/includes/EditPage.php", "line": 525, "function": "importFormData", "class": "EditPage", "type": "->", "args": [ "WebRequest" ] },
{ "file": "/srv/mediawiki/php-master/extensions/LiquidThreads/classes/View.php", "line": 669, "function": "edit", "class": "EditPage", "type": "->", "args": [] },
{ "file": "/srv/mediawiki/php-master/extensions/LiquidThreads/classes/View.php", "line": 399, "function": "showReplyForm", "class": "LqtView", "type": "->", "args": [ "Thread" ] },
{ "file": "/srv/mediawiki/php-master/extensions/LiquidThreads/classes/View.php", "line": 467, "function": "doInlineEditForm", "class": "LqtView", "type": "->", "args": [] },
{ "file": "/srv/mediawiki/php-master/extensions/LiquidThreads/api/ApiThreadAction.php", "line": 835, "function": "getInlineEditForm", "class": "LqtView", "type": "::", "args": [ "Article", "string", "string" ] },
{ "file": "/srv/mediawiki/php-master/extensions/LiquidThreads/api/ApiThreadAction.php", "line": 55, "function": "actionInlineEditForm", "class": "ApiThreadAction", "type": "->", "args": [ "array", "array" ] },
{ "file": "/srv/mediawiki/php-master/includes/api/ApiMain.php", "line": 1426, "function": "execute", "class": "ApiThreadAction", "type": "->", "args": [] },
{ "file": "/srv/mediawiki/php-master/includes/api/ApiMain.php", "line": 510, "function": "executeAction", "class": "ApiMain", "type": "->", "args": [] },
{ "file": "/srv/mediawiki/php-master/includes/api/ApiMain.php", "line": 481, "function": "executeActionWithErrorHandling", "class": "ApiMain", "type": "->", "args": [] },
{ "file": "/srv/mediawiki/php-master/api.php", "line": 83, "function": "execute", "class": "ApiMain", "type": "->", "args": [] },
{ "file": "/srv/mediawiki/w/api.php", "line": 3, "function": "include", "args": [ "string" ] }

Change 307501 had a related patch set uploaded (by Hashar):
Revert serie of "EditPage: Use context instead of globals"

https://gerrit.wikimedia.org/r/307501

remote: https://gerrit.wikimedia.org/r/307497 Revert "EditPage: Use context instead of globals (4/4)"
remote: https://gerrit.wikimedia.org/r/307498 Revert "EditPage: Use context instead of globals (3/4)"
remote: https://gerrit.wikimedia.org/r/307499 Revert "EditPage: Use context instead of globals (2/4)"
remote: https://gerrit.wikimedia.org/r/307500 Revert "EditPage: Use context instead of globals (1/4)"
remote: https://gerrit.wikimedia.org/r/307501 Revert serie of "EditPage: Use context instead of globals"

Will try it out on beta to make sure it actually fix the issue.

Mentioned in SAL [2016-08-30T12:53:41Z] <hashar> Cherry picking https://gerrit.wikimedia.org/r/#/c/307501/ on beta cluster for T143889

I have confirmed on beta that reverting the serie of patch does fix the LiquidThreads issue. As confirmed by Nikerabbit on translatewiki.

Change 307501 merged by Hashar:
Revert serie of "EditPage: Use context instead of globals"

https://gerrit.wikimedia.org/r/307501

1.28.0-wmf.17 reverts:

remote: https://gerrit.wikimedia.org/r/307505 Revert "EditPage: Use context instead of globals (4/4)"
remote: https://gerrit.wikimedia.org/r/307506 Revert "EditPage: Use context instead of globals (3/4)"
remote: https://gerrit.wikimedia.org/r/307507 Revert "EditPage: Use context instead of globals (2/4)"
remote: https://gerrit.wikimedia.org/r/307508 Revert "EditPage: Use context instead of globals (1/4)"

greg lowered the priority of this task from Unbreak Now! to High.Aug 30 2016, 4:38 PM

No longer UBN! after these reverts, and no longer blocking wmf.17.

Change 307549 had a related patch set uploaded (by Legoktm):
Override main context in addition to globals

https://gerrit.wikimedia.org/r/307549

Change 307549 merged by jenkins-bot:
Override main context in addition to globals

https://gerrit.wikimedia.org/r/307549

Nemo_bis raised the priority of this task from High to Unbreak Now!.Aug 31 2016, 1:13 PM

Thank you @Legoktm . Sorry for the serie of reverts :(

greg lowered the priority of this task from Unbreak Now! to High.Aug 31 2016, 4:38 PM

(Changing the priority back to UBN! after it was resolved doesn't help, the priority was set to High after it initially addressed, as is customary. Tasks can and do have different priorities throughout their life.)

Nemo_bis reopened this task as Open.Sep 1 2016, 8:48 AM
Nemo_bis raised the priority of this task from High to Unbreak Now!.

(Keeping the real priority which a report had is helpful and the alleged custom isn't documented.)

Nemo_bis closed this task as Resolved.Sep 1 2016, 8:48 AM