Page MenuHomePhabricator

ParserOptions.php PHP Notice: Undefined index: math
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error message
ErrorException: PHP Notice: Undefined index: math

This seems to have started happening in .28. It's infrequent so far (.28 is rolled out to group0) but worth a look.

Details

Request ID
YBHk-QpAICgAADSjsKoAAAEL
Request URL
https://www.mediawiki.org/wiki/Manual_talk:Running_MediaWiki_on_macOS
Stack Trace
from /srv/mediawiki/php-1.36.0-wmf.28/includes/parser/ParserOptions.php(1475)
#0 /srv/mediawiki/php-1.36.0-wmf.28/includes/parser/ParserOptions.php(1475): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.36.0-wmf.28/includes/parser/ParserCache.php(376): ParserOptions->isSafeToCache(array)
#2 /srv/mediawiki/php-1.36.0-wmf.28/includes/page/ParserOutputAccess.php(190): ParserCache->get(WikiPage, ParserOptions)
#3 /srv/mediawiki/php-1.36.0-wmf.28/includes/page/Article.php(664): MediaWiki\Page\ParserOutputAccess->getCachedParserOutput(WikiPage, ParserOptions, NULL, integer)
#4 /srv/mediawiki/php-1.36.0-wmf.28/includes/page/Article.php(575): Article->generateContentOutput(User, ParserOptions, integer, OutputPage, array)
#5 /srv/mediawiki/php-1.36.0-wmf.28/includes/actions/ViewAction.php(74): Article->view()
#6 /srv/mediawiki/php-1.36.0-wmf.28/includes/MediaWiki.php(532): ViewAction->show()
#7 /srv/mediawiki/php-1.36.0-wmf.28/includes/MediaWiki.php(316): MediaWiki->performAction(Article, Title)
#8 /srv/mediawiki/php-1.36.0-wmf.28/includes/MediaWiki.php(944): MediaWiki->performRequest()
#9 /srv/mediawiki/php-1.36.0-wmf.28/includes/MediaWiki.php(548): MediaWiki->main()
#10 /srv/mediawiki/php-1.36.0-wmf.28/index.php(53): MediaWiki->run()
#11 /srv/mediawiki/php-1.36.0-wmf.28/index.php(46): wfIndexMain()
#12 /srv/mediawiki/w/index.php(3): require(string)
#13 {main}

Event Timeline

Urbanecm triaged this task as Unbreak Now! priority.Jan 27 2021, 10:27 PM
Urbanecm subscribed.

I refreshed the request URL a couple of times, and this is the result.

image.png (624×1 px, 141 KB)

It appears to happen at every pageview of that page when logged in. Sounds to be a blocker to me => UBN'ing.

Change 659103 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Make ParserOptions::isSafeToCache more robust

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

The patch above should avoid the crash, but it's more of a workaround. Seems like 'Math' extension is using an unregistered parser option math, thus breaking the ParserOptions. This is a bug that needs to be fixed, Math should implement a ParserOptionsRegister hook and register its option.

Sorry, I was not aware of this. The registration has been removed in 2017
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/393650

There's not some very suspicious code left in Math, which records a 'math' option, which doesn't exist as far as ParserOptions are concerned, and then appends it to a rendering hash. Math should either use standard cache split mechanism (please ping me if you decide to do so) or not split the cache at all. Right now there's some backdoor magic going on.

Change 659103 merged by jenkins-bot:
[mediawiki/core@master] Make ParserOptions::isSafeToCache more robust

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

Change 659277 had a related patch set uploaded (by Brennen Bearnes; owner: Ppchelko):
[mediawiki/core@wmf/1.36.0-wmf.28] Make ParserOptions::isSafeToCache more robust

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

Change 659277 merged by jenkins-bot:
[mediawiki/core@wmf/1.36.0-wmf.28] Make ParserOptions::isSafeToCache more robust

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

Mentioned in SAL (#wikimedia-operations) [2021-01-28T20:46:00Z] <brennen@deploy1001> Synchronized php-1.36.0-wmf.28/includes/parser/ParserOptions.php: Backport: [[gerrit:659103|Make ParserOptions::isSafeToCache more robust (T273120)]] (duration: 01m 08s)

Mentioned in SAL (#wikimedia-operations) [2021-01-28T20:49:32Z] <brennen@deploy1001> Synchronized php-1.36.0-wmf.28/tests/phpunit/includes/parser/ParserOptionsTest.php: Backport: [[gerrit:659103|Make ParserOptions::isSafeToCache more robust (T273120)]] (duration: 01m 07s)

brennen lowered the priority of this task from Unbreak Now! to Needs Triage.Jan 28 2021, 10:48 PM
brennen subscribed.

No longer a train blocker. Leaving open per comment above about code in Math.

Krinkle claimed this task.
Krinkle moved this task from Untriaged to Older on the Wikimedia-production-error board.