You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Downloading gzipped files decompresses and truncates the content #8263
When I download CLoudTrail files from AWS S3, the files get decompressed and truncated.
For instance, the file AWSLogs//CloudTrail/////CloudTrail__*.json.gz has a size of 32.5KB.
Downloading it, the file becomes plain text (decompressed) and has a length of 32.5KB. Of course, when you decompress it it should have a bigger length afterwards, not the compressed length.
Btw, decompressing should be an option. Is really nice to have, but not useful in all cases.
I cannot reproduce this issue. Added test in 7df441c. Can you please post the transcript from the Transfers window (Ctrl-L) if you reopen this issue. If you have choosen to open the downloaded file with the default application it could be uncompressed after the download is complete. Refer to Preferences → Transfers → Downloads → Open downloaded files with default application.
I added a few files so you can see my results.
I don't believe that the default application has something to do with it. When I try to decompress the files with 7zip I get an error message; and text editors can open the *.gz document and display it. For me this looks like CyberDuck is doing the decompression. (This does not happen when I use an alternative tool to download from S3.)
I am available for an online session if you want to. Let me know how to contact you.
I don't believe that the default application has something to do with it.
Can you you let me know the setting in Preferences → Transfers → Downloads → Open downloaded files with default application. and try to disable the feature if it is currently enabled.
The flag was not checked and there is no default application defined.
Replying to [comment:7 dkocher]:
Replying to [comment:3 thuettner]:
I don't believe that the default application has something to do with it.
Can you you let me know the setting in Preferences → Transfers → Downloads → Open downloaded files with default application. and try to disable the feature if it is currently enabled.
P.S.
S3Browser downloads the files as is, without unzipping, as well as my self written java tool.
That's why i'm sure that the files are valid, and something's wrong on Cyberduck side.
I can reproduce the bug here with files in S3 that are compressed with a Content-Encoding: gzip custom header set using metadata. The problem is that we limit reading from the known deflated size of an object which works in general for WebDAV because the Content-Encoding will be applied on the fly when serving the file. The file is stored on the server uncompressed and its length is known and we will read up the n bytes of the uncompressed file from the deflated stream. Compared to S3, the file is always compressed and the deflated size is not known. We only read the n bytes equal the compressed object from the deflated stream.
As a resolution I think we best disable the detection of Content-Encoding when connected to S3 instead of fixing the issue as otherwise users will have downloaded .gz files that are already decompressed. We may better want to retrieve the compressed file as is (and advertised in the object key extension).
Activity
cyberduck commentedon Oct 17, 2014
I cannot reproduce this issue. Added test in 7df441c. Can you please post the transcript from the Transfers window (Ctrl-L) if you reopen this issue. If you have choosen to open the downloaded file with the default application it could be uncompressed after the download is complete. Refer to Preferences → Transfers → Downloads → Open downloaded files with default application.
cyberduck commentedon Oct 17, 2014
I added a few files so you can see my results.
I don't believe that the default application has something to do with it. When I try to decompress the files with 7zip I get an error message; and text editors can open the *.gz document and display it. For me this looks like CyberDuck is doing the decompression. (This does not happen when I use an alternative tool to download from S3.)
I am available for an online session if you want to. Let me know how to contact you.
cyberduck commentedon Oct 19, 2014
Replying to [comment:3 thuettner]:
Can you you let me know the setting in Preferences → Transfers → Downloads → Open downloaded files with default application. and try to disable the feature if it is currently enabled.
cyberduck commentedon Oct 20, 2014
The flag was not checked and there is no default application defined.
Replying to [comment:7 dkocher]:
cyberduck commentedon Oct 20, 2014
I have Windows 8.1 (not Windows 7).
cyberduck commentedon Oct 21, 2014
Still cannot reproduce the issue using your test file. I must assume there is another process that touches the file after the download is complete.
cyberduck commentedon Jan 14, 2015
Guys,
I got the same thing.
Gzipped files are decompressed and truncated to the size of the archive file, when downloading from S3.
Platform: Windows 7.
Version: 4.6.1 (tried to update to the current snapshot, 4.6.2. Didn't help).
cyberduck commentedon Jan 14, 2015
Also noted in (https://groups.google.com/forum/#!topic/cyberduck/yo7YldedY9E).
cyberduck commentedon Jan 14, 2015
Replying to [comment:14 dkocher]:
Can you confirm that your use case is manually compressing the content and setting the
Content-Encodingheader in S3.cyberduck commentedon Jan 14, 2015
No, I can't, unfortunately.
I'm a consumer of those files. They are uploaded by other people.
Metadata-Info tab says this:
Content-Encoding: gzip
Content-Type: text/csv
P.S.
S3Browser downloads the files as is, without unzipping, as well as my self written java tool.
That's why i'm sure that the files are valid, and something's wrong on Cyberduck side.
cyberduck commentedon Jan 25, 2015
I can reproduce the bug here with files in S3 that are compressed with a
Content-Encoding: gzipcustom header set using metadata. The problem is that we limit reading from the known deflated size of an object which works in general for WebDAV because theContent-Encodingwill be applied on the fly when serving the file. The file is stored on the server uncompressed and its length is known and we will read up thenbytes of the uncompressed file from the deflated stream. Compared to S3, the file is always compressed and the deflated size is not known. We only read thenbytes equal the compressed object from the deflated stream.As a resolution I think we best disable the detection of
Content-Encodingwhen connected to S3 instead of fixing the issue as otherwise users will have downloaded.gzfiles that are already decompressed. We may better want to retrieve the compressed file as is (and advertised in the object key extension).cyberduck commentedon Jan 25, 2015
See also Serving Compressed Files.
cyberduck commentedon Jan 25, 2015
In bf823c1.
cyberduck commentedon Jan 26, 2015
Thank you guys! It's working fine now.
cyberduck commentedon Jan 26, 2015
I just tried it out with the latest version and downloaded CloudTrail files from S3. The files still get decompressed to plain text and then cut.
cyberduck commentedon Jan 26, 2015
Have you updated to the snapshot build?
The fix hasn't been released yet.
Maybe this can help you:
https://trac.cyberduck.io/wiki/help/en/howto/preferences#Update
cyberduck commentedon Jan 26, 2015
You are right, that solves the issue.
cyberduck commentedon Jan 26, 2015
Thanks for confirming the issue is resolved.
cyberduck commentedon Mar 13, 2015
#8263 is a duplicate.
cyberduck commentedon Oct 14, 2021
Will possibly be reverted due to #11662.