Error
MediaWiki version: 1.35.0-wmf.32
Call to a member function exists() on null
Impact
Notes
Happens notably on dewikipage and a bit on commonswiki and wikidatawiki.
MediaWiki version: 1.35.0-wmf.32
Call to a member function exists() on null
Happens notably on dewikipage and a bit on commonswiki and wikidatawiki.
#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}
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
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
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
Backport scheduled for Monday’s EU SWAT. Lowering priority since I don’t think this needs any further action at the moment.
Change 596616 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@wmf/1.35.0-wmf.32] Fix core's TitleFactory not being used correctly
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!
No new occurrences, seems to be fixed indeed.
Edit: I hadn’t seen hashar’s comment above, but I think we’re in agreement :)