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.
Description
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | matthiasmullie | T223446 Cannot upload larger JPG/WEBM/GIF files: "An error was encountered when opening the file for ZIP checks" | |||
Resolved | PRODUCTION ERROR | matthiasmullie | T223448 ErrorException from line 1274 of /srv/mediawiki/php-1.34.0-wmf.5/includes/upload/UploadBase.php: PHP Warning: fread() expects parameter 1 to be resource, boolean given |
Event Timeline
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
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.
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.
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
Mentioned in SAL (#wikimedia-operations) [2019-05-17T15:18:26Z] <hashar> Deploying hotfix https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/510924/ . Should restore upload of large files on commons and other wikis #T223448 (poke T22994 T223446 )
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.
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.