Page MenuHomePhabricator

prepareForParse() nor setReviewedVersions() called yet
Closed, ResolvedPublicPRODUCTION ERROR

Description

This error started after pushing 1.32.0-wmf.18 to wikipedia wikis.

Exception was visible for urls like: https://en.wikipedia.org/wiki/Zimbabwe?action=render

prepareForParse() nor setReviewedVersions() called yet

/srv/mediawiki/php-1.32.0-wmf.18/extensions/FlaggedRevs/backend/FRInclusionManager.php:133

#0 /srv/mediawiki/php-1.32.0-wmf.18/extensions/FlaggedRevs/backend/FlaggedRevs.class.php(622): FRInclusionManager->getReviewedTemplateVersion(Title)
#1 /srv/mediawiki/php-1.32.0-wmf.18/includes/parser/Parser.php(3575): Closure$FlaggedRevs::parseStableRevision(Title, Parser)
#2 /srv/mediawiki/php-1.32.0-wmf.18/includes/parser/Parser.php(3667): Parser->fetchCurrentRevisionOfTitle(Title)
#3 /srv/mediawiki/php-1.32.0-wmf.18/includes/parser/Parser.php(3603): Parser::statelessFetchTemplate(Title, Parser)
#4 /srv/mediawiki/php-1.32.0-wmf.18/includes/parser/Parser.php(3537): Parser->fetchTemplateAndTitle(Title)
#5 /srv/mediawiki/php-1.32.0-wmf.18/includes/parser/Parser.php(3297): Parser->getTemplateDom(Title)
#6 /srv/mediawiki/php-1.32.0-wmf.18/includes/parser/Preprocessor_Hash.php(1114): Parser->braceSubstitution(array, PPFrame_Hash)
#7 /srv/mediawiki/php-1.32.0-wmf.18/includes/parser/Parser.php(2999): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#8 /srv/mediawiki/php-1.32.0-wmf.18/includes/parser/Parser.php(1345): Parser->replaceVariables(string)
#9 /srv/mediawiki/php-1.32.0-wmf.18/includes/parser/Parser.php(474): Parser->internalParse(string)
#10 /srv/mediawiki/php-1.32.0-wmf.18/includes/content/WikitextContent.php(341): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#11 /srv/mediawiki/php-1.32.0-wmf.18/includes/content/AbstractContent.php(516): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
#12 /srv/mediawiki/php-1.32.0-wmf.18/extensions/FlaggedRevs/backend/FlaggedRevs.class.php(644): AbstractContent->getParserOutput(Title, integer, ParserOptions)
#13 /srv/mediawiki/php-1.32.0-wmf.18/extensions/FlaggedRevs/backend/FlaggedRevs.class.php(566): FlaggedRevs::parseStableRevision(FlaggedRevision, ParserOptions)
#14 /srv/mediawiki/php-1.32.0-wmf.18/includes/poolcounter/PoolCounterWorkViaCallback.php(69): Closure$FlaggedRevs::parseStableRevisionPooled()
#15 /srv/mediawiki/php-1.32.0-wmf.18/includes/poolcounter/PoolCounterWork.php(123): PoolCounterWorkViaCallback->doWork()
#16 /srv/mediawiki/php-1.32.0-wmf.18/extensions/FlaggedRevs/backend/FlaggedRevs.class.php(582): PoolCounterWork->execute()
#17 /srv/mediawiki/php-1.32.0-wmf.18/extensions/FlaggedRevs/frontend/FlaggablePageView.php(749): FlaggedRevs::parseStableRevisionPooled(FlaggedRevision, ParserOptions)
#18 /srv/mediawiki/php-1.32.0-wmf.18/extensions/FlaggedRevs/frontend/FlaggablePageView.php(391): FlaggablePageView->showStableVersion(FlaggedRevision, string, string)
#19 /srv/mediawiki/php-1.32.0-wmf.18/extensions/FlaggedRevs/frontend/FlaggedRevsUI.hooks.php(204): FlaggablePageView->setPageContent(boolean, boolean)
#20 /srv/mediawiki/php-1.32.0-wmf.18/includes/Hooks.php(174): FlaggedRevsUIHooks::onArticleViewHeader(Article, boolean, boolean)
#21 /srv/mediawiki/php-1.32.0-wmf.18/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#22 /srv/mediawiki/php-1.32.0-wmf.18/includes/page/Article.php(524): Hooks::run(string, array)
#23 /srv/mediawiki/php-1.32.0-wmf.18/includes/actions/ViewAction.php(68): Article->view()
#24 /srv/mediawiki/php-1.32.0-wmf.18/includes/MediaWiki.php(501): ViewAction->show()
#25 /srv/mediawiki/php-1.32.0-wmf.18/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#26 /srv/mediawiki/php-1.32.0-wmf.18/includes/MediaWiki.php(868): MediaWiki->performRequest()
#27 /srv/mediawiki/php-1.32.0-wmf.18/includes/MediaWiki.php(525): MediaWiki->main()
#28 /srv/mediawiki/php-1.32.0-wmf.18/index.php(42): MediaWiki->run()
#29 /srv/mediawiki/w/index.php(3): include(string)
#30 {main}

Event Timeline

thcipriani triaged this task as Unbreak Now! priority.Aug 23 2018, 7:38 PM

Added as train blocker

I think I've figured out what caused this. The old code removed by rEFLR413e11e2f106: Replace old and busted hook with the new hotness of a callback checked parserOutputIsStabilized(), and didn't attempt to do anything if it returned false. In the new code, that check isn't present (it is checked, but not for the same purpose) and getReviewedTemplateVersion() can be called even though the ParserOutput isn't "stabilized", which is not allowed and leads to this error.

I think the correct thing to do here is to not either short-circuit the callback or not register it at all if parserOutputIsStabilized() returns false; that seems to be equivalent to what the old code did, which was to short-circuit the parserFetchStableTemplate hook function in that case.

Change 455013 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/FlaggedRevs@master] Follow-up 413e11e2f: Skip CurrentRevisionCallback if not stabilized

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

Change 455013 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/FlaggedRevs@master] Follow-up 413e11e2f: Skip CurrentRevisionCallback if not stabilized

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

Untested patch, I'm now trying to set up FR locally so I can test this.

I tested the patch on mwdebug1001 and confirmed that https://en.wikipedia.org/w/index.php?title=Prime_Minister_of_Australia&stableid=856229757 throws this exception without the patch, and works with the patch.

Change 455017 had a related patch set uploaded (by Thcipriani; owner: Catrope):
[mediawiki/extensions/FlaggedRevs@wmf/1.32.0-wmf.18] Follow-up 413e11e2f: Skip CurrentRevisionCallback if not stabilized

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

Change 455013 merged by jenkins-bot:
[mediawiki/extensions/FlaggedRevs@master] Follow-up 413e11e2f: Skip CurrentRevisionCallback if not stabilized

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

Change 455017 merged by jenkins-bot:
[mediawiki/extensions/FlaggedRevs@wmf/1.32.0-wmf.18] Follow-up 413e11e2f: Skip CurrentRevisionCallback if not stabilized

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

Mentioned in SAL (#wikimedia-operations) [2018-08-23T22:27:25Z] <thcipriani@deploy1001> Synchronized php-1.32.0-wmf.18/extensions/FlaggedRevs/backend/FlaggedRevs.class.php: [[gerrit:455017|Follow-up 413e11e2f: Skip CurrentRevisionCallback if not stabilized]] T202659 (duration: 00m 56s)

thcipriani assigned this task to Catrope.

After backporting patch to wmf.18, don't see that error anymore. Thanks @Catrope!

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:08 PM