Page MenuHomePhabricator

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

Description

Error

MediaWiki version: 1.35.0-wmf.1

message
Call to a member function getExtensionData() on boolean

Impact

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

Notes

Happens regularly, and for several weeks already:

Details

Request ID
XaJCbApAEDQAAJZMadwAAACQ
Request URL
/w/api.php?format=json&formatversion=2&action=graph&title=…/…&hash=…
Stack Trace
exception.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}
Related Gerrit Patches:
mediawiki/extensions/Graph : masterHandle null from WikiPage::getParserOutput

Event Timeline

Krinkle created this task.Oct 13 2019, 12:04 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 13 2019, 12:04 AM
Krinkle updated the task description. (Show Details)Oct 13 2019, 12:05 AM

Large spike just happened minutes ago, enough to notify high exception rate on -operations: https://logstash.wikimedia.org/goto/a82a49a001c2f38904cbfbc9fb390292

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?

DLynch added a subscriber: DLynch.Nov 7 2019, 9:13 PM

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

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

Yurik added a subscriber: Yurik.Fri, Dec 6, 5:54 PM

The fix seems sensible, thx!

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

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

Jdforrester-WMF closed this task as Resolved.Fri, Dec 6, 6:35 PM
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): https://logstash.wikimedia.org/app/kibana#/dashboard/Fatal-Monitor?_g=(refreshInterval%3A(display%3AOff%2Cpause%3A!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!