Page MenuHomePhabricator

LQT: PHP Fatal error: Call to a member function setFragment() on a non-object in ThreadPermalinkView.php on line 168
Closed, ResolvedPublicPRODUCTION ERROR

Description

[07-Jan-2014 20:25:35] Fatal error: Call to a member function setFragment() on a non-object at /usr/local/apache/common-local/php-1.23wmf9/extensions/LiquidThreads/pages/ThreadPermalinkView.php on line 168
Server: mw1075
Method: GET
URL: http://www.mediawiki.org/wiki/Thread:Project:Support_desk/Enter_information_for_Leon_Turner_of_Life_in_Wikipedia_database./reply_(2)
Backtrace:
#0 /usr/local/apache/common-local/php-1.23wmf9/extensions/LiquidThreads/pages/ThreadPermalinkView.php(168): ThreadPermalinkView::getSubtitle()
#1 /usr/local/apache/common-local/php-1.23wmf9/extensions/LiquidThreads/pages/ThreadPermalinkView.php(231): ThreadPermalinkView->getSubtitle()
#2 /usr/local/apache/common-local/php-1.23wmf9/extensions/LiquidThreads/classes/Dispatch.php(100): ThreadPermalinkView->show()
#3 /usr/local/apache/common-local/php-1.23wmf9/extensions/LiquidThreads/classes/Dispatch.php(220): LqtDispatch::threadPermalinkMain(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
#4 [internal function]: LqtDispatch::tryPage(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest), Object(MediaWiki))
#5 /usr/local/apache/common-local/php-1.23wmf9/includes/Hooks.php(199): call_user_func_array('LqtDispatch::tr...', Array)
#6 /usr/local/apache/common-local/php-1.23wmf9/includes/GlobalFunctions.php(4032): Hooks::run('MediaWikiPerfor...', Array)
#7 /usr/local/apache/common-local/php-1.23wmf9/includes/Wiki.php(423): wfRunHooks('MediaWikiPerfor...', Array)
#8 /usr/local/apache/common-local/php-1.23wmf9/includes/Wiki.php(305): MediaWiki->performAction(Object(Article), Object(Title))
#9 /usr/local/apache/common-local/php-1.23wmf9/includes/Wiki.php(596): MediaWiki->performRequest()
#10 /usr/local/apache/common-local/php-1.23wmf9/includes/Wiki.php(460): MediaWiki->main()
#11 /usr/local/apache/common-local/php-1.23wmf9/index.php(49): MediaWiki->run()
#12 /usr/local/apache/common-local/w/index.php(3): require('/usr/local/apac...')
#13 {main}

From T56670 can be reproduced via https://www.mediawiki.org/wiki/Thread:Talk:MediaWiki_1.19/Broken_redirects_and_sidebar_display_after_upgrade_from_MW_1.12_to_MW_1.19/reply_(2)


Version: unspecified
Severity: normal
See Also:
T43056: LQT: Call to a member function getPrefixedText() on a non-object in ThreadPermalinkView.php on line 207
T56254: LQT: Call to a member function getPrefixedText() on a non-object in ThreadPermalinkView.php on line 83

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:27 AM
bzimport set Reference to bz59791.
bzimport added a subscriber: Unknown Object (MLST).
		if ( $this->thread->hasSuperthread() ) {
			$topmostTitle = $this->thread->topmostThread()->title();
			$topmostTitle->setFragment( $fragment );

			$linkText = wfMessage( 'lqt_discussion_link' )->parse();
			$permalink = Linker::link( $topmostTitle, $linkText );

			return wfMessage( 'lqt_fragment' )->rawParams( $permalink, $talkpage_link )->parse();
		} else {
			return wfMessage( 'lqt_from_talk' )->rawParams( $talkpage_link )->parse();
		}

Can and will return null:
$topmostTitle = $this->thread->topmostThread()->title();

  • Bug 54670 has been marked as a duplicate of this bug. ***

Both reported tickets and one reported today in #wikimedia-tech are a link ending with
/reply_(2)

hashar renamed this task from PHP Fatal error: Call to a member function setFragment() on a non-object in ThreadPermalinkView.php on line 168 to LQT: PHP Fatal error: Call to a member function setFragment() on a non-object in ThreadPermalinkView.php on line 168.Jun 5 2015, 10:01 AM
hashar updated the task description. (Show Details)
hashar added subscribers: siebrand, werdna.
hashar lowered the priority of this task from Medium to Low.Jun 5 2015, 10:04 AM
hashar subscribed.

Barely happens in production. Seems to be triggered when accessing a thread that has been deleted.

Another example:

Exception encountered, of type "BadMethodCallException"
[4e2c3a38] /w/i.php?oldid=3855518 BadMethodCallException from line 123 of /srv/mediawiki/tags/2015-08-26_14:44:03/extensions/LiquidThreads/pages/ThreadPermalinkView.php: Call to a member function setFragment() on a non-object (NULL)
Backtrace:
#0 /srv/mediawiki/tags/2015-08-26_14:44:03/extensions/LiquidThreads/pages/ThreadPermalinkView.php(186): ThreadPermalinkView->getSubtitle()
#1 /srv/mediawiki/tags/2015-08-26_14:44:03/extensions/LiquidThreads/classes/Dispatch.php(101): ThreadPermalinkView->show()
#2 /srv/mediawiki/tags/2015-08-26_14:44:03/extensions/LiquidThreads/classes/Dispatch.php(223): LqtDispatch::threadPermalinkMain(OutputPage, Article, Title, User, WebRequest)
#3 /srv/mediawiki/tags/2015-08-26_14:44:03/includes/Hooks.php(204): LqtDispatch::tryPage(OutputPage, Article, Title, User, WebRequest, MediaWiki)
#4 /srv/mediawiki/tags/2015-08-26_14:44:03/includes/MediaWiki.php(435): Hooks::run(string, array)
#5 /srv/mediawiki/tags/2015-08-26_14:44:03/includes/MediaWiki.php(255): MediaWiki->performAction(Article, Title)
#6 /srv/mediawiki/tags/2015-08-26_14:44:03/includes/MediaWiki.php(683): MediaWiki->performRequest()
#7 /srv/mediawiki/tags/2015-08-26_14:44:03/includes/MediaWiki.php(474): MediaWiki->main()
#8 /srv/mediawiki/tags/2015-08-21_05:37:22/index.php(41): MediaWiki->run()
#9 {main}

https://translatewiki.net/w/i.php?oldid=3855518 (not deleted)

Mattflaschen-WMF raised the priority of this task from Low to Medium.Aug 27 2015, 6:08 PM
			$topmostTitle = $this->thread->topmostThread()->title();
			$topmostTitle->setFragment( $fragment );

So title() is returning null, which it is documented that it can do..

Could this be raised to high or unbreak now

Not without explaining why you think this bug has suddenly become more urgent (having a testcase does not make this suddenly more urgent to fix). Report status and priority fields summarize and reflect reality and do not cause it.

Jdforrester-WMF lowered the priority of this task from Medium to Lowest.Aug 4 2016, 11:33 PM
Jdforrester-WMF subscribed.

LiquidThreads has been replaced by StructuredDiscussions on all Wikimedia production wikis (except one, which will be done soon). It is no longer under active development or maintenance, so I'm re-classifying all open LQT tasks as "Lowest" priority.

Nemo_bis raised the priority of this task from Lowest to Medium.Aug 5 2016, 7:32 AM
Krinkle subscribed.

Thanks, this is still reproducible.

2018-07-31 23:24:47 [W2DvvwpAMFsAAENTQn4AAAAX] mw1256 mediawikiwiki 1.32.0-wmf.15 exception ERROR: /wiki/Thread:Project:Support_desk/Adding_custom_style_for_special_pages/reply_(2)

[Exception BadMethodCallException] (/srv/mediawiki/php-1.32.0-wmf.15/extensions/LiquidThreads/pages/ThreadPermalinkView.php:130) Call to a member function setFragment() on a non-object (null)
  #0 /srv/mediawiki/php-1.32.0-wmf.15/extensions/LiquidThreads/pages/ThreadPermalinkView.php(193): ThreadPermalinkView->getSubtitle()
  #1 /srv/mediawiki/php-1.32.0-wmf.15/extensions/LiquidThreads/classes/Dispatch.php(102): ThreadPermalinkView->show()
  #2 /srv/mediawiki/php-1.32.0-wmf.15/extensions/LiquidThreads/classes/Dispatch.php(224): LqtDispatch::threadPermalinkMain(OutputPage, Article, Title, User, WebRequest)
  #3 /srv/mediawiki/php-1.32.0-wmf.15/includes/Hooks.php(174): LqtDispatch::tryPage(OutputPage, Article, Title, User, WebRequest, MediaWiki)
  #4 /srv/mediawiki/php-1.32.0-wmf.15/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
  #5 /srv/mediawiki/php-1.32.0-wmf.15/includes/MediaWiki.php(472): Hooks::run(string, array)
  #6 /srv/mediawiki/php-1.32.0-wmf.15/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
  #7 /srv/mediawiki/php-1.32.0-wmf.15/includes/MediaWiki.php(867): MediaWiki->performRequest()
  #8 /srv/mediawiki/php-1.32.0-wmf.15/includes/MediaWiki.php(524): MediaWiki->main()
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:12 PM

Change 533153 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/extensions/LiquidThreads@master] Speculative to avoid setting subtitle when no title is found

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

Change 533153 merged by jenkins-bot:
[mediawiki/extensions/LiquidThreads@master] Speculative to avoid setting subtitle when no title is found

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

Change 534396 had a related patch set uploaded (by Kosta Harlan; owner: Kosta Harlan):
[mediawiki/extensions/LiquidThreads@master] Another speculative fix for when topmostThread title is not found

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

kostajh subscribed.

Still fails, see https://logstash.wikimedia.org/app/kibana#/doc/logstash-*/logstash-2019.09.04/mediawiki?id=AWz7npihaTyU0YVHVcfa&_g=h@44136fa

#0 /srv/mediawiki/php-1.34.0-wmf.21/extensions/LiquidThreads/pages/ThreadPermalinkView.php(193): ThreadPermalinkView->getSubtitle()
#1 /srv/mediawiki/php-1.34.0-wmf.21/extensions/LiquidThreads/classes/Dispatch.php(102): ThreadPermalinkView->show()
#2 /srv/mediawiki/php-1.34.0-wmf.21/extensions/LiquidThreads/classes/Dispatch.php(224): LqtDispatch::threadPermalinkMain(OutputPage, Article, Title, User, WebRequest)
#3 /srv/mediawiki/php-1.34.0-wmf.21/includes/Hooks.php(174): LqtDispatch::tryPage(OutputPage, Article, Title, User, WebRequest, MediaWiki)
#4 /srv/mediawiki/php-1.34.0-wmf.21/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#5 /srv/mediawiki/php-1.34.0-wmf.21/includes/MediaWiki.php(479): Hooks::run(string, array)
#6 /srv/mediawiki/php-1.34.0-wmf.21/includes/MediaWiki.php(302): MediaWiki->performAction(Article, Title)
#7 /srv/mediawiki/php-1.34.0-wmf.21/includes/MediaWiki.php(892): MediaWiki->performRequest()
#8 /srv/mediawiki/php-1.34.0-wmf.21/includes/MediaWiki.php(523): MediaWiki->main()
#9 /srv/mediawiki/php-1.34.0-wmf.21/index.php(42): MediaWiki->run()
#10 /srv/mediawiki/w/index.php(3): include(string)
#11 {main}

Change 534396 merged by jenkins-bot:
[mediawiki/extensions/LiquidThreads@master] Another speculative fix for when topmostThread title is not found

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

Krinkle assigned this task to kostajh.

Presumed fixed.