Page MenuHomePhabricator

Error: Call to a member function getKey() on null
Closed, ResolvedPublicPRODUCTION ERROR

Description

Steps to replicate the issue (include links if applicable):

What happens?: Rarely, a normal diff is shown. Usually, a 'Fatal exception of type "Error"' happens. Sometimes the HTML body is the error message, sometimes a shorter message appears in the #bodyContent element. Once a normal diff is shown, it seems to be cached.

The same happens when trying to preview changes or to save the page.

What should have happened instead?:

Error
normalized_message
[da200b90-f7fa-4f25-958e-d2da5e700be0] /w/index.php?diff=prev&oldid=60282220&title=Sjabloon:Bètaverval   Error: Call to a member function getKey() on null
exception.trace
from /srv/mediawiki/php-1.41.0-wmf.30/extensions/Math/src/MathRenderer.php(699)
#0 /srv/mediawiki/php-1.41.0-wmf.30/extensions/Math/src/MathRenderer.php(603): MediaWiki\Extension\Math\MathRenderer->doCheck()
#1 /srv/mediawiki/php-1.41.0-wmf.30/extensions/Math/src/HookHandlers/ParserHooksHandler.php(118): MediaWiki\Extension\Math\MathRenderer->checkTeX()
#2 /srv/mediawiki/php-1.41.0-wmf.30/extensions/Math/src/HookHandlers/ParserHooksHandler.php(161): MediaWiki\Extension\Math\HookHandlers\ParserHooksHandler->mathPostTagHook(MediaWiki\Extension\Math\MathMathML, Parser)
#3 /srv/mediawiki/php-1.41.0-wmf.30/includes/HookContainer/HookContainer.php(161): MediaWiki\Extension\Math\HookHandlers\ParserHooksHandler->onParserAfterTidy(Parser, string)
#4 /srv/mediawiki/php-1.41.0-wmf.30/includes/HookContainer/HookRunner.php(2903): MediaWiki\HookContainer\HookContainer->run(string, array)
#5 /srv/mediawiki/php-1.41.0-wmf.30/includes/parser/Parser.php(1690): MediaWiki\HookContainer\HookRunner->onParserAfterTidy(Parser, string)
#6 /srv/mediawiki/php-1.41.0-wmf.30/includes/parser/Parser.php(654): Parser->internalParseHalfParsed(string, boolean, boolean)
#7 /srv/mediawiki/php-1.41.0-wmf.30/includes/content/WikitextContentHandler.php(412): Parser->parse(string, MediaWiki\Title\Title, ParserOptions, boolean, boolean, integer)
#8 /srv/mediawiki/php-1.41.0-wmf.30/includes/content/ContentHandler.php(1760): WikitextContentHandler->fillParserOutput(WikitextContent, MediaWiki\Content\Renderer\ContentParseParams, ParserOutput)
#9 /srv/mediawiki/php-1.41.0-wmf.30/includes/content/Renderer/ContentRenderer.php(47): ContentHandler->getParserOutput(WikitextContent, MediaWiki\Content\Renderer\ContentParseParams)
#10 /srv/mediawiki/php-1.41.0-wmf.30/includes/Revision/RenderedRevision.php(260): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput(WikitextContent, MediaWiki\Title\Title, integer, ParserOptions, boolean)
#11 /srv/mediawiki/php-1.41.0-wmf.30/includes/Revision/RenderedRevision.php(232): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
#12 /srv/mediawiki/php-1.41.0-wmf.30/includes/Revision/RevisionRenderer.php(223): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string, array)
#13 /srv/mediawiki/php-1.41.0-wmf.30/includes/Revision/RevisionRenderer.php(164): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#14 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#15 /srv/mediawiki/php-1.41.0-wmf.30/includes/Revision/RenderedRevision.php(199): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#16 /srv/mediawiki/php-1.41.0-wmf.30/includes/poolcounter/PoolWorkArticleView.php(84): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#17 /srv/mediawiki/php-1.41.0-wmf.30/includes/poolcounter/PoolWorkArticleViewOld.php(66): PoolWorkArticleView->renderRevision()
#18 /srv/mediawiki/php-1.41.0-wmf.30/includes/poolcounter/PoolCounterWork.php(167): PoolWorkArticleViewOld->doWork()
#19 /srv/mediawiki/php-1.41.0-wmf.30/includes/page/ParserOutputAccess.php(325): PoolCounterWork->execute()
#20 /srv/mediawiki/php-1.41.0-wmf.30/includes/diff/DifferenceEngine.php(1137): MediaWiki\Page\ParserOutputAccess->getParserOutput(WikiPage, ParserOptions, MediaWiki\Revision\RevisionStoreRecord, integer)
#21 /srv/mediawiki/php-1.41.0-wmf.30/includes/diff/DifferenceEngine.php(931): DifferenceEngine->renderNewRevision()
#22 /srv/mediawiki/php-1.41.0-wmf.30/includes/page/Article.php(979): DifferenceEngine->showDiffPage(boolean)
#23 /srv/mediawiki/php-1.41.0-wmf.30/includes/page/Article.php(490): Article->showDiffPage()
#24 /srv/mediawiki/php-1.41.0-wmf.30/includes/actions/ViewAction.php(78): Article->view()
#25 /srv/mediawiki/php-1.41.0-wmf.30/includes/MediaWiki.php(583): ViewAction->show()
#26 /srv/mediawiki/php-1.41.0-wmf.30/includes/MediaWiki.php(363): MediaWiki->performAction(Article, MediaWiki\Title\Title)
#27 /srv/mediawiki/php-1.41.0-wmf.30/includes/MediaWiki.php(960): MediaWiki->performRequest()
#28 /srv/mediawiki/php-1.41.0-wmf.30/includes/MediaWiki.php(613): MediaWiki->main()
#29 /srv/mediawiki/php-1.41.0-wmf.30/index.php(50): MediaWiki->run()
#30 /srv/mediawiki/php-1.41.0-wmf.30/index.php(46): wfIndexMain()
#31 /srv/mediawiki/w/index.php(3): require(string)
#32 {main}
Impact
Notes

This is preceded by numerous warnings: PHP Notice: Trying to get property 'checked'/ 'success' of non-object

https://gerrit.wikimedia.org/g/mediawiki/extensions/Math/ /bf028a142f37b1b849a61b9af605e6c61026045a/src/MathRestbaseInterface.php#372

Event Timeline

Bdijkstra renamed this task from Fatal exception of type "Error" with {{#tag:chem}} and Vector to Fatal exception of type "Error" with {{#tag:chem}}.Oct 16 2023, 12:25 PM
Bdijkstra updated the task description. (Show Details)
Ammarpad renamed this task from Fatal exception of type "Error" with {{#tag:chem}} to Error: Call to a member function getKey() on null.Oct 16 2023, 4:09 PM
Ammarpad updated the task description. (Show Details)
Aklapper changed the subtype of this task from "Bug Report" to "Production Error".Oct 16 2023, 5:40 PM

There are two ways to move forward: either understanding what input formula causes the problem or emitting a generic error in case the error handler crashes.
I will quickly implement the error handler solution for now.

Change 966291 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):

[mediawiki/extensions/Math@master] Fix: Handle null errors

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

understanding what input formula causes the problem

Is hard to guess from that particular context. Thus I suggest ignoring it for now and investigating that later if it still is a problem. However, it might be hard, as Restbase should normally return json, as long it runs as expected.

Change 966291 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Fix: Handle null errors

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

I'm not sure if the current situation is an improvement. The diff from the description used to fail most of the time, now it seems to fail all of the time. Should I make a new task for this?

I'm not sure if the current situation is an improvement. The diff from the description used to fail most of the time, now it seems to fail all of the time. Should I make a new task for this?

Yes, please make a new one. The error message and the context will be interesting. In the best case, it will tell what's wrong.

@Bdijkstra thank you. To make progress someone needs to find the related logs in logstash and understand what the response from restbase is. Can you do it yourself, or do you need help?

@Bdijkstra thank you. To make progress someone needs to find the related logs in logstash and understand what the response from restbase is. Can you do it yourself, or do you need help?

Bdijkstra isn't part of the nda group, so he doesn't have access to logstash. (Neither do I, so I can't find the relevant entries either)

Bdijkstra isn't part of the nda group, so he doesn't have access to logstash. (Neither do I, so I can't find the relevant entries either)

Me neither, maybe @daniel can help.

Me neither, maybe @daniel can help.

Ah sorry, this error is completely unrelated. I can look into T350004 any help.