Page MenuHomePhabricator

BadMethodCallException from line 29 of Graph/Graph.body.php: Call to a member function getIsPreview() on a non-object (NULL)
Closed, ResolvedPublic

Description

this is somewhat frequent in the logs

/w/index.php?title=%E7%89%B9%E5%88%A5:MathShowImage&hash=773282d0f15f7cd9b50ac4b8268c896a&mode=mathml 
BadMethodCallException from line 29 of /srv/mediawiki/php-1.26wmf17/extensions/Graph/Graph.body.php:
Call to a member function getIsPreview() on a non-object (NULL) {
"exception":"
[Exception BadMethodCallException] (/srv/mediawiki/php-1.26wmf17/extensions/Graph/Graph.body.php:29)
Call to a member function getIsPreview() on a non-object (NULL)
[stacktrace]
#0 /srv/mediawiki/php-1.26wmf17/includes/Hooks.php(204): Graph\\Singleton::onParserAfterParse(Parser)
#1 /srv/mediawiki/php-1.26wmf17/extensions/Math/MathTexvc.php(397): Hooks::run(string, array)
#2 /srv/mediawiki/php-1.26wmf17/extensions/Math/SpecialMathShowImage.php(96): MathTexvc->getPng()
#3 /srv/mediawiki/php-1.26wmf17/includes/specialpage/SpecialPage.php(384): SpecialMathShowImage->execute(NULL)
#4 /srv/mediawiki/php-1.26wmf17/includes/specialpage/SpecialPageFactory.php(553): SpecialPage->run(NULL)
#5 /srv/mediawiki/php-1.26wmf17/includes/MediaWiki.php(249): SpecialPageFactory::executePath(Title, RequestContext)
#6 /srv/mediawiki/php-1.26wmf17/includes/MediaWiki.php(677): MediaWiki->performRequest()
#7 /srv/mediawiki/php-1.26wmf17/includes/MediaWiki.php(474): MediaWiki->main()
#8 /srv/mediawiki/php-1.26wmf17/index.php(41): MediaWiki->run()
#9 /srv/mediawiki/w/index.php(3): include(string)
#10 {main}
"}

Event Timeline

aude created this task.Aug 12 2015, 1:10 PM
aude updated the task description. (Show Details)
aude raised the priority of this task from to Needs Triage.
aude added projects: Graphs, Math.
aude added a subscriber: aude.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 12 2015, 1:10 PM

Change 229391 had a related patch set uploaded (by Yurik):
Handle missing parser in onParserAfterParse

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

Change 229391 merged by jenkins-bot:
Handle missing parser in onParserAfterParse

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

Yurik updated the task description. (Show Details)Aug 13 2015, 1:41 AM
Yurik set Security to None.
Yurik updated the task description. (Show Details)
aude triaged this task as High priority.Aug 13 2015, 1:15 PM

Change 231339 had a related patch set uploaded (by Chad):
Handle missing parser in onParserAfterParse

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

Change 231339 merged by jenkins-bot:
Handle missing parser in onParserAfterParse

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

This still looks to be happening...

Reedy renamed this task from BadMethodCallException from line 29 of /srv/mediawiki/php-1.26wmf17/extensions/Graph/Graph.body.php: Call to a member function getIsPreview() on a non-object (NULL) to BadMethodCallException from line 29 of Graph/Graph.body.php: Call to a member function getIsPreview() on a non-object (NULL) .Aug 14 2015, 12:52 PM

Yup, seems to be the most prevalent error atm. 846 in the last hour

Change 229391 merged by jenkins-bot:
Handle missing parser in onParserAfterParse

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

It's not a missing parser, it's getOptions() returning null, not $parser being null

Reedy added a comment.Aug 14 2015, 1:04 PM

But the Math extension is to blame anyway, just creating a new Parser, which should then probably be calling startExternalParse passing ParserOptions

https://github.com/wikimedia/mediawiki-extensions-Math/blob/master/MathTexvc.php#L392-L398

Reedy added a comment.Aug 14 2015, 1:18 PM

@Physikerwelt Can you look at the Math code?

That's definitely one of the worst parts of the Math extension. The hook is
called to ensure that the png image has really been saved to the
filesystem. That this triggers other extensions is not really desired.
Is there another way to only save the image?

Jdforrester-WMF moved this task from Incoming to Next-up on the Math board.Sep 2 2015, 5:39 PM
Physikerwelt closed this task as Resolved.Oct 31 2015, 9:11 AM
Physikerwelt claimed this task.