Page MenuHomePhabricator

Some files cannot be deleted "Error deleting file: An unknown error occurred in storage backend "local-multiwrite". " (due to missing physical file for old image entries)
Closed, ResolvedPublic

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Same error «local-multiwrite» for https://ru.wikipedia.org/wiki/Файл:Карта_Швеции.png, cannot delete, cannot revert to old version (empty 'oldimage' field). Two entries in upload log, only one of them corresponds to page's history.

The same on https://uk.wikipedia.org/wiki/Файл:Балістичні_таблиці_P1720666.JPG

The possible cause on why the files can't be deleted is because they have a "non-existent" revision of the file. i.e, "no thumbnail"

Note that it is possible to overwrite https://commons.wikimedia.org/wiki/File:Ballen_en_Alianza_Petrolera.jpg with a new file, and to delete the old version. Weird.

On ptwiki I see more 4 files with an empty oi_archive_name (https://quarry.wmcloud.org/query/61588), I tried to delete some, but I have the same error (we don't need delete these now, only File:A_Walk_in_the_Sun.jpg, but if we need, we can't).

Vyhoanganhkiet set Due Date to Apr 22 2022, 12:00 AM.
AlexisJazz removed Due Date.
AlexisJazz added a subscriber: Vyhoanganhkiet.
Minorax added a subscriber: Base.

The possible cause on why the files can't be deleted is because they have a "non-existent" revision of the file. i.e, "no thumbnail"

This is highly likely the cause, tried using FileImporter to import a file from en.wp and warning was "Can't import file because at least one of its revisions is missing an image file."

File:Spöke.jpg on Commons also cannot be deleted and also does not have a thumbnail in first of the file version.

How can file revisions go missing? Don't we have backups? Why can't we delete a file, even though one or more file revisions is missing? What can we do to prevent file revisions from going missing in the future, and to compensate for their missing status in the present?

@Jeff_G: Because software code has bugs, so there is phabricator.wikimedia.org as a bug tracker. You could inspect the software code, find mistakes, and create code fixes for mistakes. Please consider bringing up general questions on the wikitech-l mailing list - thanks!

Current new example: https://en.wikipedia.org/wiki/File:KKNO_logo.jpg
Fails with error: Error deleting file: An unknown error occurred in storage backend "local-multiwrite".

I subscribed.

While examining this vulnerability, I found another bug, T328112: Unexpected value: "oldimage"="", FYI.

Change 884347 had a related patch set uploaded (by Ammarpad; author: Ammarpad):

[mediawiki/core@master] Improve handling of missing files on File page

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

These files are missing on disc (or have archived versions that are) and so cannot be deleted (since the deletion code requires a file to exist first). From the code, it seems it's already known that some files are irretrievably lost on Wikimedia servers; for instance in code comment shown T244567#6518947 which is still in source. That's the first problem.

The second problem, which I think is the immediate cause for this specific error is the fact that a deletion link is added for these files (which the code already knows will not work); as well as a revert link, which causes T328112. There's also a rev-delete checkbox too, which I'm sure will not work.

Change 884347 merged by jenkins-bot:

[mediawiki/core@master] Improve handling of missing files on File page

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

The deletion link should be removed from the revisions which don't have a file on disk, but it should still be there for the file as a whole and that deletion should go through while gracefully handling missing versions. Is that what the patch above is about? We definitely do not want to just make the situation more confusing by removing all the links (then people would not even be able to end up here with no error message to search)

https://commons.wikimedia.org/wiki/File:Carsten_Rusch.jpg

Error deleting file: An unknown error occurred in storage backend "local-multiwrite".

Change 919406 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] file: Check for old image existence in LocalFileDeleteBatch

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

Umherirrender renamed this task from Some files cannot be deleted "Error deleting file: An unknown error occurred in storage backend "local-multiwrite". " to Some files cannot be deleted "Error deleting file: An unknown error occurred in storage backend "local-multiwrite". " (due to missing physical file for old image entries).May 12 2023, 10:45 PM

I can't even move it to a parking area, like it was done other files with the same issue:

Error while moving the page.
A detailed description of the error is shown below:
API request failed (internal_api_error_DBQueryError): [56e10902-cece-466e-8ca5-d016b109afe3] Caught exception of type Wikimedia\Rdbms\DBQueryError <i>at Thu, 25 May 2023 12:02:51 GMT</i> <u>served by mw1484</u>

I think that must be a separate issue, both given the DBQueryError and that the object is present in both swift clusters:

root@ms-fe1009:~# swift stat wikipedia-commons-local-public.d4 d/d4/The_fish_avatara_of_Vishnu_saves_Manu_during_the_great_deluge.jpg
        Account: AUTH_mw
      Container: wikipedia-commons-local-public.d4
         Object: d/d4/The_fish_avatara_of_Vishnu_saves_Manu_during_the_great_deluge.jpg
   Content Type: image/jpeg
 Content Length: 21269
  Last Modified: Thu, 25 May 2023 12:11:17 GMT
           ETag: 1f94670c1002d396cea50ee8aa872d7d
Meta Sha1Base36: r8v6t7yq6jkgo3s12gkj30ibin2fkys
  Accept-Ranges: bytes
    X-Timestamp: 1685016676.79279
     X-Trans-Id: tx65b903fb09a641f899051-00646f50d8

root@ms-fe2009:~# swift stat wikipedia-commons-local-public.d4 d/d4/The_fish_avatara_of_Vishnu_saves_Manu_during_the_great_deluge.jpg
        Account: AUTH_mw
      Container: wikipedia-commons-local-public.d4
         Object: d/d4/The_fish_avatara_of_Vishnu_saves_Manu_during_the_great_deluge.jpg
   Content Type: image/jpeg
 Content Length: 21269
  Last Modified: Thu, 25 May 2023 12:11:18 GMT
           ETag: 1f94670c1002d396cea50ee8aa872d7d
Meta Sha1Base36: r8v6t7yq6jkgo3s12gkj30ibin2fkys
     X-Trans-Id: tx077e7ccba4ed43cf83bfd-00646f50e6
  Accept-Ranges: bytes
    X-Timestamp: 1685016677.27598

The issue of this bug is when a old file is missing, in this case the version from "17:47, 10 September 2012".

Change 919406 merged by jenkins-bot:

[mediawiki/core@master] file: Check for old image existence in LocalFileDeleteBatch

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

Umherirrender claimed this task.

Deletion works on commons, https://commons.wikimedia.org/wiki/Category:Deletion_error/T244567 is now empty.
The wikipedia wikis can clean up after the software deployment tomorrow (On https://versions.toolforge.org/ the group2 needs "1.41.0-wmf.24" or higher)

This task contains some comments possible related to other issues with the same error message. If the issues are still there, please open new tasks as needed.