Page MenuHomePhabricator

PHP Deprecated: Deprecated cross-wiki access to MediaWiki\Revision\RevisionRecord. Expected: the local wiki, Actual: 'guwwiki'. Pass expected $wikiId. [Called from MediaWiki\Revision\RevisionRecord::getPageId]
Open, Needs TriagePublicPRODUCTION ERROR

Description

Error
  • mwversion: 1.39.0-wmf.3
  • reqId: f746a9876b81bf0df408476d
normalized_message
[{reqId}] {exception_url}   PHP Deprecated: Deprecated cross-wiki access to MediaWiki\Revision\RevisionRecord. Expected: the local wiki, Actual: 'guwwiki'. Pass expected $wikiId. [Called from MediaWiki\Revision\RevisionRecord::getPageId]
exception.trace
from /srv/mediawiki/php-1.39.0-wmf.3/includes/Revision/RevisionRecord.php(336)
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, string, array)
#1 /srv/mediawiki/php-1.39.0-wmf.3/includes/debug/MWDebug.php(377): trigger_error(string, integer)
#2 /srv/mediawiki/php-1.39.0-wmf.3/includes/debug/MWDebug.php(353): MWDebug::sendRawDeprecated(string, boolean, string)
#3 /srv/mediawiki/php-1.39.0-wmf.3/includes/GlobalFunctions.php(1038): MWDebug::deprecatedMsg(string, string, string, integer)
#4 /srv/mediawiki/php-1.39.0-wmf.3/includes/dao/WikiAwareEntityTrait.php(79): wfDeprecatedMsg(string, string)
#5 /srv/mediawiki/php-1.39.0-wmf.3/includes/Revision/RevisionRecord.php(336): MediaWiki\Revision\RevisionRecord->deprecateInvalidCrossWiki(boolean, string)
#6 /srv/mediawiki/php-1.39.0-wmf.3/extensions/EventBus/includes/EventFactory.php(180): MediaWiki\Revision\RevisionRecord->getPageId()
#7 /srv/mediawiki/php-1.39.0-wmf.3/extensions/EventBus/includes/EventFactory.php(741): MediaWiki\Extension\EventBus\EventFactory->createRevisionRecordAttrs(MediaWiki\Revision\RevisionStoreRecord)
#8 /srv/mediawiki/php-1.39.0-wmf.3/extensions/EventBus/includes/EventBusHooks.php(337): MediaWiki\Extension\EventBus\EventFactory->createRevisionCreateEvent(string, MediaWiki\Revision\RevisionStoreRecord)
#9 /srv/mediawiki/php-1.39.0-wmf.3/extensions/EventBus/includes/EventBusHooks.php(322): MediaWiki\Extension\EventBus\EventBusHooks::sendRevisionCreateEvent(string, MediaWiki\Revision\RevisionStoreRecord)
#10 /srv/mediawiki/php-1.39.0-wmf.3/includes/HookContainer/HookContainer.php(338): MediaWiki\Extension\EventBus\EventBusHooks::onRevisionRecordInserted(MediaWiki\Revision\RevisionStoreRecord)
#11 /srv/mediawiki/php-1.39.0-wmf.3/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#12 /srv/mediawiki/php-1.39.0-wmf.3/includes/HookContainer/HookRunner.php(3191): MediaWiki\HookContainer\HookContainer->run(string, array)
#13 /srv/mediawiki/php-1.39.0-wmf.3/includes/Revision/RevisionStore.php(533): MediaWiki\HookContainer\HookRunner->onRevisionRecordInserted(MediaWiki\Revision\RevisionStoreRecord)
#14 /srv/mediawiki/php-1.39.0-wmf.3/includes/Storage/PageUpdater.php(1463): MediaWiki\Revision\RevisionStore->insertRevisionOn(MediaWiki\Revision\RevisionStoreRecord, Wikimedia\Rdbms\DBConnRef)
#15 /srv/mediawiki/php-1.39.0-wmf.3/includes/Storage/PageUpdater.php(911): MediaWiki\Storage\PageUpdater->doCreate(CommentStoreComment)
#16 /srv/mediawiki/php-1.39.0-wmf.3/includes/page/WikiPage.php(1995): MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)
#17 /srv/mediawiki/php-1.39.0-wmf.3/extensions/WikimediaMaintenance/addWiki.php(200): WikiPage->doUserEditContent(WikitextContent, User, CommentStoreComment, integer)
#18 /srv/mediawiki/php-1.39.0-wmf.3/maintenance/doMaintenance.php(114): AddWiki->execute()
#19 /srv/mediawiki/php-1.39.0-wmf.3/extensions/WikimediaMaintenance/addWiki.php(492): require_once(string)
#20 /srv/mediawiki/multiversion/MWScript.php(116): require_once(string)
#21 {main}
Impact

None, deprecation warnings only.

Notes

This shows up when running addWiki.php.

Details

MediaWiki Version
1.39.0-wmf.3

Event Timeline

addWiki.php is documented to get run on another wiki, while creating a new wiki and this is the addition of the main page to the new wiki (https://guw.wikipedia.org/w/index.php?oldid=1&uselang=en matched also this bug creation timestamp)

The EventFactory is given a dbdomain, but that is set by wgDBname and looks not the correct value. Only the RevisionStore is redefined (T200471) to point to the new domain. Other database access seems to point to the new wiki correctly, the page-creation log is visible onwiki (https://guw.wikipedia.org/wiki/Special:Log?type=create&user=Maintenance+script&uselang=en)

Maybe the EventFactory is using the wrong/stale RevisionStore, because it was already init before addWiki.php redefines the service. But why the rest points to the correct db.
Just using the db domain and give it to the RevisionStore seems not the right way. I am not sure if that would work. Other services all working with the local db (what ever that is on wiki creation)