ZIP Archives get corrupt headers when using encryption - OC 7
I share a folder via link in owncloud 7.0.2 and have the encryption module enabled.
Downloading single files (pictures) works well bit the created zip archive is broken. This is not related to the zip64 error with osx I guess, because also android clients cannot handle the archive and state that the file header is corrupt. Here is the owncloud log, please have a look:
{"app":"PHP","message":"Cannot modify header information - headers already sent by (output started at /var/www/owncloud/3rdparty/mcnetic/phpzipstreamer/ZipStreamer.php:237) at /var/www/owncloud/apps/files_encryption/lib/helper.php#378","level":3,"time":"October 09, 2014 23:31:59"}
/made some changes to the text.
@schiesbn can you please have a look?
The redirectToErrorPage only work if the code is executed for rendering to the browser. In this case where we create the zip file this doesn't really make sense.
@derkostka are you able to download all pictures one by one ? I suspect that there might be a file in the lot that is broken or for which the share keys are missing.
You can also check the "data/$shareOwner/files_encryption/share-keys/$path" folder on the server and see whether every file in that folder has a share key.
@PVince81 You are right ! I´ve got 30 Pictures in that Folder, the last 5 Pictures have no .PubShare Keyfile and cannot be downloaded either.
--> Please, let´s not close this Report. I can help myself, but the normal user should not get into that trouble. Imho, OC should check itself for missing encryption keys and either give a warning in the file browser, or create the missing keys. What do you guys think ? How could this happen ?
This is likely a duplicate of https://github.com/owncloud/core/issues/11127 which was fixed on stable7, will be in OC 7.0.3.
This kind of problem should not happen in the first place and is fixed by the https://github.com/owncloud/core/issues/11127
Showing a warning is tricky: it would imply first analyzing the files before starting building the ZIP file and checking that they have a key and are encrypted, which requires opening these files. And then the files need to be opened again when building the ZIP file. The other idea would be to do this while the ZIP file is being built (note: it is built on the fly, not in advance), but then at the time where the error is detected the client has already received part of the ZIP file, which is what you got. I don't think the web browser can tell the client to abort download, unless Content-Length was sent. But we can't send Content-Length in advance because we don't know the final size of the ZIP file since it is built on the fly.
But maybe there should be a command like "files:fsck" on the CLI to manually check for broken files and possibly repair them. In the case of encryption, it is usually not possible to repair files or keys automatically because it requires the user's password.
Closing as this will apparently be fixed with 7.0.3. Please reopen if the problem persist in that version.