Page MenuHomePhabricator

Error page: "Call to a member function getMagicISBNLinks() on a non-object (null)"
Closed, ResolvedPublic

Description

Enter 'Mavetuna33 2' (deleted page) in Search box and click 'search' or enter any something that return 0 search result:

The error page will be displayed:
https://en.wikipedia.beta.wmflabs.org/w/index.php?search=Mavetuna33+2&title=Special%3ASearch

[V@RZmApEE4AAAG-AHzwAAAAL] /w/index.php?search=Mavetuna33+2&title=Special%3ASearch BadMethodCallException from line 6062 of /srv/mediawiki/php-master/includes/parser/Parser.php: Call to a member function getMagicISBNLinks() on a non-object (null)

Backtrace:

#0 /srv/mediawiki/php-master/includes/GlobalFunctions.php(1671): Parser->escapeWikitext(string)
#1 /srv/mediawiki/php-master/includes/specials/SpecialSearch.php(600): wfEscapeWikiText(string)
#2 /srv/mediawiki/php-master/includes/specials/SpecialSearch.php(372): SpecialSearch->showCreateLink(Title, integer, NULL, CirrusSearch\Search\ResultSet)
#3 /srv/mediawiki/php-master/includes/specials/SpecialSearch.php(242): SpecialSearch->showResults(string)
#4 /srv/mediawiki/php-master/includes/specials/SpecialSearch.php(152): SpecialSearch->goResult(string)
#5 /srv/mediawiki/php-master/includes/specialpage/SpecialPage.php(522): SpecialSearch->execute(NULL)
#6 /srv/mediawiki/php-master/includes/specialpage/SpecialPageFactory.php(583): SpecialPage->run(NULL)
#7 /srv/mediawiki/php-master/includes/MediaWiki.php(283): SpecialPageFactory::executePath(Title, RequestContext)
#8 /srv/mediawiki/php-master/includes/MediaWiki.php(861): MediaWiki->performRequest()
#9 /srv/mediawiki/php-master/includes/MediaWiki.php(522): MediaWiki->main()
#10 /srv/mediawiki/php-master/index.php(43): MediaWiki->run()
#11 /srv/mediawiki/w/index.php(3): include(string)
#12 {main}

Screen Shot 2016-09-22 at 3.22.43 PM.png (556×1 px, 189 KB)

The logging table shows multiple deletion, but I cannot figure out what makes this specific error to be displayed.

Event Timeline

Catrope triaged this task as Unbreak Now! priority.Sep 22 2016, 11:04 PM
Etonkovidova renamed this task from Error page on displaying a page: "Call to a member function getMagicISBNLinks() on a non-object (null)" to Error page: "Call to a member function getMagicISBNLinks() on a non-object (null)".Sep 22 2016, 11:11 PM
Etonkovidova updated the task description. (Show Details)

Yeah, my fault. I'll revert for now and debug later.

Change 312439 had a related patch set uploaded (by Legoktm):
Revert "Move wfEscapeWikiText() to Parser::escapeWikitext()"

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

Change 312439 merged by jenkins-bot:
Revert "Move wfEscapeWikiText() to Parser::escapeWikitext()"

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

This is unrelated to search, it just happens to first come up there.

ebernhardson@deployment-mira:~$ echo 'wfEscapeWikitext("foo");' | mwscript eval.php --wiki enwiki
PHP Notice:  Undefined variable: wmgMFUseCentralAuthToken in /srv/mediawiki-staging/wmf-config/mobile-labs.php on line 20
Notice: Undefined variable: wmgMFUseCentralAuthToken in /srv/mediawiki-staging/wmf-config/mobile-labs.php on line 20
PHP Fatal error:  Call to a member function getMagicISBNLinks() on null in /srv/mediawiki-staging/php-master/includes/parser/Parser.php on line 6062
Fatal error: Call to a member function getMagicISBNLinks() on null in /srv/mediawiki-staging/php-master/includes/parser/Parser.php on line 6062

Something must have changed in the parser that is no longer initializing mOptions when doing a wfEscapeWikiText() call. I tried the latest core code in vagrant but it doesn't show the same issue, so it is probably triggered by some global state as setup in mediawiki-config repo.

Re-assigning to parser team to look into.

Yeah sorry about that.