Page MenuHomePhabricator

Fatal from ApiGraph->getGraphSpec: "Call to a member function getExtensionData() on boolean"
Closed, ResolvedPublicPRODUCTION ERROR



MediaWiki version: 1.35.0-wmf.1

Call to a member function getExtensionData() on boolean


When editing pages, previews of graphs might be broken on some wikis.


Happens regularly, and for several weeks already:

Screenshot 2019-10-13 at 01.04.42.png (518×2 px, 93 KB)


Request ID
Request URL
Stack Trace
#0 /includes/libs/objectcache/wancache/WANObjectCache.php(1424): Graph\ApiGraph->Graph\{closure}(boolean, integer, array, NULL)
#1 /includes/libs/objectcache/wancache/WANObjectCache.php(1278): WANObjectCache->fetchOrRegenerate(string, integer, Closure, array)
#2 /extensions/Graph/includes/ApiGraph.php(138): WANObjectCache->getWithSetCallback(string, integer, Closure)
#3 /extensions/Graph/includes/ApiGraph.php(36): Graph\ApiGraph->getGraphSpec(string, integer, string)
#4 /includes/api/ApiMain.php(1588): Graph\ApiGraph->execute()
#5 /includes/api/ApiMain.php(537): ApiMain->executeAction()
#6 /includes/api/ApiMain.php(508): ApiMain->executeActionWithErrorHandling()
#7 /api.php(83): ApiMain->execute()
#8 /srv/mediawiki/w/api.php(3): require(string)
#9 {main}

Event Timeline

Large spike just happened minutes ago, enough to notify high exception rate on -operations:

There's a lot of these for 1.35.0-wmf.2, in the past 24 hours, but none for wmf.3.

There's almost a thousand of these now.

There seems to have been a spike half a hour ago, nothing since.

@ppelberg Is Editing-team the correct tag to use to ask for an initial investigation on issues in areas stewarded by Editing team?

I don't actually know anything about the Graph extension, but a quick glance at the code suggests that it's trying to load a graph-spec from a page that doesn't exist, and doesn't have a sensible check for that failure case.

The boolean in question is: $parserOutput = $page->getParserOutput( $parserOptions, $revId );

The docs indicate that $parserOutput there will be ParserOutput or false if the revision was not found.

A plausible fix for this error looks like it might be to just add this on line 129:

if ( !$parserOutput ) {
    return false;

That said, I don't know anything about Graph, so it's equally possible that the true issue is that an incorrect page title is being passed in from somewhere higher up in the chain. Anyone actually know about it and want to chime in?

Change 555553 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/Graph@master] Handle null from WikiPage::getParserOutput

The fix seems sensible, thx!

Change 555553 merged by jenkins-bot:
[mediawiki/extensions/Graph@master] Handle null from WikiPage::getParserOutput

Jdforrester-WMF assigned this task to Umherirrender.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Current error rate is way down (probably a function of editing patterns):!f%2Cvalue%3A0)%2Ctime%3A(from%3Anow-60d%2Cmode%3Aquick%2Cto%3Anow))

Consequently, I don't think this is worth back-porting, and we'll let it roll out in wmf.10.

Thank you!