Page MenuHomePhabricator

Cannot upload larger JPG/WEBM/GIF files: "An error was encountered when opening the file for ZIP checks"
Closed, ResolvedPublic

Description

Today several Wiki Loves Earth participants independently reported a similar problem. They all get the message "An error was encountered when opening the file for ZIP checks" when trying to upload a photo, and the upload fails. This leads to a quite bad user experience, especially for new users who are not familiar with the system. I checked some of the files that these users would like to upload, and they all look like normal JPEG images. I attach the screenshot of the error message.

Event Timeline

Atsirlin created this task.May 16 2019, 1:23 PM
Restricted Application added a project: Multimedia. · View Herald TranscriptMay 16 2019, 1:23 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Aklapper renamed this task from Upload problem: An error was encountered when opening the file for ZIP checks to Cannot upload JPG file: "An error was encountered when opening the file for ZIP checks".May 16 2019, 1:55 PM

Any chance to provide an example JPEG file? Is this reproducible when trying for the same file again?

Message is defined in includes/utils/ZipDirectoryReader.php; file last changed in Jan 2019. Puzzled why this is applied to JPEG files.

@Aklapper: for example, this file https://commons.wikimedia.org/wiki/File:Сунцовский_вяз.jpg caused the problem but could be eventually uploaded after several failed attempts

Another user reported the bug to me for a webm file. Upload with special:upload worked instead

« An error was encountered when opening the file for ZIP checks. » :(((

Atsirlin triaged this task as Normal priority.May 16 2019, 7:21 PM

It seems that this problem appears for large files exceeding 10 Mb. Our participants report that they are able to upload the files after compressing them to below 10 Mb.

Since we are running Wiki Loves Earth now and receive feedback from the participants, I can say that at least 10% of the uploaders experience this problem. That's a significant fraction that puts into question whether the infrastructure of Wikimedia Commons can fulfill the task it is designed for. I would even think of increasing the priority to High, because we may lose a lot of content and potential editors if this problem is not resolved.

Speravir added a subscriber: Speravir.EditedMay 16 2019, 11:00 PM

I got this error message with a GIF file, File:Steam engine in action (half speed).gif, processed with GIMP (doubled animation time for every frame). As you can see this is very small. If this does matter: I got this error with the script BigChunkedUpload.

Aklapper renamed this task from Cannot upload JPG file: "An error was encountered when opening the file for ZIP checks" to Cannot upload larger JPG/WEBM/GIF files: "An error was encountered when opening the file for ZIP checks".May 17 2019, 8:03 AM
Aklapper raised the priority of this task from Normal to Unbreak Now!.
Aklapper added a project: UploadWizard.
Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptMay 17 2019, 8:03 AM
hashar added a subscriber: hashar.

I am pretty sure that is related to the server side exception filled at: T223448 I will try to get more details on that task and maybe get it fixed.

Change 510893 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/core@master] Don't attempt to perform complete verification on async uploads

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

Ankry added a subscriber: Ankry.May 17 2019, 3:14 PM

Mentioned in SAL (#wikimedia-operations) [2019-05-17T15:20:50Z] <hashar@deploy1001> Synchronized php-1.34.0-wmf.5/includes/api/ApiUpload.php: Revert "Always validate uploads over api" - T223448 (T222994 T223446) (duration: 01m 00s)

If you tried to uploaded a file larger than 10MBytes, it is uploaded in small parts and a bug in MediaWiki would cause each parts to be rejected. That prevented upload of the file. It should be fixed now.

Thanks for fixing it so quickly! So far we have no further complains from the uploaders.

Aklapper closed this task as Resolved.May 20 2019, 3:14 PM

Thanks for the quick fix hashar! Closing this task per last comment and as T223448 is also closed.
Please reopen this task if this still happens in the next days.

hashar added a subscriber: matthiasmullie.

@matthiasmullie confirmed the root cause and worked on the fix \o/

Speravir removed a subscriber: Speravir.May 20 2019, 9:17 PM