Page MenuHomePhabricator

Cannot restore pages deleted in 2004 on als.wikipedia.org: LogicException / Mismatching revision: The slot already belongs to revision 0.
Closed, ResolvedPublicPRODUCTION ERROR

Description

I tried to restore pages on als.wikipedia.org, which have been deleted in 2004, e. g. https://als.wikipedia.org/wiki/Wikipedia:Protection_log or https://als.wikipedia.org/w/index.php?title=Wikipedia:Upload_log
Unfortunately I couldn't restore them, instead I got this error message:
[WsUTMQpAAEYAAAnAsjMAAAAW] 2018-04-04 18:02:25: Fatal exception of type "LogicException"]
Could you please help me?

Thanks a lot.

Event Timeline

[WsUTMQpAAEYAAAnAsjMAAAAW] /w/index.php?title=Spezial:Widerh%C3%A4rstelle&action=submit   LogicException from line 174 of /srv/mediawiki/php-1.31.0-wmf.27/includes/Storage/SlotRecord.php: Mismatching revision ID 819358: The slot already belongs to revision 0. Use SlotRecord::newInherited() to re-use content between revisions.
#0 /srv/mediawiki/php-1.31.0-wmf.27/includes/Storage/RevisionStore.php(458): MediaWiki\Storage\SlotRecord::newSaved(integer, integer, string, MediaWiki\Storage\SlotRecord)
#1 /srv/mediawiki/php-1.31.0-wmf.27/includes/Revision.php(1124): MediaWiki\Storage\RevisionStore->insertRevisionOn(MediaWiki\Storage\RevisionArchiveRecord, Wikimedia\Rdbms\DatabaseMysqli)
#2 /srv/mediawiki/php-1.31.0-wmf.27/includes/page/PageArchive.php(681): Revision->insertOn(Wikimedia\Rdbms\DatabaseMysqli)
#3 /srv/mediawiki/php-1.31.0-wmf.27/includes/page/PageArchive.php(422): PageArchive->undeleteRevisions(array, boolean, string)
#4 /srv/mediawiki/php-1.31.0-wmf.27/includes/specials/SpecialUndelete.php(1147): PageArchive->undelete(array, string, array, boolean, User)
#5 /srv/mediawiki/php-1.31.0-wmf.27/includes/specials/SpecialUndelete.php(201): SpecialUndelete->undelete()
#6 /srv/mediawiki/php-1.31.0-wmf.27/includes/specialpage/SpecialPage.php(522): SpecialUndelete->execute(NULL)
#7 /srv/mediawiki/php-1.31.0-wmf.27/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)
#8 /srv/mediawiki/php-1.31.0-wmf.27/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
#9 /srv/mediawiki/php-1.31.0-wmf.27/includes/MediaWiki.php(861): MediaWiki->performRequest()
#10 /srv/mediawiki/php-1.31.0-wmf.27/includes/MediaWiki.php(524): MediaWiki->main()
#11 /srv/mediawiki/php-1.31.0-wmf.27/index.php(42): MediaWiki->run()
#12 /srv/mediawiki/w/index.php(3): include(string)
#13 {main}
Aklapper renamed this task from Bug in restoring pages on als.wikipedia.org to Cannot restore pages deleted in 2004 on als.wikipedia.org: LogicException / Mismatching revision: The slot already belongs to revision 0..Apr 5 2018, 11:45 AM

It looks like this has been happening on a couple of wikis

https://logstash.wikimedia.org/goto/ff0edf847c674d5e095f0b6621200ccf

alswiki arwiki enwikinews hiwiki iswiki

I suppose the underlying issue here is ar_revision_id being 0. That should have been fixed by T191307: Run maintenance/populateArchiveRevId.php on all wikis. Does the problem still persist?

One possible workaround would be to make SlotRecord (and perhaps other code) treat a revision id being 0 the same as the revision id being null. But I'd like to avoid that - I'd rather fail more aggressively on the revision ID being 0, since that should no longer happen after the above script has been run.

Thank you very much. The described problem is now solved.

daniel claimed this task.
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:09 PM