Page MenuHomePhabricator

UploadStashBadPathException 'Path doesn't exist.' when uploading a specific image in Wikimedia Commons via API action=upload
Open, Needs TriagePublic

Description

Hello Commons hackers!

Preamble

My bot was having fun in bulk-uploading some nice CC BY-SA images in Wikimedia Commons, importing them from an iconotheque of Mendrisio after this nice editathon.

In short I've recently uploaded ~1000 images via action=upload without issues. Further information here:

Everything was going smoother but now I've reached an issue trying to upload an image.

Description of the issue

Trying to upload an image via the API action=upload with these arguments:

filename=Facciata di Palazzo Eynard.jpg
ignorewarnings=1
file=*binary*

I was not able to upload this file:

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

Every time I try to do it, the API returns an UploadStashBadPathException:

stdClass Object
(
    [code] => fileexists-no-change
    [info] => The upload is an exact duplicate of the current version of [[:File:Facciata di Palazzo Eynard.jpg]].
    [stasherrors] => Array
        (
            [0] => stdClass Object
                (
                    [message] => uploadstash-exception
                    [params] => Array
                        (
                            [0] => UploadStashBadPathException
                            [1] => Path doesn't exist.
                        )

                    [code] => uploadstash-exception
                    [type] => error
                )

        )

    [*] => See https://commons.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.
)

Also, the human error message "The upload is an exact duplicate of the current version" has no much sense for me because as far I can see in File:Facciata di Palazzo Eynard.jpg there is no any image at the time of writing:

Screenshot_2020-12-28 File Facciata di Palazzo Eynard jpg - Wikimedia Commons.png (2×1 px, 458 KB)

I think you can reproduce the issue trying to upload, in File:Facciata di Palazzo Eynard.jpg, this image that is the problematic one (F33973919). Here a thumbnail:

22220.jpg (3×2 px, 778 KB)


For now I'm tagging this as MediaWiki-File-management.

What is happening? Thanks!

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

It seems that calling action=purge fixed this issue. No idea why.

Technically this is resolved so feel free to mark as resolved if nobody in the world is interested in discovering why this happened and how to prevent future similar situations.

Thanks @Aklapper. Note that I've updated the description of MediaWiki-Uploading to reflect the current meaning (not just about Special:Upload interface).