Skip to content

Downloading gzipped files decompresses and truncates the content #8263

Closed

Description

@cyberduck

fe09999 created the issue

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.


Attachments

Activity

  1. cyberduck commented on Oct 17, 2014

    @cyberduck
    ContributorAuthor

    @dkocher commented

    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.

  2. cyberduck commented on Oct 17, 2014

    @cyberduck
    ContributorAuthor

    fe09999 commented

    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.

  3. cyberduck commented on Oct 19, 2014

    @cyberduck
    ContributorAuthor

    @dkocher commented

    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.

  4. cyberduck commented on Oct 20, 2014

    @cyberduck
    ContributorAuthor

    fe09999 commented

    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.

  5. cyberduck commented on Oct 20, 2014

    @cyberduck
    ContributorAuthor

    fe09999 commented

    I have Windows 8.1 (not Windows 7).

  6. cyberduck commented on Oct 21, 2014

    @cyberduck
    ContributorAuthor

    @dkocher commented

    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.

  7. cyberduck commented on Jan 14, 2015

    @cyberduck
    ContributorAuthor

    a9896e4 commented

    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).

  8. cyberduck commented on Jan 14, 2015

    @cyberduck
    ContributorAuthor
  9. cyberduck commented on Jan 14, 2015

    @cyberduck
    ContributorAuthor

    @dkocher commented

    Replying to [comment:14 dkocher]:

    Also noted in (https://groups.google.com/forum/#!topic/cyberduck/yo7YldedY9E).

    Can you confirm that your use case is manually compressing the content and setting the Content-Encoding header in S3.

  10. cyberduck commented on Jan 14, 2015

    @cyberduck
    ContributorAuthor

    a9896e4 commented

    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.

  11. cyberduck commented on Jan 25, 2015

    @cyberduck
    ContributorAuthor

    @dkocher commented

    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).

  12. cyberduck commented on Jan 25, 2015

    @cyberduck
    ContributorAuthor

    @dkocher commented

    See also Serving Compressed Files.

  13. cyberduck commented on Jan 25, 2015

    @cyberduck
    ContributorAuthor

    @dkocher commented

    In bf823c1.

  14. cyberduck commented on Jan 26, 2015

    @cyberduck
    ContributorAuthor

    a9896e4 commented

    Thank you guys! It's working fine now.

  15. cyberduck commented on Jan 26, 2015

    @cyberduck
    ContributorAuthor

    fe09999 commented

    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.

  16. cyberduck commented on Jan 26, 2015

    @cyberduck
    ContributorAuthor

    a9896e4 commented

    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

  17. cyberduck commented on Jan 26, 2015

    @cyberduck
    ContributorAuthor

    fe09999 commented

    You are right, that solves the issue.

  18. cyberduck commented on Jan 26, 2015

    @cyberduck
    ContributorAuthor

    @dkocher commented

    Thanks for confirming the issue is resolved.

  19. cyberduck commented on Mar 13, 2015

    @cyberduck
    ContributorAuthor

    @dkocher commented

    #8263 is a duplicate.

  20. cyberduck commented on Oct 14, 2021

    @cyberduck
    ContributorAuthor

    @dkocher commented

    Will possibly be reverted due to #11662.

  21. locked as resolved and limited conversation to collaborators on Nov 26, 2021
  22. added theissue type on Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

high prioritys3AWS S3 Protocol Implementation

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions