Page MenuHomePhabricator

Use of Revision::getId was deprecated in MediaWiki 1.31. [Called from MediaWiki\Storage\DerivedPageDataUpdater::grabCurrentRevision]
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.36.0-wmf.1

exception.class ErrorException

message
Use of Revision::getId was deprecated in MediaWiki 1.31. [Called from MediaWiki\Storage\DerivedPageDataUpdater::grabCurrentRevision]

Impact

Notes

Details

Request ID
a3846f0a-81c6-4722-92da-11ee7d445f67
Request URL
https://ru.wikipedia.org/wiki/%D0%A1%D0%BB%D1%83%D0%B6%D0%B5%D0%B1%D0%BD%D0%B0%D1%8F:%D0%96%D1%83%D1%80%D0%BD%D0%B0%D0%BB_%D0%B7%D0%BB%D0%BE%D1%83%D0%BF%D0%BE%D1%82%D1%80%D0%B5%D0%B1%D0%BB%D0%B5%D0%BD%D0%B8%D0%B9/954362
Stack Trace
exception.trace
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, string, array)
#1 /srv/mediawiki/php-1.36.0-wmf.1/includes/debug/MWDebug.php(329): trigger_error(string, integer)
#2 /srv/mediawiki/php-1.36.0-wmf.1/includes/debug/MWDebug.php(305): MWDebug::sendRawDeprecated(string, boolean, string)
#3 /srv/mediawiki/php-1.36.0-wmf.1/includes/debug/MWDebug.php(234): MWDebug::deprecatedMsg(string, string, string, integer)
#4 /srv/mediawiki/php-1.36.0-wmf.1/includes/GlobalFunctions.php(1028): MWDebug::deprecated(string, string, string, integer)
#5 /srv/mediawiki/php-1.36.0-wmf.1/includes/Revision.php(461): wfDeprecated(string, string)
#6 /srv/mediawiki/php-1.36.0-wmf.1/includes/Storage/DerivedPageDataUpdater.php(549): Revision->getId()
#7 /srv/mediawiki/php-1.36.0-wmf.1/includes/Storage/DerivedPageDataUpdater.php(776): MediaWiki\Storage\DerivedPageDataUpdater->grabCurrentRevision()
#8 /srv/mediawiki/php-1.36.0-wmf.1/includes/page/WikiPage.php(2112): MediaWiki\Storage\DerivedPageDataUpdater->prepareContent(User, MediaWiki\Storage\RevisionSlotsUpdate, boolean)
#9 /srv/mediawiki/php-1.36.0-wmf.1/includes/page/Article.php(2953): WikiPage->prepareContentForEdit(WikitextContent, NULL, User, NULL, boolean)
#10 /srv/mediawiki/php-1.36.0-wmf.1/extensions/AbuseFilter/includes/AFComputedVariable.php(241): Article->prepareContentForEdit(WikitextContent)
#11 /srv/mediawiki/php-1.36.0-wmf.1/extensions/AbuseFilter/includes/AbuseFilterVariableHolder.php(124): AFComputedVariable->compute(AbuseFilterVariableHolder)
#12 /srv/mediawiki/php-1.36.0-wmf.1/extensions/AbuseFilter/includes/AbuseFilterVariableHolder.php(233): AbuseFilterVariableHolder->getVar(string)
#13 /srv/mediawiki/php-1.36.0-wmf.1/extensions/AbuseFilter/includes/special/SpecialAbuseLog.php(660): AbuseFilterVariableHolder->dumpAllVars(boolean)
#14 /srv/mediawiki/php-1.36.0-wmf.1/extensions/AbuseFilter/includes/special/SpecialAbuseLog.php(131): SpecialAbuseLog->showDetails(string)
#15 /srv/mediawiki/php-1.36.0-wmf.1/includes/specialpage/SpecialPage.php(600): SpecialAbuseLog->execute(string)
#16 /srv/mediawiki/php-1.36.0-wmf.1/includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run(string)
#17 /srv/mediawiki/php-1.36.0-wmf.1/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#18 /srv/mediawiki/php-1.36.0-wmf.1/includes/MediaWiki.php(940): MediaWiki->performRequest()
#19 /srv/mediawiki/php-1.36.0-wmf.1/includes/MediaWiki.php(543): MediaWiki->main()
#20 /srv/mediawiki/php-1.36.0-wmf.1/index.php(53): MediaWiki->run()
#21 /srv/mediawiki/php-1.36.0-wmf.1/index.php(46): wfIndexMain()
#22 /srv/mediawiki/w/index.php(3): require(string)
#23 {main}

Event Timeline

Okay, this shouldn't be happening.

#6 /srv/mediawiki/php-1.36.0-wmf.1/includes/Storage/DerivedPageDataUpdater.php(549): Revision->getId()
#7 /srv/mediawiki/php-1.36.0-wmf.1/includes/Storage/DerivedPageDataUpdater.php(776): MediaWiki\Storage\DerivedPageDataUpdater->grabCurrentRevision()

Relevant code is

grabCurrentRevision
$current = $wikiPage->getRevisionRecord();

$this->pageState = [
	'oldRevision' => $current,
	'oldId' => $current ? $current->getId() : 0, // <--- THIS IS LINE 549 calling Revision::getId
	'oldIsRedirect' => $wikiPage->isRedirect(), // NOTE: uses page table
	'oldCountable' => $wikiPage->isCountable(), // NOTE: uses pagelinks table
];

So apparently WikiPage::getRevisionRecord somehow returns a Revision object?
Since Revision::__construct also emits deprecation warnings, can someone (@BPirkle @Pchelolo) check where the Revision object is actually being created?

DannyS712 added a subscriber: DannyS712.

Didn't realize this was assigned to me. Hopefully T246539: Dry-run, then actually run updateVarDumps will resolve this, if I understand T251278#6157584 correctly

Change 625615 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] Allow for safe deserialization of WikiPage objects.

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

Change 625612 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] Introduce and apply NonSerializableTrait

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

daniel raised the priority of this task from Low to Medium.
holger.knust added a subscriber: holger.knust.

Moving this to Later and untagging Patch for Review since there is nothing to review right now.

Moving this to Later and untagging Patch for Review since there is nothing to review right now.

https://gerrit.wikimedia.org/r/c/mediawiki/core/+/625615 could be reviewed and would fix this error.

Change 625615 merged by jenkins-bot:
[mediawiki/core@master] Allow for safe deserialization of WikiPage objects.

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

Change 625612 merged by jenkins-bot:
[mediawiki/core@master] Introduce and apply NonSerializableTrait

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

Yeah, I didn't notice this one because it has no subtasks.