Page MenuHomePhabricator

ThanksHooks::insertThankLink: Call to a member function getUser() on a non-object (null)
Closed, ResolvedPublic2 Story Points

Description

Spotted in production: Call to a member function getUser() on a non-object (null)

Urls look like: commons.wikimedia.org/wiki/File:Natur.jpg.jpg (so far the only URL we've seen)

Stacktrace:

#0 /srv/mediawiki/php-1.31.0-wmf.25/extensions/Thanks/includes/ThanksHooks.php(397): ThanksHooks::insertThankLink(NULL, NULL, NULL, User)
#1 /srv/mediawiki/php-1.31.0-wmf.25/includes/Hooks.php(177): ThanksHooks::onLogEventsListLineEnding(LogEventsList, string, DatabaseLogEntry, array, array)
#2 /srv/mediawiki/php-1.31.0-wmf.25/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)
#3 /srv/mediawiki/php-1.31.0-wmf.25/includes/logging/LogEventsList.php(422): Hooks::run(string, array)
#4 /srv/mediawiki/php-1.31.0-wmf.25/includes/logging/LogPager.php(365): LogEventsList->logLine(stdClass)
#5 /srv/mediawiki/php-1.31.0-wmf.25/includes/pager/IndexPager.php(445): LogPager->formatRow(stdClass)
#6 /srv/mediawiki/php-1.31.0-wmf.25/includes/logging/LogEventsList.php(657): IndexPager->getBody()
#7 /srv/mediawiki/php-1.31.0-wmf.25/includes/page/ImagePage.php(601): LogEventsList::showLogExtract(OutputPage, array, string, string, array)
#8 /srv/mediawiki/php-1.31.0-wmf.25/includes/page/ImagePage.php(138): ImagePage->openShowImage()
#9 /srv/mediawiki/php-1.31.0-wmf.25/includes/actions/ViewAction.php(68): ImagePage->view()
#10 /srv/mediawiki/php-1.31.0-wmf.25/includes/MediaWiki.php(500): ViewAction->show()
#11 /srv/mediawiki/php-1.31.0-wmf.25/includes/MediaWiki.php(294): MediaWiki->performAction(ImagePage, Title)
#12 /srv/mediawiki/php-1.31.0-wmf.25/includes/MediaWiki.php(861): MediaWiki->performRequest()
#13 /srv/mediawiki/php-1.31.0-wmf.25/includes/MediaWiki.php(524): MediaWiki->main()
#14 /srv/mediawiki/php-1.31.0-wmf.25/index.php(42): MediaWiki->run()
#15 /srv/mediawiki/w/index.php(3): include(string)
#16 {main}

Likely culprit: https://gerrit.wikimedia.org/r/#/c/415803/

Event Timeline

demon created this task.Mar 14 2018, 9:50 PM
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptMar 14 2018, 9:50 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Breaks CI too

21:59:34 1) ApiCoreThankIntegrationTest::testMediaWikiTestCaseParentSetupCalled
21:59:34 BadMethodCallException: Call to a member function getId() on a non-object (null)
21:59:34 
21:59:34 /home/jenkins/workspace/mediawiki-extensions-hhvm-jessie/src/extensions/Thanks/tests/phpunit/ApiCoreThankIntegrationTest.php:37
21:59:34 /home/jenkins/workspace/mediawiki-extensions-hhvm-jessie/src/tests/phpunit/MediaWikiTestCase.php:420
21:59:34 /home/jenkins/workspace/mediawiki-extensions-hhvm-jessie/src/maintenance/doMaintenance.php:94

Mentioned in SAL (#wikimedia-operations) [2018-03-14T22:13:06Z] <reedy@tin> Synchronized php-1.31.0-wmf.25/extensions/Thanks: T189752 (duration: 01m 16s)

The CI issue is probably unrelated, thanks CI has been broken for a long time: T151878

Samwilson moved this task from Ready to In Development on the Community-Tech-Sprint board.

Change 419641 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/extensions/Thanks@master] Add revision-thanking links to some log entries

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

matmarex removed a subscriber: matmarex.Mar 15 2018, 2:07 AM

The stacktrace looks very similar to the issue reported in T189663: [betalabs] BadMethodCallException for non-existing page. I'll check after the patch will be merged.

Change 419641 merged by jenkins-bot:
[mediawiki/extensions/Thanks@master] Add revision-thanking links to some log entries

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

kaldari set the point value for this task to 2.Apr 3 2018, 10:47 PM
Samwilson closed this task as Resolved.Apr 4 2018, 3:20 AM
Samwilson moved this task from Needs Review/Feedback to Q1 2018-19 on the Community-Tech-Sprint board.
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:09 PM