-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRC error with zip files downloaded from web UI #2352
Comments
Any information which files are affected? Because it seems to work just fine here with images and documents. |
The error messages always appear, with any file type :
That said, some files are corrupted and can't be opened, some others seem valid and I can open them. The fun part is that it depends on the program which did the unzip :
Please feel free to ask for more tests if necessary. |
Do zips that only have english characters work? |
No : I already tested files without accents in file name, the problem persists. |
I can confirm the error. When trying to upload to Gmail it doesn't allow the upload because it thinks there is a virus (there definitely isn't). When trying to open the file with 7zip or Nemo Fileroller it's also not possible. Funny thing is: When I use the commandline unzip it works fine. Edit: doesn't matter which filetypes are in the archives. Happens for images and documents here. |
I have the same problem with NC 11. |
Same issue here, zip files are often not working in some unzip software but OK in others. On my desktop - Dolphin can't open them as folders but Ark is OK with 'em. |
I am having a similar Issue. I did not get any CRC Errors or completely unreadable files, but Headers Error on 7-zip. The Main issue with that is that there is a gateway / reverse proxy between the server and the clients and that doesn't let any of those zips through. So nobody can download folders or multiple files, which is a big problem. See Errors in attached screenshots. Server: SUSE Enterprise 12 What I did: The Files were: a single line txt file and a new .xlsx with just random numbers in it. I don't know how I would look at the headers in 7zip, the most information I can get out the zip file is from zipinfo -v, but the Version on SUSE is from 2009, so I don't know how helpful that will be. But here it is. Output of zipinfo -vArchive: /home/it-department/scripts/New folder.zip There is no zipfile comment.End-of-central-directory record:Zip archive file size: 8451 (0000000000002103h) This zipfile constitutes the sole disk of a single-part archive; its Central directory entry #1:New folder/ offset of local header from start of archive: 0 The central-directory extra field contains:
There is no file comment. Central directory entry #2:New folder/Microsoft Excel-Arbeitsblatt (neu).xlsx offset of local header from start of archive: 73 The central-directory extra field contains:
There is no file comment. Central directory entry #3:There are an extra 20 bytes preceding this file. New folder/Neues Textdokument.txt offset of local header from start of archive: 7899 The central-directory extra field contains:
There is no file comment. Edit: Just some additional info. EDIT2:
I just set straight up false for zip64. I guess I will get errors on bigger files, but I am willing to trade not working at all (for me) for possible occasional errors. Hope this will get a real fix in a future release. |
Same issue for me (NC 11.0.2). I can also confirm that disabling Zip64 fixes the problem (I do not have any files larger than 4GB anyway) by setting |
Hi there. As some may already know, I'm the author of the ZipStreamer library responsible for creating zip files in OC and NC.
Thank you for your help. |
Sure, thanks for the reply:
|
Thank you for the reply.
Feel free to ask for more tests or info. |
Hey, thanks for the reply:
Best |
For me, the issue seems to be a bit more complicated than I initially thought. I found the following cases:
Unfortunately, I cannot share the failing 32 bit ZIP. |
I've been analyzing the 64bit Zips created by Nextcloud / Zipstreamer. And according to the Zip specification ( https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT ) they seem to be just fine. The headers error I got with 7-Zip are likely incorrectly detected by 7-zip - see the post by the developer here: https://sourceforge.net/p/sevenzip/discussion/45797/thread/cc8912f1/ The error i got referred to the file being a multi-part archive. I manually edited a test "broken" zip file created by nextcloud in a hex editor and replaced all the values in the "End of Central Directory Record" which are 0xFFFF with the corresponding values from the "Zip64 End of Central Record" and the zip went trough the gateway just fine. So we opened a case with the manufaturer of our Web gateway appliance. |
I'm running Nextcloud v11.0.3 via the official docker image behind an nginx reverse proxy (running on Ubuntu 16.04 LTS, all updates installed) and stumbled across the same issue. I can't open any of the downloaded zip files (with and without special characters), but I'm able to unzip them via commandline. Disabling zip64 as suggested works. Would be nice to have a solution for this :) |
Yes : $this->streamerInstance = new ZipStreamer(['zip64' => false]); in lib/private/Streamer.php It's work |
It would be very nice to know if the problem persists when the reverse proxy is removed from the setup... |
I write a PR #5112 |
We should first try to identify what is causing the problems in the first place, before deliberately disabling features that appear to work for the vast majority of users (Zip64 is required for zip files and file entries bigger than 4 GB, and is standardized and documented since 2001). I would love to fix any bug in ZipStreamer when it is found, but given that we already fixed a lot of the issues with the initial zip64 implementation, and given that we know various zip implementations out there do not correctly implement the standard (at least two are referenced in this thread alone), I suspect the problem(s) may lie in some of the other components involved. So to narrow down the problem(s) and find it's cause, everyone having an issue should (1) make sure no third party software is involved. That means, no proxy, no deep packet inspecting and/or manipulating firewall, no antivirus or similar software. If the problem persists, you should exactly document which zip program in which version on which operating system exposed the problem. |
I just created a sample folder with two sample files and downloaded it the following way:
Nextcloud seems to generate the zip-files on-the-fly, everytime someone's downloading the files, using a non-deterministic algorithm (every zip file has another hashsum). If you want to try it/inspect the generated zips, you can download them here (1,8kB all three files combined): [Link removed] System is, as already said, Nextcloud 11.0.3 from nextcloud/docker, running on an up-to-date Ubuntu 16.04 LTS host with nginx 1.10.0 as proxy and let's encrypt for my certificates. But maybe the zip files are fine (I can unzip them without problems via commandline [unzip-command]) and my archive manager (Nautilus archive manager, but I don't know what underlying library is used to unzip files) has a bug. Does anybody know if the zip files can be verified? E.g. if they are compliant to the specification? Update:
Update: For me the issue persists with Nextcloud 12.0.0 |
I can confirm the observations from @KopfKrieg.
Winrar (5,20, 2014) apparently also doesn't work. (Someone notified me that the downloads aren't working.) Here are the program details:
Using #5112 works around the problem. |
For me this currently is the major issue when using nextcloud. Because this also affects people whom I want to share with not caring about the correct support of zip standards. If @nickvergessen 's fix fixes it release a fix? Perhaps? |
I will prepare a custom patch for our repository |
I just tested it (together with nextcloud/3rdparty#74) but I still get this error: |
I have checked that gzip is supported by modern Android Phones and iPhones, but it's problematic with not so old models. So for the time being I would simply use zip universally, and change to gzip once 90% of mobile phones support it. Also I believe Windows cannot be taken into account in this regard. Windows is a clunky OS, and when you get it you assume you have to install other applications to make it work. A Windows system without compression support is just very incapable. The same as not having office suite or multimedia codecs, they are just the basics. |
Windows can open and create zip files... |
But that's the only compressed format it can open. Even when rar, 7zip, and gzip are widely used. |
many people are restricted from installing outside software on their computers, so they are left with only zip support. I'm an insurance agent, i commonly have to send archives to my underwriter. He is not able/allowed to open .rar files, or any other alternative archive. I am required to send .zip files. I don't like it, but we 100% DO have to take windows into account. it's a fact of life right now. |
And the drawbacks of using ZIP are only superfluous. |
Question: Why don't we let the user choose between zip and tar instead of assuming the user's preference based on his/her platform? (Maybe create a feature request?) |
Because it doesn't matter: |
Are you serious? Of course it matters, that's why I'm asking. |
We have said that it's somehow unpredictable if the target platform, the receiver of your files, will have support for gzip. So in practise having the option does nothing. |
While I see the point in "It just doesnt matter" and think its a valid argument in many cases, Downloading files/archives is (apart from syncing files) the number two use case of Nextcloud. So that must work in as many situations as possible (by default). An option to download tar instead of zip (or vice versa) sounds like an option to me. But fixing the broken zip download, which happens on some systems with some unzippers, should be the priority in first place. |
I just tested nextcloud/3rdparty#74 and now at least p7zip can extract the archive. It seems that OSX has a different bug. Lets get that in and we can see how to fix OSX in the next step. |
Looks like there are still some issues, see #8798 |
I have the same issue with nexctloud 13.0.1 :( |
still the same isse in nextcoud 15.0.4 |
Looks like this was never fixed? |
Do you need me to test? |
Would it help to change to another Zip-Library? Maybe https://github.com/maennchen/ZipStream-PHP works better. |
So this is a known problem and it's still open for almost 3 years in production versions? $this->streamerInstance = new ZipStreamer(['zip64' => false]); is already merged in lib/private/Streamer.php in the latest 15 and 16 versions, but zip's are still being corrupt. |
|
Steps to reproduce
Expected behaviour
Unzipped files should have correct CRC and be valid
Actual behaviour
Server configuration
Operating system: Debian 8.6
Web server: Nginx 1.6.2
Database: MySQL 5.5.50-0+deb8u1
PHP version: 5.6.24
Nextcloud version: 10.0.1
Updated from an older Nextcloud/ownCloud or fresh install: OC 8.2.7 (debian repos) -> manual upgrade to NC 9.0.54 -> upgrade to NC 10.0.1
Where did you install Nextcloud from: https://download.nextcloud.com/server/releases/
Signing status: No errors have been found.
List of activated apps:
App list
The content of config/config.php:
Config report
Are you using external storage, if yes which one: no
Are you using encryption: no
Are you using an external user-backend, if yes which one: no
Client configuration
Browser: firefox 50.0
Operating system: Windows 7
Logs
Web server error log
Web server error log (dates don't fit with zip download dates)
Nextcloud log (data/nextcloud.log)
Nextcloud log (just one repeated error I didn't investigate yet)
Browser log
Not sure it's useful in this case, if so please ask.
The text was updated successfully, but these errors were encountered: