Page MenuHomePhabricator

Unable to view certain pages due to Fatal exception: "Bad parser output text"
Closed, ResolvedPublicPRODUCTION ERROR




[{exception_id}] {exception_url}   MWException from line 334 of /srv/mediawiki/php-1.32.0-wmf.23/includes/parser/ParserOutput.php: Bad parser output text.
#0 /srv/mediawiki/php-1.32.0-wmf.23/includes/parser/ParserOutput.php(345): Closure$ParserOutput::getText(array)
#1 /srv/mediawiki/php-1.32.0-wmf.23/includes/OutputPage.php(1902): ParserOutput->getText(array)
#2 /srv/mediawiki/php-1.32.0-wmf.23/includes/OutputPage.php(1917): OutputPage->addParserOutputText(ParserOutput, array)
#3 /srv/mediawiki/php-1.32.0-wmf.23/includes/page/Article.php(697): OutputPage->addParserOutput(ParserOutput, array)
#4 /srv/mediawiki/php-1.32.0-wmf.23/includes/actions/ViewAction.php(68): Article->view()
#5 /srv/mediawiki/php-1.32.0-wmf.23/includes/MediaWiki.php(501): ViewAction->show()
#6 /srv/mediawiki/php-1.32.0-wmf.23/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#7 /srv/mediawiki/php-1.32.0-wmf.23/includes/MediaWiki.php(868): MediaWiki->performRequest()
#8 /srv/mediawiki/php-1.32.0-wmf.23/includes/MediaWiki.php(525): MediaWiki->main()
#9 /srv/mediawiki/php-1.32.0-wmf.23/index.php(42): MediaWiki->run()
#10 /srv/mediawiki/w/index.php(3): include(string)


This is fatal exception is exposed on a public GET-able url. Marking as high priority due to its risk, and its tendency to cause false alarms for SRE.

  • Seem to have started on 13 September (1.32.0-wmf.19).
  • Has affected,, and
  • Example url:

Maybe related:

Event Timeline

Krinkle created this task.

The example URL is failing because the cached ParserOutput for the page contains <mw:editsection page="Talk:School:HPX_Study_Group" section="T-1"></mw:editsection>, which has an invalid title.

I see the page was created in 2014, and the logging row with log_id=992 indicates that in August 2018 it had title "School:HPX_Study_Group" in namespace 0. Then rOMWC60f87b7c5a1b: Create new namespaces in zhwikiversity created the "School" namespace, and presumably someone ran NamespaceDupes.php to move it to the new namespace.

A purge or null edit will probably fix it, or it'll be fixed once the parser cache entry expires.

Thanks, so that leaves us with two avenues to explore.

  1. Fixing the specific bug we found so it can't happen again.
  2. Making sure that a ParserOutput object in this kind of state (whether due to this bug or a different bug in the future) does not produce a fatal error. Instead, it seems like this is a case where we could naturally detect the object to be invalid and discard it, the same we treat stale cache, and just re-parse on view like we do in many other cases already. Alternatively, if this error can sometimes be caused by other factors (e.g. detection of safe-to-reparse is difficult), then perhaps in the short-term we can at least print a better error message, and not expose repeatable HTTP 5xx on public GET.

Regarding the first point, the wikitext contains the following:

*想展開討論請點選{{edit|Talk:School:HPX_Study_Group|此連結}},留言後請使用 <nowiki>~~~~</nowiki>自動簽名以資識別。

A page like this would've had to be purged (directly or indirectly) by the running of the namespaceDupes.php maintenance script, right?

Because the script would've effectively renamed Talk:School:HPX_Study_Group, a page that was transcluded. Something like that would normally queue a refreshLinks job so that we can change red-links to blue-links, and vice versa. Short of proactively purging, we'd at least have to propagate page_touched to transclusions so that they will re-parse on-demand, which isn't happening for this page either.

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

Assuming this resolved itself with parser cache expiry. Please re-open if this is still a problem.