Topic on Project:Support desk

Jump to navigation Jump to search

Restoring specific-Revisions Problem (consecutive MW Updates).

Summary last edited by 星耀晨曦 07:40, 31 July 2018 3 years ago
MvGulik (talkcontribs)

MediaWiki: 1.31.0

PHP: 7.0.30-0+deb9u1 (fpm-fcgi)

MariaDB: 10.1.26-MariaDB-0+deb9u1

( (just in case: +Show bots)


I'm an Admin on some wiki, that was recently updated to MW 1.31.0.

And it seem that this triggered a problem with restore revisions older than a particular date.

The related date in question seem to point an other WM update installation. MW 1.21.1.

Is this making any sense ?

Any known solutions for this, that I can pass on to the sysop of the wiki ?

Anything I can do as Admin here. (probably not, better ask anyway)

(owner/sysop is kindly hosting the wiki, but/and relaying on its users/admins to pass on any core problems)

(there where of course also other things updated/changed while the core-MW-version was updated ... but I have no reliable data on those)

The error messages I collected while trying to restore effected pages(full restore)/revisions(selective restore):

Error undeleting page
Some or all of the undeletion failed:

Invalid or missing revision.
You may have a bad link, or the revision may have been restored or removed from the archive.
The revision #0 of the page named "<pagename>" does not exist.
This is usually caused by following an outdated history link to a page that has been deleted. Details can be found in the deletion log. 
Internal error

[df5b7d69e1520c3751ee7415] /w/index.php?title=Special:Undelete&action=submit MediaWiki\Storage\IncompleteRevisionException from line 308 of /<...>/w/includes/Storage/RevisionStore.php: sha1 field must not be !


#0 /<...>/w/includes/Storage/RevisionStore.php(352): MediaWiki\Storage\RevisionStore->failOnEmpty(string, string)
#1 /<...>/w/includes/Revision.php(1123): MediaWiki\Storage\RevisionStore->insertRevisionOn(MediaWiki\Storage\RevisionArchiveRecord, Wikimedia\Rdbms\DatabaseMysqli)
#2 /<...>/w/includes/page/PageArchive.php(678): Revision->insertOn(Wikimedia\Rdbms\DatabaseMysqli)
#3 /<...>/w/includes/page/PageArchive.php(419): PageArchive->undeleteRevisions(array, boolean, string)
#4 /<...>/w/includes/specials/SpecialUndelete.php(1146): PageArchive->undelete(array, string, array, boolean, User)
#5 /<...>/w/includes/specials/SpecialUndelete.php(201): SpecialUndelete->undelete()
#6 /<...>/w/includes/specialpage/SpecialPage.php(522): SpecialUndelete->execute(NULL)
#7 /<...>/w/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)
#8 /<...>/w/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
#9 /<...>/w/includes/MediaWiki.php(861): MediaWiki->performRequest()
#10 /<...>/w/includes/MediaWiki.php(524): MediaWiki->main()
#11 /<...>/w/index.php(42): MediaWiki->run()
#12 {main}

MW Update data:

- 1.31.0 - 14 July 2018
- 1.25.x - (unknown)
- (unknown, probably none)
- 1.21.1 - [11 July 2013‎ <- 25 June 2013‎] <= raw date-range(newer<-older) boundary for this particular revision restore failure problem.
- (unknown)
MarkAHershberger (talkcontribs)

I can't help you right now, but I've reported a bug here for your problem. Please subscribe to it.

2001:16B8:10DE:BD00:1C06:EE07:4CD1:97F (talkcontribs)

I have not seen this error before, so I am just guessing currently:

The error message "sha1 field must not be !" seems to point to the fact that the sha1 fields of (some) revisions is empty. Can you check, if this is the case?

If this is the problem, then the maintenance script populateRevisionSha1.php might help you!

MvGulik (talkcontribs)

>Please subscribe to it.

In progress (Patiently Waiting for Approval)

>The error message "sha1 field must not be !" seems to point to the fact that the sha1 fields of (some) revisions is empty. Can you check, if this is the case?

I have not found an example page that has deletedrevisions that cross the target date-range, but here is one where the active revisions do start to show empty sha1 data on older revisions.

API query:

星耀晨曦 (talkcontribs)

Are you try populateRevisionSha1.php?

2001:16B8:100A:F500:EC3F:FDD2:42F2:21A4 (talkcontribs)

I would now try running the maintenance script populateRevisionSha1.php. Afterwards your API call should show hashes also for those revisions, which currently do not have one.

MvGulik (talkcontribs)


As general wiki-Admin(Administrator level) I can't, but I will definitely pass is along to the wiki owner/sysop.

But I also like to wait a bit before I do, to see if some other options might pop-up.

(Probably contact wiki-sysop on Friday, hoping he has some free time in the weekend to run that fix.)

MvGulik (talkcontribs)

Update: The maintenance script "populateRevisionSha1.php" was run. But ... it did not resulted in the empty sha1 fields being filled.

Any additional ideas on potential reasons or solutions appreciated.

2001:16B8:1046:8C00:BD29:2B3E:4B90:FB21 (talkcontribs)

I think it might be possible that all sha1 fields must be empty for the script to actually do anything. So it might help to first empty the whole DB column, which this script would fill and to then run it again. However, although I think this once helped me, I am not 100% sure this helps. Be sure to have a backup!

MvGulik (talkcontribs)

I was kinda sceptical about this potential reason why it did not work. And the suggested possible workaround was a bit to iffy for my taste to pass it on.

But, as it turns out:

1) That stated reason was correct.

But ...

2) The easier, and more palatable, solution turned out to be to run the populateRevisionSha1 maintenance script with a "--force" option. (Somehow, ie: That's all I know)

MvGulik (talkcontribs)

Marking as Resolved.