Page MenuHomePhabricator

AffectedPagesFinder: Call to a member function exists() on null
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.35.0-wmf.32

message
Call to a member function exists() on null

Impact

Notes

Happens notably on dewikipage and a bit on commonswiki and wikidatawiki.

Details

Request ID
26e6778165cf746fa4cbeb0d
Request URL
https://jobrunner.discovery.wmnet/rpc/RunSingleJob.php
Stack Trace
exception.trace
#0 /srv/mediawiki/php-1.35.0-wmf.32/extensions/Wikibase/client/includes/Changes/AffectedPagesFinder.php(94): Wikibase\Client\Changes\AffectedPagesFinder->filterUpdates(ArrayIterator)
#1 /srv/mediawiki/php-1.35.0-wmf.32/extensions/Wikibase/client/includes/Changes/ChangeHandler.php(136): Wikibase\Client\Changes\AffectedPagesFinder->getAffectedUsagesByPage(Wikibase\Lib\Changes\ItemChange)
#2 /srv/mediawiki/php-1.35.0-wmf.32/extensions/Wikibase/client/includes/Changes/ChangeHandler.php(112): Wikibase\Client\Changes\ChangeHandler->handleChange(Wikibase\Lib\Changes\ItemChange, array)
#3 /srv/mediawiki/php-1.35.0-wmf.32/extensions/Wikibase/client/includes/ChangeNotificationJob.php(120): Wikibase\Client\Changes\ChangeHandler->handleChanges(array, array)
#4 /srv/mediawiki/php-1.35.0-wmf.32/extensions/EventBus/includes/JobExecutor.php(80): Wikibase\Client\ChangeNotificationJob->run()
#5 /srv/mediawiki/rpc/RunSingleJob.php(76): MediaWiki\Extension\EventBus\JobExecutor->execute(array)
#6 {main}

Event Timeline

DannyS712 triaged this task as Unbreak Now! priority.May 14 2020, 5:44 PM
DannyS712 subscribed.

As a train blocker

Change 596543 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/Wikibase@master] Fix core's TitleFactory not being used correctly

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

This is caused by https://gerrit.wikimedia.org/r/594610, merged 9 days ago.

Wikibase had a custom TitleFactory that was introduced very early, in 2014, see https://gerrit.wikimedia.org/r/168579. The duplicate in core was introduced very late, in 2019, see https://gerrit.wikimedia.org/r/543918. It looks like the duplicate in core was created from scratch, not being aware of the one in Wikibase. This might be why the two behave slightly different. The newer one returns null in a few more cases, where the old one was throwing exceptions.

I checked all callers and fixed them in https://gerrit.wikimedia.org/r/596543.

This was clearly a mistake when reviewing https://gerrit.wikimedia.org/r/594610 (which I was involved in 😓), plus there was obviously not a single test case triggering any of these code paths. 😞 I hope we don't need to revert the change, but can backport the much smaller fix.

Change 596543 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Fix core's TitleFactory not being used correctly

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

Change 596616 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/Wikibase@wmf/1.35.0-wmf.32] Fix core's TitleFactory not being used correctly

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

Lucas_Werkmeister_WMDE lowered the priority of this task from Unbreak Now! to High.May 15 2020, 9:54 AM

Backport scheduled for Monday’s EU SWAT. Lowering priority since I don’t think this needs any further action at the moment.

It does not seem too bad indeed. Thank you @thiemowmde for the detailed analysis!

Change 596616 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@wmf/1.35.0-wmf.32] Fix core's TitleFactory not being used correctly

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

Mentioned in SAL (#wikimedia-operations) [2020-05-18T11:25:22Z] <lucaswerkmeister-wmde@deploy1001> Synchronized php-1.35.0-wmf.32/extensions/Wikibase/: SWAT: [[gerrit:596616|Fix core's TitleFactory not being used correctly (T252803)]] (duration: 01m 12s)

Backport deployed. In the past 24 hours, Logstash has mostly had a handful of occurrences of this per hour (from group0 and group1); I’ll check later if those are gone now.

The last match for AffectedPagesFinder in logstash is at 10:52 UTC today. Half an hour before the fix got deployed. Seems like that fixed it.

I am dropping this task from the list of train blocker, we can close it in a few hours if there is no other occurrences.

Thank you for the quick fix and deployment!

Lucas_Werkmeister_WMDE claimed this task.

No new occurrences, seems to be fixed indeed.

Edit: I hadn’t seen hashar’s comment above, but I think we’re in agreement :)