Page MenuHomePhabricator

InvalidArgumentException: Multiple conflicting values given for wgDiscussionToolsPageThreads (August 2024)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
labels.normalized_message
[{reqId}] {exception_url}   InvalidArgumentException: Multiple conflicting values given for wgDiscussionToolsPageThreads
error.stack_trace
from /srv/mediawiki/php-1.43.0-wmf.18/includes/parser/ParserOutput.php(1241)
#0 /srv/mediawiki/php-1.43.0-wmf.18/extensions/DiscussionTools/includes/CommentFormatter.php(420): MediaWiki\Parser\ParserOutput->setJsConfigVar(string, array)
#1 /srv/mediawiki/php-1.43.0-wmf.18/extensions/DiscussionTools/includes/CommentFormatter.php(64): MediaWiki\Extension\DiscussionTools\CommentFormatter::addDiscussionToolsInternal(string, MediaWiki\Parser\ParserOutput, MediaWiki\Title\Title)
#2 /srv/mediawiki/php-1.43.0-wmf.18/extensions/DiscussionTools/includes/Hooks/ParserHooks.php(70): MediaWiki\Extension\DiscussionTools\CommentFormatter::addDiscussionTools(string, MediaWiki\Parser\ParserOutput, MediaWiki\Title\Title)
#3 /srv/mediawiki/php-1.43.0-wmf.18/extensions/DiscussionTools/includes/Hooks/ParserHooks.php(98): MediaWiki\Extension\DiscussionTools\Hooks\ParserHooks->transformHtml(MediaWiki\Parser\ParserOutput, string, MediaWiki\Title\Title, bool)
#4 /srv/mediawiki/php-1.43.0-wmf.18/includes/HookContainer/HookContainer.php(159): MediaWiki\Extension\DiscussionTools\Hooks\ParserHooks->onParserOutputPostCacheTransform(MediaWiki\Parser\ParserOutput, string, array)
#5 /srv/mediawiki/php-1.43.0-wmf.18/includes/HookContainer/HookRunner.php(3038): MediaWiki\HookContainer\HookContainer->run(string, array, array)
#6 /srv/mediawiki/php-1.43.0-wmf.18/includes/OutputTransform/Stages/ExecutePostCacheTransformHooks.php(36): MediaWiki\HookContainer\HookRunner->onParserOutputPostCacheTransform(MediaWiki\Parser\ParserOutput, string, array)
#7 /srv/mediawiki/php-1.43.0-wmf.18/includes/OutputTransform/ContentTextTransformStage.php(17): MediaWiki\OutputTransform\Stages\ExecutePostCacheTransformHooks->transformText(string, MediaWiki\Parser\ParserOutput, null, array)
#8 /srv/mediawiki/php-1.43.0-wmf.18/includes/OutputTransform/OutputTransformPipeline.php(72): MediaWiki\OutputTransform\ContentTextTransformStage->transform(MediaWiki\Parser\ParserOutput, null, array)
#9 /srv/mediawiki/php-1.43.0-wmf.18/includes/parser/ParserOutput.php(475): MediaWiki\OutputTransform\OutputTransformPipeline->run(MediaWiki\Parser\ParserOutput, null, array)
#10 /srv/mediawiki/php-1.43.0-wmf.18/includes/Output/OutputPage.php(2388): MediaWiki\Parser\ParserOutput->getText(array)
#11 /srv/mediawiki/php-1.43.0-wmf.18/includes/Output/OutputPage.php(2432): MediaWiki\Output\OutputPage->getParserOutputText(MediaWiki\Parser\ParserOutput, array)
#12 /srv/mediawiki/php-1.43.0-wmf.18/includes/page/Article.php(919): MediaWiki\Output\OutputPage->addParserOutput(MediaWiki\Parser\ParserOutput, array)
#13 /srv/mediawiki/php-1.43.0-wmf.18/includes/page/Article.php(730): Article->doOutputFromParserCache(MediaWiki\Parser\ParserOutput, MediaWiki\Output\OutputPage, array)
#14 /srv/mediawiki/php-1.43.0-wmf.18/includes/page/Article.php(545): Article->generateContentOutput(MediaWiki\User\User, ParserOptions, int, MediaWiki\Output\OutputPage, array)
#15 /srv/mediawiki/php-1.43.0-wmf.18/includes/actions/ViewAction.php(78): Article->view()
#16 /srv/mediawiki/php-1.43.0-wmf.18/includes/actions/ActionEntryPoint.php(731): ViewAction->show()
#17 /srv/mediawiki/php-1.43.0-wmf.18/includes/actions/ActionEntryPoint.php(508): MediaWiki\Actions\ActionEntryPoint->performAction(Article, MediaWiki\Title\Title)
#18 /srv/mediawiki/php-1.43.0-wmf.18/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#19 /srv/mediawiki/php-1.43.0-wmf.18/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute()
#20 /srv/mediawiki/php-1.43.0-wmf.18/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#21 /srv/mediawiki/w/index.php(3): require(string)
#22 {main}
Impact

Top of logspam-watch, ca. 100 occurrences per hour.

Notes

Event Timeline

Route to this being called is from the ParserOutputPostCacheTransform and ParserAfterTidy hooks. I think I recall that they're both being used because we need to cover both the parsoid and non-parsoid cases, though I can't remember if the doubling-up is expected. @ssastry?

matmarex renamed this task from InvalidArgumentException: Multiple conflicting values given for wgDiscussionToolsPageThreads to InvalidArgumentException: Multiple conflicting values given for wgDiscussionToolsPageThreads (August 2024).Aug 15 2024, 7:41 PM
matmarex subscribed.

Change #1063040 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@master] Revert "CommentFormatter: Switch from deprecated addJsConfigVars to new setJsConfigVar"

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

Change #1063041 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/DiscussionTools@wmf/1.43.0-wmf.18] Revert "CommentFormatter: Switch from deprecated addJsConfigVars to new setJsConfigVar"

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

Change #1063041 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@wmf/1.43.0-wmf.18] Revert "CommentFormatter: Switch from deprecated addJsConfigVars to new setJsConfigVar"

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

Mentioned in SAL (#wikimedia-operations) [2024-08-15T20:20:15Z] <ebernhardson@deploy1003> Started scap sync-world: Backport for [[gerrit:1063041|Revert "CommentFormatter: Switch from deprecated addJsConfigVars to new setJsConfigVar" (T372499)]]

Mentioned in SAL (#wikimedia-operations) [2024-08-15T20:23:33Z] <ebernhardson@deploy1003> ebernhardson, matmarex: Backport for [[gerrit:1063041|Revert "CommentFormatter: Switch from deprecated addJsConfigVars to new setJsConfigVar" (T372499)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-08-15T20:30:22Z] <ebernhardson@deploy1003> Finished scap sync-world: Backport for [[gerrit:1063041|Revert "CommentFormatter: Switch from deprecated addJsConfigVars to new setJsConfigVar" (T372499)]] (duration: 10m 06s)

Backported, but the patch on master is still waiting for review. It should be merged no later than Monday to avoid regressing this in the next WMF branch.

The user-visible impact of this problem was that people using Parsoid rendering (enabled by default on some Wikivoyages, opt-in on other projects) would not see the "Reply" buttons and other discussion features on some talk pages (depending on the wikitext markup used in them, I am not sure what exactly triggers this case). DiscussionTools catches and logs exceptions in its page-processing code, so the pages still displayed, but with missing functionality.

Speculating: could be pages which wind up with messages displayed outside of the content? Anything that would trigger another parser run on a separate bit of wikitext...

Insofar as the second call would trigger the throw, but the initial call would still have succeeded and have all the information present, so it's presumably not just double-parsing the talk threads. Rather, we get the failure if it first parses something not-talk, then later parses the actual talk page contents and can't store the real talk data.

Change #1063040 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Revert "CommentFormatter: Switch from deprecated addJsConfigVars to new setJsConfigVar"

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

matmarex claimed this task.