Page MenuHomePhabricator

Wikimedia\Assert\InvariantException: Invariant failed: getBasePageBundle called on non-Parsoid ContentHolder
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
  • service.version: 1.45.0-wmf.19
  • timestamp: 2025-09-17T18:16:36.330Z
  • labels.phpversion: 8.1.33
  • trace.id: db131554-a4a9-4053-9925-dae534fc8729
  • Find trace.id in Logstash
labels.normalized_message
[{reqId}] {exception_url}   Wikimedia\Assert\InvariantException: Invariant failed: getBasePageBundle called on non-Parsoid ContentHolder
FrameLocationCall
from/srv/mediawiki/php-1.45.0-wmf.19/vendor/wikimedia/assert/src/Assert.php(231)
#0/srv/mediawiki/php-1.45.0-wmf.19/includes/parser/ContentHolder.php(256)Wikimedia\Assert\Assert::invariant(bool, string)
#1/srv/mediawiki/php-1.45.0-wmf.19/includes/page/ParserOutputAccess.php(342)MediaWiki\Parser\ContentHolder->getBasePageBundle()
#2/srv/mediawiki/php-1.45.0-wmf.19/includes/page/ParserOutputAccess.php(480)MediaWiki\Page\ParserOutputAccess->getCachedParserOutput(MediaWiki\Page\PageStoreRecord, MediaWiki\Parser\ParserOptions, MediaWiki\Revision\RevisionStoreRecord)
#3/srv/mediawiki/php-1.45.0-wmf.19/includes/Rest/Handler/Helper/HtmlOutputRendererHelper.php(931)MediaWiki\Page\ParserOutputAccess->getParserOutput(MediaWiki\Page\PageStoreRecord, MediaWiki\Parser\ParserOptions, MediaWiki\Revision\RevisionStoreRecord, array)
#4/srv/mediawiki/php-1.45.0-wmf.19/includes/Rest/Handler/Helper/HtmlOutputRendererHelper.php(661)MediaWiki\Rest\Handler\Helper\HtmlOutputRendererHelper->getParserOutputInternal()
#5/srv/mediawiki/php-1.45.0-wmf.19/includes/Rest/Handler/Helper/HtmlOutputRendererHelper.php(485)MediaWiki\Rest\Handler\Helper\HtmlOutputRendererHelper->getParserOutput()
#6/srv/mediawiki/php-1.45.0-wmf.19/includes/Rest/Handler/PageHTMLHandler.php(104)MediaWiki\Rest\Handler\Helper\HtmlOutputRendererHelper->getHtml()
#7/srv/mediawiki/php-1.45.0-wmf.19/includes/Rest/SimpleHandler.php(41)MediaWiki\Rest\Handler\PageHTMLHandler->run(string)
#8/srv/mediawiki/php-1.45.0-wmf.19/includes/Rest/Module/Module.php(454)MediaWiki\Rest\SimpleHandler->execute()
#9/srv/mediawiki/php-1.45.0-wmf.19/includes/Rest/Module/Module.php(301)MediaWiki\Rest\Module\Module->executeHandler(MediaWiki\Rest\Handler\PageHTMLHandler)
#10/srv/mediawiki/php-1.45.0-wmf.19/includes/Rest/Router.php(485)MediaWiki\Rest\Module\Module->execute(string, MediaWiki\Rest\RequestFromGlobals)
#11/srv/mediawiki/php-1.45.0-wmf.19/includes/Rest/Router.php(444)MediaWiki\Rest\Router->doExecute(string, MediaWiki\Rest\RequestFromGlobals)
#12/srv/mediawiki/php-1.45.0-wmf.19/includes/Rest/EntryPoint.php(207)MediaWiki\Rest\Router->execute(MediaWiki\Rest\RequestFromGlobals)
#13/srv/mediawiki/php-1.45.0-wmf.19/includes/MediaWikiEntryPoint.php(198)MediaWiki\Rest\EntryPoint->execute()
#14/srv/mediawiki/php-1.45.0-wmf.19/rest.php(39)MediaWiki\MediaWikiEntryPoint->run()
#15/srv/mediawiki/w/rest.php(3)require(string)
#16{main}
Impact

Small number of errors following group1 promotion of wmf.19.

Notes

Possibly due to https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1163428 (based on backtrace and blames). @cscott and @ihurbain please help with triage and resolution.

Details

Request URL
https://bn.wikisource.org/w/rest.php/v1/page/%E0%A6%A8%E0%A6%BF%E0%A6%B0%E0%A7%8D%E0%A6%98%E0%A6%A3%E0%A7%8D%E0%A6%9F:%E0%A6%B2%E0%A7%87%E0%A6%96%E0%A6%AE%E0%A6%BE%E0%A6%B2%E0%A6%BE%E0%A6%A8%E0%A7%81%E0%A6%95%E0%A7%8D%E0%A6%B0%E0%A6%AE%E0%A6%A3%E0%A7%80_(%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A6%A5%E0%A6%AE_%E0%A6%96%E0%A6%A3%E0%A7%8D%E0%A6%A1,_%E0%A6%AA%E0%A7%8D%E0%A6%B0%E0%A6%A5%E0%A6%AE_%E0%A6%AD%E0%A6%BE%E0%A6%97).djvu/html
Related Changes in Gerrit:

Event Timeline

@dduvall thanks for reporting.
From a quick look at it, we may have an issue deserializing from ParserCache. I'll put that as High for the moment:

  • it would normally warrant UBN in general
  • the mitigating factor seems to be that it only hits wikisource, which makes me think we're doing something awkward on wikisource serialization that we haven't taken into account for
  • and the error volume is low-ish enough that it feels like "not a all-hands-on-deck fire".

This is still in my view a train blocker (I don't want to roll to group 2 until I understand exactly what's going on), and if that factor warrants a UBN, feel free to up priority.

It seems that there's something fishy around non-wikitext ParserOutputs. It may happen that we have an inconsistency between "this is parsed with parsoid", possibly somewhere in the parseroptions, and "lol no because Parsoid is not handling this type of content" - all the issues are seen on either djvu or pdf URLs, except one on test2wiki that has a content change to javascript (so that looks like a promising avenue).

I'm flying a bit blind on the fix, because I'm not yet sure how I can reproduce this in a reasonable way locally (also: it's my second post-sabbatical day back, so I'm a bit rusty still 😅 ) - I do have an easy to check reproducer on test2wiki, though (so worst case we can deploy there and see if it's indeed a fix - when I have pondered the issue a bit more.)

This is still a train blocker, considering the hypothesized issue.

I have a local repro, working on fix now.

Change #1189441 had a related patch set uploaded (by Isabelle Hurbain-Palatin; author: Isabelle Hurbain-Palatin):

[mediawiki/core@master] Do not access bundle on non-Parsoid content

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

The patch above should fix it; once it is reviewed it can be integrated to the train to unblock it.

Change #1189441 merged by jenkins-bot:

[mediawiki/core@master] Do not access bundle on non-Parsoid content

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

Change #1189453 had a related patch set uploaded (by Ladsgroup; author: Isabelle Hurbain-Palatin):

[mediawiki/core@wmf/1.45.0-wmf.19] Do not access bundle on non-Parsoid content

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

Change #1189453 merged by jenkins-bot:

[mediawiki/core@wmf/1.45.0-wmf.19] Do not access bundle on non-Parsoid content

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

Mentioned in SAL (#wikimedia-operations) [2025-09-18T11:51:00Z] <ladsgroup@deploy1003> Started scap sync-world: Backport for [[gerrit:1189453|Do not access bundle on non-Parsoid content (T404902)]]

Mentioned in SAL (#wikimedia-operations) [2025-09-18T11:57:06Z] <ladsgroup@deploy1003> ladsgroup: Backport for [[gerrit:1189453|Do not access bundle on non-Parsoid content (T404902)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-09-18T12:07:33Z] <ladsgroup@deploy1003> Finished scap sync-world: Backport for [[gerrit:1189453|Do not access bundle on non-Parsoid content (T404902)]] (duration: 16m 33s)