Page MenuHomePhabricator

FileImporter do not automatically delete the copy of the local file
Closed, ResolvedPublicBUG REPORT

Description

When I import files from a local wiki (ukwiki in my case) to Commons, the local copy of the file is not automatically deleted when the deletion checkbox is checked. I always get an error like the one shown in the screenshot below.

Other information (browser name/version, screenshots, etc.):
Google Chrome 146.0.7680.178

image.png (1,671×230 px, 26 KB)

Event Timeline

For reference, the text in the image says "This file has been imported into Wikimedia Commons" in green and "Failed to automatically remove the file uk.wikipedia.org. Please go back to the original file and remove it manually" in yellow. Unfortunately no specific details.

A file with this name doesn#t exists on ukwiki: https://uk.wikipedia.org/wiki/File:Matthias_Grünewald_Crucifixion._1502_p.jpg
Doesn't exist on Commons: https://commons.wikimedia.org/wiki/File:Matthias_Grünewald_Crucifixion._1502_p.jpg
The user is admin: https://uk.wikipedia.org/wiki/Special:Userrights/Andriy.v

@Andriy.v I'm afraid there is not much we can do without more information. Can you provide links to example files?

For reference, the text in the image says "This file has been imported into Wikimedia Commons" in green and "Failed to automatically remove the file uk.wikipedia.org. Please go back to the original file and remove it manually" in yellow. Unfortunately no specific details.

A file with this name doesn#t exists on ukwiki: https://uk.wikipedia.org/wiki/File:Matthias_Grünewald_Crucifixion._1502_p.jpg
Doesn't exist on Commons: https://commons.wikimedia.org/wiki/File:Matthias_Grünewald_Crucifixion._1502_p.jpg
The user is admin: https://uk.wikipedia.org/wiki/Special:Userrights/Andriy.v

@Andriy.v I'm afraid there is not much we can do without more information. Can you provide links to example files?

https://commons.wikimedia.org/wiki/File:Matthias_Grünewald_Crucifixion._1502_р.jpg. The local copy was https://uk.wikipedia.org/wiki/Файл:Мatthias_Grünewald_Crucifixion._1502_р.jpg

Change #1269384 had a related patch set uploaded (by Bartosz Dziewoński; author: Derick Alangi):

[mediawiki/extensions/FileImporter@master] Remote: Use CentralAuth methods instead of calling API internally

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

This patch may fix the problem, but I do not have a FileImporter set up locally to test, and I have not been able to test this on the beta cluster either (I thought that I could test it like this: https://commons.wikimedia.beta.wmcloud.org/wiki/Special:ImportFile?clientUrl=https%3A%2F%2Fen.wikipedia.beta.wmcloud.org%2Fwiki%2FFile%3ATest_file_for_T423076.png&importSource=FileExporter but that gives an error: "Can't import the given URL" and I can't figure out how it decides what URLs it may import).

I have emailed engineering-managers[at]wikimedia.de asking for help in finding someone who can review the patch (following the instructions at Developers/Maintainers).

I did not get a reply, so I approved the patch myself, and I'll test it in production once it rolls out.

Change #1269384 merged by jenkins-bot:

[mediawiki/extensions/FileImporter@master] Remote: Use CentralAuth methods instead of calling API internally

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

@Andriy.v I assume you've tested it? Thanks!

Yes, it seems to work properly. Thank you for fixing it!