Page MenuHomePhabricator

Error undeleting file: "File was missing before deletion"
Open, Needs TriagePublic


For some reason this file can't be undeleted:

If you try, it gives the following error:

Error undeleting file: Cannot undelete file revision with timestamp 2007-01-24T23:13:56: File was missing before deletion.

There's also no link to view the file revision (which is weird). If you try to view it from Special:RevisionDelete, you get a 500 internal server error.

The full history of this file is basically:

I'm trying to undelete the original high resolution version.

Event Timeline

kaldari created this task.Oct 10 2019, 10:15 PM
Restricted Application added a project: Commons. · View Herald TranscriptOct 10 2019, 10:15 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
kaldari added a subscriber: brion.Oct 10 2019, 10:17 PM

@brion - Any ideas on this or who would be good to ask?

Sounds like some of that sequence resulted in a conflict that didn't get handled well at the time. Following the error message back to the code symptom, the case is this in LocalFileRestoreBatch.php:

			if ( $row->fa_storage_key == '' ) {
				// Revision was missing pre-deletion
				$status->error( 'undelete-bad-store-key', $wgLang->timeanddate( $row->fa_timestamp ) );

It's labeled as being caused by the file being missing at deletion time, but specifically means there's an empty slot for the file's deleted filename (SHA-1 plus file extension) in fa_storage_key, so it can't be found in storage... In principle if the fa_sha1 entry is present you might be able to reconstruct the key though, if the file got into the deletion archive somehow (though a conflicting deletion perhaps).

Looks like both the fa_storage_key and fa_sha1 are blank, so no luck :(

Masumrezarock100 added a subscriber: Masumrezarock100.

What does Commons have anything to do with this task?

@Masumrezarock100: You have to ask Steinsplitter in T118234 about that, as it was added by a Herald rule.

Krinkle renamed this task from Can't undelete a file to Error undeleting file: "File was missing before deletion".Nov 7 2019, 7:53 PM