Page MenuHomePhabricator

Special:Undelete not opening for some titles due to MediaWiki\Storage\RevisionAccessException
Open, LowPublic

Description

This link https://de.wikipedia.org/w/index.php?title=Spezial:Wiederherstellen&target=Innsbrucker+Cartellverband&timestamp=20050217205903

gives a "Exception encountered, of type "BadMethodCallException"", no hash or stacktrace. It also breaks undeletion of this version.

The version is revision deleted, but other deleted versions of that page was visible (but now undeleted).

It seems that the mediawiki error handling is not run for such an error (which looks bad too, but maybe another error/issue).

Would be nice to look up errors in the logs (for my user name) around now to found a possible issue. Thanks

Event Timeline

Umherirrender updated the task description. (Show Details)
Umherirrender raised the priority of this task from to Needs Triage.
Umherirrender added a subscriber: Umherirrender.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 8 2015, 10:23 PM
2015-08-08 22:05:52 mw1249 dewiki exception ERROR: [86a09294] /w/index.php?title=Spezial:Wiederherstellen&action=submit   MWException from line 1504 of /srv/mediawiki/php-1.26wmf17/includes/Revision.php: Content of Innsbrucker_Cartellverband is not valid! Content model is wikitext {"exception":"[Exception MWException] (/srv/mediawiki/php-1.26wmf17/includes/Revision.php:1504) Content of Innsbrucker_Cartellverband is not valid! Content model is wikitext
[stacktrace]
#0 /srv/mediawiki/php-1.26wmf17/includes/Revision.php(1362): Revision->checkContentModel()
#1 /srv/mediawiki/php-1.26wmf17/includes/specials/SpecialUndelete.php(607): Revision->insertOn(DatabaseMysqli)
#2 /srv/mediawiki/php-1.26wmf17/includes/specials/SpecialUndelete.php(385): PageArchive->undeleteRevisions(array, boolean, string)
#3 /srv/mediawiki/php-1.26wmf17/includes/specials/SpecialUndelete.php(1653): PageArchive->undelete(array, string, array, boolean, User)
#4 /srv/mediawiki/php-1.26wmf17/includes/specials/SpecialUndelete.php(823): SpecialUndelete->undelete()
#5 /srv/mediawiki/php-1.26wmf17/includes/specialpage/SpecialPage.php(384): SpecialUndelete->execute(NULL)
#6 /srv/mediawiki/php-1.26wmf17/includes/specialpage/SpecialPageFactory.php(553): SpecialPage->run(NULL)
#7 /srv/mediawiki/php-1.26wmf17/includes/MediaWiki.php(249): SpecialPageFactory::executePath(Title, RequestContext)
#8 /srv/mediawiki/php-1.26wmf17/includes/MediaWiki.php(677): MediaWiki->performRequest()
#9 /srv/mediawiki/php-1.26wmf17/includes/MediaWiki.php(474): MediaWiki->main()
#10 /srv/mediawiki/php-1.26wmf17/index.php(41): MediaWiki->run()
#11 /srv/mediawiki/w/index.php(3): include(string)
#12 {main}
"}
2015-08-08 22:06:49 mw1242 dewiki exception ERROR: [a69aedd2] /w/index.php?title=Spezial:Wiederherstellen&target=Innsbrucker+Cartellverband&timestamp=20050217205903   BadMethodCallException from line 1009 of /srv/mediawiki/php-1.26wmf17/includes/specials/SpecialUndelete.php: Call to a member function getParserOutput() on a non-object (NULL) {"exception":"[Exception BadMethodCallException] (/srv/mediawiki/php-1.26wmf17/includes/specials/SpecialUndelete.php:1009) Call to a member function getParserOutput() on a non-object (NULL)
[stacktrace]
#0 /srv/mediawiki/php-1.26wmf17/includes/specials/SpecialUndelete.php(805): SpecialUndelete->showRevision(string)
#1 /srv/mediawiki/php-1.26wmf17/includes/specialpage/SpecialPage.php(384): SpecialUndelete->execute(NULL)
#2 /srv/mediawiki/php-1.26wmf17/includes/specialpage/SpecialPageFactory.php(553): SpecialPage->run(NULL)
#3 /srv/mediawiki/php-1.26wmf17/includes/MediaWiki.php(249): SpecialPageFactory::executePath(Title, RequestContext)
#4 /srv/mediawiki/php-1.26wmf17/includes/MediaWiki.php(677): MediaWiki->performRequest()
#5 /srv/mediawiki/php-1.26wmf17/includes/MediaWiki.php(474): MediaWiki->main()
#6 /srv/mediawiki/php-1.26wmf17/index.php(41): MediaWiki->run()
#7 /srv/mediawiki/w/index.php(3): include(string)
#8 {main}
"}

Looking at the api shows a size of zero. Maybe this revision is empty and no valid Content object is created?

https://de.wikipedia.org/w/api.php?action=query&prop=deletedrevisions&revids=4582756&&drvprop=size|ids|contentmodel

{
    "batchcomplete": "",
    "query": {
        "pages": {
            "-1": {
                "ns": 0,
                "title": "Innsbrucker Cartellverband",
                "missing": "",
                "deletedrevisions": [
                    {
                        "revid": 4582756,
                        "size": 0,
                        "contentmodel": "wikitext"
                    }
                ]
            }
        }
    }
}

ar_len is NULL... And ar_text_id points to a text entry that is a 'historyblobstub' object pointing to another text entry, which points to an external storage entry containing text which seems to be what it's looking for.
getContent fails because loadText fails, and that seems to be due to the historyblobstub thing:

> $archiveRow = wfGetDB( DB_SLAVE )->selectRow( 'archive', '*', array( 'ar_rev_id' => 4582756 ) );

> $r = Revision::newFromArchiveRow( $archiveRow );

> $textRow = wfGetDB( DB_SLAVE )->selectRow( 'text', '*', array( 'old_id' => $r->getTextId() ) );

> var_dump( Revision::getRevisionText( $textRow ) );
bool(false)

> $textRow = wfGetDB( DB_SLAVE )->selectRow( 'text', '*', array( 'old_id' => /* mOldId from the HistoryBlobStub in $textRow */ ) );

> var_dump( Revision::getRevisionText( $textRow ) );
string(2984) "<redacted>"

Change 230407 had a related patch set uploaded (by Umherirrender):
Avoid fatal when accessing method of non-objects on Special:Undelete

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

Change 230407 had a related patch set uploaded (by Umherirrender):
Avoid fatal when accessing method of non-objects on Special:Undelete

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

The patch set is (just) for the BadMethodCallException when viewing the revision, but the exception on restore is still unhandled.

Aklapper triaged this task as Normal priority.Aug 10 2015, 2:44 PM

Change 230407 merged by jenkins-bot:
Avoid fatal when accessing method of non-objects on Special:Undelete

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

Umherirrender set Security to None.
Umherirrender removed a subscriber: gerritbot.
  • exception on restore is still unhandled
  • And missing revision text is not there
Krenair renamed this task from BadMethodCallException on undeletion of old version on german wikipedia to Exceptions on undeletion of old HistoryBlobStubs.
Krenair added subscribers: doctaxon, jcrespo, Matanya and 3 others.
Krinkle renamed this task from Exceptions on undeletion of old HistoryBlobStubs to Special:Undelete not opening for some titles due to MediaWiki\Storage\RevisionAccessException.Oct 2 2018, 8:31 PM
Krinkle added a subscriber: Krinkle.

I can still reproduce this on 1.32.0-wmf.23 by visiting https://de.wikipedia.org/w/index.php?title=Spezial:Wiederherstellen&target=Innsbrucker+Cartellverband&timestamp=20050217205903 as sysop on de.wikipedia.org.

Logs from that page:

error
PHP Warning: MediaWiki\Storage\SqlBlobStore::fetchBlob: Bad data in text row 4582756. [Called from MediaWiki\Storage\SqlBlobStore::fetchBlob in /srv/mediawiki/php-1.32.0-wmf.23/includes/Storage/SqlBlobStore.php at line 356]

#3 /srv/mediawiki/php-1.32.0-wmf.23/includes/Storage/SqlBlobStore.php(356): wfLogWarning(string)
#4 /srv/mediawiki/php-1.32.0-wmf.23/includes/Storage/SqlBlobStore.php(281): MediaWiki\Storage\SqlBlobStore->fetchBlob(string, integer)
#5 /srv/mediawiki/php-1.32.0-wmf.23/includes/libs/objectcache/WANObjectCache.php(1277): Closure$MediaWiki\Storage\SqlBlobStore::getBlob(boolean, integer, array, NULL)
#6 /srv/mediawiki/php-1.32.0-wmf.23/includes/libs/objectcache/WANObjectCache.php(1150): WANObjectCache->doGetWithSetCallback(string, integer, Closure$MediaWiki\Storage\SqlBlobStore::getBlob;524, array)
#7 /srv/mediawiki/php-1.32.0-wmf.23/includes/Storage/SqlBlobStore.php(284): WANObjectCache->getWithSetCallback(string, integer, Closure$MediaWiki\Storage\SqlBlobStore::getBlob;524, array)
#8 /srv/mediawiki/php-1.32.0-wmf.23/includes/Storage/RevisionStore.php(1433): MediaWiki\Storage\SqlBlobStore->getBlob(string, integer)
#9 /srv/mediawiki/php-1.32.0-wmf.23/includes/Storage/RevisionStore.php(1350): MediaWiki\Storage\RevisionStore->loadSlotContent(MediaWiki\Storage\SlotRecord, NULL, NULL, NULL, integer)
#10 [internal function]: Closure$MediaWiki\Storage\RevisionStore::emulateMainSlot_1_29#2(MediaWiki\Storage\SlotRecord)
#11 /srv/mediawiki/php-1.32.0-wmf.23/includes/Storage/SlotRecord.php(306): call_user_func(Closure$MediaWiki\Storage\RevisionStore::emulateMainSlot_1_29#2;519, MediaWiki\Storage\SlotRecord)
#12 /srv/mediawiki/php-1.32.0-wmf.23/includes/Storage/RevisionRecord.php(174): MediaWiki\Storage\SlotRecord->getContent()
#13 /srv/mediawiki/php-1.32.0-wmf.23/includes/Revision.php(929): MediaWiki\Storage\RevisionRecord->getContent(string, integer, User)
#14 /srv/mediawiki/php-1.32.0-wmf.23/includes/specials/SpecialUndelete.php(426): Revision->getContent(integer, User)
exception
Failed to load data blob from tt:4582756: Failed to load blob from address tt:4582756

#0 /srv/mediawiki/php-1.32.0-wmf.23/includes/Storage/RevisionStore.php(1433): MediaWiki\Storage\SqlBlobStore->getBlob(string, integer)
#1 /srv/mediawiki/php-1.32.0-wmf.23/includes/Storage/RevisionStore.php(1350): MediaWiki\Storage\RevisionStore->loadSlotContent(MediaWiki\Storage\SlotRecord, NULL, NULL, NULL, integer)
#2 [internal function]: Closure$MediaWiki\Storage\RevisionStore::emulateMainSlot_1_29#2(MediaWiki\Storage\SlotRecord)
#3 /srv/mediawiki/php-1.32.0-wmf.23/includes/Storage/SlotRecord.php(306): call_user_func(Closure$MediaWiki\Storage\RevisionStore::emulateMainSlot_1_29#2;519, MediaWiki\Storage\SlotRecord)
#4 /srv/mediawiki/php-1.32.0-wmf.23/includes/Storage/RevisionRecord.php(174): MediaWiki\Storage\SlotRecord->getContent()
#5 /srv/mediawiki/php-1.32.0-wmf.23/includes/Revision/RenderedRevision.php(205): MediaWiki\Storage\RevisionRecord->getContent(string, integer, User)
#6 /srv/mediawiki/php-1.32.0-wmf.23/includes/Revision/RevisionRenderer.php(169): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
#7 /srv/mediawiki/php-1.32.0-wmf.23/includes/Revision/RevisionRenderer.php(122): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#8 [internal function]: Closure$MediaWiki\Revision\RevisionRenderer::getRenderedRevision#2(MediaWiki\Revision\RenderedRevision, array)
#9 /srv/mediawiki/php-1.32.0-wmf.23/includes/Revision/RenderedRevision.php(176): call_user_func(Closure$MediaWiki\Revision\RevisionRenderer::getRenderedRevision#2;1120, MediaWiki\Revision\RenderedRevision, array)
#10 /srv/mediawiki/php-1.32.0-wmf.23/includes/specials/SpecialUndelete.php(468): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()

May be related to T205936 or T203075.

Krinkle lowered the priority of this task from Normal to Low.Oct 2 2018, 8:34 PM
Krinkle moved this task from Untriaged to Found longer ago on the Wikimedia-production-error board.