Page MenuHomePhabricator

PHP Deprecated: Deprecated cross-wiki access to MediaWiki\Revision\RevisionRecord. Expected: 'testwikidatawiki', Actual: the local wiki. Pass expected $wikiId. [Called from MediaWiki\Revision\RevisionRecord::getId]
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
  • mwversion: 1.45.0-wmf.25
  • timestamp: 2025-10-28T08:53:52.291Z
  • phpversion: 8.1.33
  • reqId: 23562346-ce0f-4fb9-8141-e09f0a1d0db7
  • Find reqId in Logstash
normalized_message
[{reqId}] {exception_url}   PHP Deprecated: Deprecated cross-wiki access to MediaWiki\Revision\RevisionRecord. Expected: 'testwikidatawiki', Actual: the local wiki. Pass expected $wikiId. [Called from MediaWiki\Revision\RevisionRecord::getId]
FrameLocationCall
from/srv/mediawiki/php-1.45.0-wmf.25/includes/Revision/RevisionRecord.php(319)
#0[internal function]MediaWiki\Exception\MWExceptionHandler::handleError(int, string, string, string)
#1/srv/mediawiki/php-1.45.0-wmf.25/includes/debug/MWDebug.php(372)trigger_error(string, int)
#2/srv/mediawiki/php-1.45.0-wmf.25/includes/debug/MWDebug.php(343)MediaWiki\Debug\MWDebug::sendRawDeprecated(string, bool, string)
#3/srv/mediawiki/php-1.45.0-wmf.25/includes/GlobalFunctions.php(798)MediaWiki\Debug\MWDebug::deprecatedMsg(string, string, string, int)
#4/srv/mediawiki/php-1.45.0-wmf.25/includes/dao/WikiAwareEntityTrait.php(62)wfDeprecatedMsg(string, string)
#5/srv/mediawiki/php-1.45.0-wmf.25/includes/Revision/RevisionRecord.php(319)MediaWiki\Revision\RevisionRecord->deprecateInvalidCrossWiki(string, string)
#6/srv/mediawiki/php-1.45.0-wmf.25/includes/Revision/RevisionStoreRecord.php(161)MediaWiki\Revision\RevisionRecord->getId(string)
#7/srv/mediawiki/php-1.45.0-wmf.25/extensions/Wikibase/lib/includes/Store/Sql/WikiPageEntityDataLoader.php(92)MediaWiki\Revision\RevisionStoreRecord->getId(string)
#8/srv/mediawiki/php-1.45.0-wmf.25/extensions/Wikibase/lib/includes/Store/Sql/WikiPageEntityRevisionLookup.php(226)Wikibase\Lib\Store\Sql\WikiPageEntityDataLoader->loadEntityDataFromWikiPageRevision(MediaWiki\Revision\RevisionStoreRecord, string, int)
#9/srv/mediawiki/php-1.45.0-wmf.25/extensions/Wikibase/lib/includes/Store/Sql/WikiPageEntityRevisionLookup.php(111)Wikibase\Lib\Store\Sql\WikiPageEntityRevisionLookup->loadEntity(stdClass, string)
#10/srv/mediawiki/php-1.45.0-wmf.25/extensions/Wikibase/lib/includes/Store/TypeDispatchingEntityRevisionLookup.php(52)Wikibase\Lib\Store\Sql\WikiPageEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, int, string)
#11/srv/mediawiki/php-1.45.0-wmf.25/extensions/Wikibase/data-access/src/ByTypeDispatchingEntityRevisionLookup.php(55)Wikibase\Lib\Store\TypeDispatchingEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, int, string)
#12/srv/mediawiki/php-1.45.0-wmf.25/extensions/Wikibase/lib/includes/Store/TypeDispatchingEntityRevisionLookup.php(52)Wikibase\DataAccess\ByTypeDispatchingEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, int, string)
#13/srv/mediawiki/php-1.45.0-wmf.25/extensions/Wikibase/lib/includes/Store/CachingEntityRevisionLookup.php(99)Wikibase\Lib\Store\TypeDispatchingEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, int, string)
#14/srv/mediawiki/php-1.45.0-wmf.25/extensions/Wikibase/lib/includes/Store/CachingEntityRevisionLookup.php(85)Wikibase\Lib\Store\CachingEntityRevisionLookup->fetchEntityRevision(Wikibase\DataModel\Entity\ItemId, int, string)
#15/srv/mediawiki/php-1.45.0-wmf.25/extensions/Wikibase/lib/includes/Store/CachingEntityRevisionLookup.php(99)Wikibase\Lib\Store\CachingEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, int, string)
#16/srv/mediawiki/php-1.45.0-wmf.25/extensions/Wikibase/lib/includes/Store/CachingEntityRevisionLookup.php(85)Wikibase\Lib\Store\CachingEntityRevisionLookup->fetchEntityRevision(Wikibase\DataModel\Entity\ItemId, int, string)
#17/srv/mediawiki/php-1.45.0-wmf.25/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(402)Wikibase\Lib\Store\CachingEntityRevisionLookup->getEntityRevision(Wikibase\DataModel\Entity\ItemId, int)
#18/srv/mediawiki/php-1.45.0-wmf.25/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(530)Wikibase\Repo\LinkedData\EntityDataRequestHandler->getEntityRevision(Wikibase\DataModel\Entity\ItemId, int, bool)
#19/srv/mediawiki/php-1.45.0-wmf.25/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(289)Wikibase\Repo\LinkedData\EntityDataRequestHandler->showData(MediaWiki\Request\WebRequest, MediaWiki\Output\OutputPage, string, Wikibase\DataModel\Entity\ItemId, int)
#20/srv/mediawiki/php-1.45.0-wmf.25/extensions/Wikibase/repo/includes/Specials/SpecialEntityData.php(112)Wikibase\Repo\LinkedData\EntityDataRequestHandler->handleRequest(null, MediaWiki\Request\WebRequest, MediaWiki\Output\OutputPage)
#21/srv/mediawiki/php-1.45.0-wmf.25/includes/specialpage/SpecialPage.php(711)Wikibase\Repo\Specials\SpecialEntityData->execute(null)
#22/srv/mediawiki/php-1.45.0-wmf.25/includes/specialpage/SpecialPageFactory.php(1736)MediaWiki\SpecialPage\SpecialPage->run(null)
#23/srv/mediawiki/php-1.45.0-wmf.25/includes/actions/ActionEntryPoint.php(499)MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
#24/srv/mediawiki/php-1.45.0-wmf.25/includes/actions/ActionEntryPoint.php(143)MediaWiki\Actions\ActionEntryPoint->performRequest()
#25/srv/mediawiki/php-1.45.0-wmf.25/includes/MediaWikiEntryPoint.php(184)MediaWiki\Actions\ActionEntryPoint->execute()
#26/srv/mediawiki/php-1.45.0-wmf.25/index.php(44)MediaWiki\MediaWikiEntryPoint->run()
#27/srv/mediawiki/w/index.php(3)require(string)
#28{main}
Impact
Notes

High rate: 300 per hour. Began with 1.45.0-wmf.25. Always testwikidatawiki. Various URLs, various backtraces leading to WikiPageEntityRevisionLookup.

Event Timeline

Heyy, it might be related with 1194728, what do you think @Daimona and @cmelo ?

Hi :) Yes, it is. I had discussed this with @ArthurTaylor in T406777#11305703 and following comments. The TLDR is that Wikibase was previously relying on core's RevisionStore NOT normalizing the provided wiki ID (where "normalizing" means checking if the ID corresponds to that of the current wiki, and changing the value to the special ::LOCAL constant if so). RevisionStore now does normalization, similar to several other core services, but the calling code in Wikibase does not, which leads to the mismatch. I'm not familiar enough with Wikibase to know for sure where it would be best to fix it, but I had a proposal in the other task and will make a patch for it to get the ball rolling (and possibly be corrected). I'd appreciate guidance from Wikibase engineers, and I'll be happy to help as best as I can :)

Ah nevermind, I realized that T408452 exists and has a patch up already. Not sure in which direction we want to merge the tasks, I'll leave that up to y'all.

Change #1199078 had a related patch set uploaded (by WMDE-leszek; author: WMDE-leszek):

[mediawiki/extensions/Wikibase@master] EntitySourceDefinitions: use false as DB name if pointing to current wiki

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

Change #1199078 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] EntitySourceDefinitions: use false as DB name if pointing to current wiki

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

Mentioned in SAL (#wikimedia-operations) [2025-10-29T18:23:12Z] <dduvall> rolling back 1.45.0-wmf.25 from group1 due to spike in PHP Deprecated: Deprecated cross-wiki access to MediaWiki\Revision\RevisionRecord errors (T408525) (cc T408525)

dduvall triaged this task as Unbreak Now! priority.EditedOct 29 2025, 6:25 PM
dduvall subscribed.

This seems to affect commons and wikidata as well. I've seen over 20k errors in the last 10 minutes following group1 promotion of 1.45.0-wmf.25.

I've escalated this issue to a 1.45.0-wmf.25 train blocker. Thanks to everyone already working on it.

what's the procedure of getting https://gerrit.wikimedia.org/r/1199078 applied to the train delivery branch? I.e. who's expected to cherry pick that to that branch?

Change #1199855 had a related patch set uploaded (by Dduvall; author: WMDE-leszek):

[mediawiki/extensions/Wikibase@wmf/1.45.0-wmf.25] EntitySourceDefinitions: use false as DB name if pointing to current wiki

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

Change #1199855 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@wmf/1.45.0-wmf.25] EntitySourceDefinitions: use false as DB name if pointing to current wiki

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

Mentioned in SAL (#wikimedia-operations) [2025-10-29T21:40:32Z] <dduvall@deploy2002> Started scap sync-world: Backport for [[gerrit:1199855|EntitySourceDefinitions: use false as DB name if pointing to current wiki (T408525)]], [[gerrit:1199862|recentchanges API result contains wrong entries with redirect: False (T408667)]]

Mentioned in SAL (#wikimedia-operations) [2025-10-29T21:43:05Z] <dduvall@deploy2002> tstarling, dduvall: Backport for [[gerrit:1199855|EntitySourceDefinitions: use false as DB name if pointing to current wiki (T408525)]], [[gerrit:1199862|recentchanges API result contains wrong entries with redirect: False (T408667)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-10-29T21:48:47Z] <dduvall@deploy2002> Finished scap sync-world: Backport for [[gerrit:1199855|EntitySourceDefinitions: use false as DB name if pointing to current wiki (T408525)]], [[gerrit:1199862|recentchanges API result contains wrong entries with redirect: False (T408667)]] (duration: 08m 15s)

dduvall claimed this task.

Marking as resolved as I haven't seen the error since deploying the backport yesterday. Please reopen if need be.