Page MenuHomePhabricator

ApiEchoNotifications query fails with "BadMethodCallException: Call getPrefixedText on a non-object" from WikibaseClient
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

Request ID: W5laWwrAAFAAADp8ycsAAAAO

message
BadMethodCallException: Call to a member function getPrefixedText() on a non-object (null)
stacktrace
#0 [internal function]: Wikibase\Client\Notifications\PageConnectionPresentationModel->callbackForBundleCount(EchoEvent)
#1 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/formatters/EventPresentationModel.php(220): array_map(array, array)
#2 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/formatters/EventPresentationModel.php(240): EchoEventPresentationModel->getBundleCount(boolean, array)
#3 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Wikibase/client/includes/Notifications/PageConnectionPresentationModel.php(54): EchoEventPresentationModel->getNotificationCountForOutput(boolean, array)
#4 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/formatters/EventPresentationModel.php(520): Wikibase\Client\Notifications\PageConnectionPresentationModel->getHeaderMessage()
#5 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/formatters/EchoModelFormatter.php(13): EchoEventPresentationModel->jsonSerialize()
#6 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/formatters/EchoEventFormatter.php(64): EchoModelFormatter->formatModel(Wikibase\Client\Notifications\PageConnectionPresentationModel)
#7 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/DataOutputFormatter.php(181): EchoEventFormatter->format(EchoEvent)
#8 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/DataOutputFormatter.php(141): EchoDataOutputFormatter::formatNotification(EchoEvent, User, string, Language)
#9 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/api/ApiEchoNotifications.php(287): EchoDataOutputFormatter::formatOutput(EchoNotification, string, User, Language)
#10 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/api/ApiEchoNotifications.php(107): ApiEchoNotifications->getPropList(User, array, array, integer, NULL, string, NULL, boolean, boolean)
#11 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Echo/includes/api/ApiEchoNotifications.php(38): ApiEchoNotifications->getLocalNotifications(array)
#12 /srv/mediawiki/php-1.32.0-wmf.20/includes/api/ApiQuery.php(249): ApiEchoNotifications->execute()
#13 /srv/mediawiki/php-1.32.0-wmf.20/includes/api/ApiMain.php(1587): ApiQuery->execute()
#14 /srv/mediawiki/php-1.32.0-wmf.20/includes/api/ApiMain.php(531): ApiMain->executeAction()
#15 /srv/mediawiki/php-1.32.0-wmf.20/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#16 /srv/mediawiki/php-1.32.0-wmf.20/api.php(87): ApiMain->execute()

Notes

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
SBisson subscribed.

It's probably just a matter of checking that the event object has a title object before trying to call getPrefixedText() on it.

https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase/+/master/client/includes/Notifications/PageConnectionPresentationModel.php#24

Moving to "Growth team/External" since I believe it should be fixed in Wikibase and not in Echo but the Growth team is happy to help if needed.

Change 460297 had a related patch set uploaded (by Matěj Suchánek; owner: Matěj Suchánek):
[mediawiki/extensions/Wikibase@master] Avoid BadMethodCallException in PageConnectionPresentationModel

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

Still seen on 1.32.0-wmf.23, and 1.32.0-wmf.24.

Krinkle renamed this task from Fatal "Call getPrefixedText on a non-object" from WikibaseClient on ApiEchoNotifications to ApiEchoNotifications query fails with "BadMethodCallException: Call getPrefixedText on a non-object" from WikibaseClient.Sep 27 2018, 5:11 PM

Change 460297 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Avoid BadMethodCallException in PageConnectionPresentationModel

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

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:08 PM