Page MenuHomePhabricator

Flow fatal errors call to a member function getPrefixedUrl() on a non-object from TemplateHelper
Closed, ResolvedPublic

Description

From fluorine:/a/mw-log/fatals.log
We got 50 of these in production since frontend-rewrite launched! All with URL http://[unknown-host]
alas.

[2014-07-03 20:38:00] Fatal error: Call to a member function getPrefixedUrl() on a non-object at /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/includes/TemplateHelper.php on line 712
Server: mw1005
URL: http://[unknown-host]
Backtrace:
#0 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/includes/TemplateHelper.php(712): Flow\TemplateHelper::addReturnTo()
#1 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/includes/TemplateHelper.php(731): Flow\TemplateHelper::addReturnTo('//www.mediawiki...')
#2 [internal function]: Flow\TemplateHelper::linkWithReturnTo('Special:UserLog...')
#3 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/vendor/lightncandy.php(1912): call_user_func_array('Flow\TemplateHe...', Array)
#4 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/handlebars/compiled/flow_block_topiclist.handlebars.php(87): LCRun3::ch(Array, 'linkWithReturnT...', Array, 'encq')
#5 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/vendor/lightncandy.php(1974): {closure}(Array, Array)
#6 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/includes/TemplateHelper.php(806): {closure}()
#7 [internal function]: Flow\TemplateHelper::tooltip(Array)
#8 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/vendor/lightncandy.php(2011): call_user_func_array('Flow\TemplateHe...', Array)
#9 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/handlebars/compiled/flow_block_topiclist.handlebars.php(87): LCRun3::hbch(Array, 'tooltip', Array, Array, Object(Closure))
#10 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/vendor/lightncandy.php(1974): {closure}(Array, Array)
#11 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/includes/TemplateHelper.php(694): {closure}()
#12 [internal function]: Flow\TemplateHelper::ifAnonymous(Array)
#13 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/vendor/lightncandy.php(2011): call_user_func_array('Flow\TemplateHe...', Array)
#14 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/handlebars/compiled/flow_block_topiclist.handlebars.php(88): LCRun3::hbch(Array, 'ifAnonymous', Array, Array, Object(Closure))
#15 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/includes/TemplateHelper.php(119): {closure}(Array, Array)
#16 [internal function]: Flow\{closure}(Array, Array)
#17 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/includes/TemplateHelper.php(177): call_user_func(Object(Closure), Array, Array)
#18 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/includes/TemplateHelper.php(395): Flow\TemplateHelper::processTemplate('flow_block_topi...', Array)
#19 [internal function]: Flow\TemplateHelper::block(Array)
#20 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/vendor/lightncandy.php(1912): call_user_func_array('Flow\TemplateHe...', Array)
#21 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/handlebars/compiled/flow_board.handlebars.php(19): LCRun3::ch(Array, 'block', Array, 'encq')
#22 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/vendor/lightncandy.php(1813): {closure}(Array, Array)
#23 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/handlebars/compiled/flow_board.handlebars.php(20): LCRun3::sec(Array, Array, Array, true, Object(Closure))
#24 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/includes/TemplateHelper.php(119): {closure}(Array, Array)
#25 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/includes/View.php(137): Flow\{closure}(Array)
#26 /usr/local/apache/common-local/php-1.24wmf12/extensions/Flow/includes/Content/BoardContent.php(194): Flow\View->show(Object(Flow\WorkflowLoader), 'view')
#27 /usr/local/apache/common-local/php-1.24wmf12/extensions/CirrusSearch/includes/Updater.php(402): Flow\Content\BoardContent->getParserOutput(Object(Title), 1057639)
#28 /usr/local/apache/common-local/php-1.24wmf12/extensions/CirrusSearch/includes/Updater.php(322): CirrusSearch\Updater->getContentAndParserOutput(Object(WikiPage))
#29 /usr/local/apache/common-local/php-1.24wmf12/extensions/CirrusSearch/includes/Updater.php(188): CirrusSearch\Updater->buildDocumentsForPages(Array, 0)
#30 /usr/local/apache/common-local/php-1.24wmf12/extensions/CirrusSearch/includes/Updater.php(67): CirrusSearch\Updater->updatePages(Array, '1ms', 5, 0)
#31 /usr/local/apache/common-local/php-1.24wmf12/extensions/CirrusSearch/includes/LinksUpdateJob.php(47): CirrusSearch\Updater->updateFromTitle(Object(Title))
#32 /usr/local/apache/common-local/php-1.24wmf12/extensions/CirrusSearch/includes/Job.php(55): CirrusSearch\LinksUpdateJob->doJob()
#33 /usr/local/apache/common-local/php-1.24wmf12/maintenance/runJobs.php(110): CirrusSearch\Job->run()
#34 /usr/local/apache/common-local/php-1.24wmf12/maintenance/doMaintenance.php(109): RunJobs->execute()
#35 /usr/local/apache/common-local/php-1.24wmf12/maintenance/runJobs.php(281): require_once('/usr/local/apac...')
#36 /usr/local/apache/common-local/multiversion/MWScript.php(97): require_once('/usr/local/apac...')
#37 {main}


Version: master
Severity: major

Details

Reference
bz67494

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:32 AM
bzimport set Reference to bz67494.
bzimport added a subscriber: Unknown Object (MLST).
Spage created this task.Jul 3 2014, 8:48 PM

It's getting the returnTo URL to add the login link for the tooltip for an anonymous user. But why is it doing it from maintenance CirrusSearch\LinksUpdateJob ??

Change 144070 had a related patch set uploaded by Spage:
RequestContext->getTitle() is not always available

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

^d commented in IRC:

I'm [CirrusSearch] calling for a page's ParserOutput before I bother figuring out what kind of page it is.
If it's not wikitext, we basically discard it anyway.
I'll try to switch this around.

Regardless, this Flow code would fail in any context other than a page request, so we should make it more bulletproof.

Change 144070 merged by jenkins-bot:
RequestContext->getTitle() is not always available

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

All patches mentioned in this report are either merged or abandoned - is there more work left to do here (if yes: please reset the bug report status to NEW or ASSIGNED), or can you close this ticket as RESOLVED FIXED?

Quiddity removed a subscriber: Maryana.Dec 19 2014, 1:34 AM