Cyberduck Mountain Duck CLI

Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#8263 closed defect (fixed)

Downloading gzipped files decompresses and truncates the content

Reported by: thuettner Owned by: dkocher
Priority: high Milestone: 4.6.4
Component: s3 Version: 4.5.2
Severity: normal Keywords: AWS, S3, CloudTrail
Cc: Architecture: Intel
Platform: Windows 8.1

Description

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 (4)

cyberduck transfers.png (53.5 KB) - added by thuettner 4 years ago.
Screenshot of transfer window
478983378254_CloudTrail_eu-west-1_20140617T0005Z_38m28JInQHaNeCTz.json.gz (4.9 KB) - added by thuettner 4 years ago.
File downloaded by CyberDuck, decompressed automatically and truncated
478983378254_CloudTrail_eu-west-1_20140617T0005Z_38m28JInQHaNeCTz.json (53.7 KB) - added by thuettner 4 years ago.
Same file when directly downloaded from S3 (and then decompressed)
478983378254_CloudTrail_eu-west-1_20140617T0005Z_38m28JInQHaNeCTz.json.2.gz (4.9 KB) - added by thuettner 4 years ago.
Same file when downloaded with another tool

Download all attachments as: .zip

Change History (30)

comment:1 Changed 4 years ago by dkocher

  • Component changed from core to s3
  • Milestone set to 4.5.3
  • Owner set to dkocher
  • Priority changed from normal to high
  • Status changed from new to assigned

comment:2 follow-up: Changed 4 years ago by dkocher

  • Resolution set to worksforme
  • Status changed from assigned to closed

I cannot reproduce this issue. Added test in r15379. 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.

Changed 4 years ago by thuettner

Screenshot of transfer window

Changed 4 years ago by thuettner

File downloaded by CyberDuck, decompressed automatically and truncated

Changed 4 years ago by thuettner

Same file when directly downloaded from S3 (and then decompressed)

Changed 4 years ago by thuettner

Same file when downloaded with another tool

comment:3 in reply to: ↑ 2 ; follow-up: Changed 4 years ago by thuettner

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.

Last edited 4 years ago by thuettner (previous) (diff)

comment:4 Changed 4 years ago by thuettner

  • Resolution worksforme deleted
  • Status changed from closed to reopened

comment:5 Changed 4 years ago by dkocher

  • Summary changed from Downloading AWS CloudTrail files decompresses and truncates the content to Downloading gzipped files decompresses and truncates the content

comment:6 follow-up: Changed 4 years ago by dkocher

  • Platform set to Windows 7

comment:7 in reply to: ↑ 3 ; follow-up: Changed 4 years ago by dkocher

Replying to 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.

comment:8 Changed 4 years ago by dkocher

  • Milestone 4.5.3 deleted

comment:9 in reply to: ↑ 7 Changed 4 years ago by thuettner

The flag was not checked and there is no default application defined.

Replying to dkocher:

Replying to 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.

comment:10 in reply to: ↑ 6 Changed 4 years ago by thuettner

I have Windows 8.1 (not Windows 7).

comment:11 Changed 4 years ago by dkocher

  • Platform changed from Windows 7 to Windows 8.1

comment:12 Changed 4 years ago by dkocher

  • Resolution set to worksforme
  • Status changed from reopened to closed

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.

comment:13 Changed 3 years ago by Mikhail C

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

comment:14 follow-up: Changed 3 years ago by dkocher

  • Resolution worksforme deleted
  • Status changed from closed to reopened

comment:15 in reply to: ↑ 14 Changed 3 years ago by dkocher

Replying to 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.

comment:16 Changed 3 years ago by Mikhail C

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.

comment:17 Changed 3 years ago by dkocher

  • Milestone set to 4.7

comment:18 Changed 3 years ago by dkocher

  • Milestone changed from 4.7 to 4.6.4
  • Status changed from reopened to new

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

comment:19 Changed 3 years ago by dkocher

comment:20 Changed 3 years ago by dkocher

  • Resolution set to fixed
  • Status changed from new to closed

In r16575.

comment:21 Changed 3 years ago by Mikhail C

Thank you guys! It's working fine now.

comment:22 Changed 3 years ago by thuettner

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.

comment:23 Changed 3 years ago by Mikhail C

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

comment:24 Changed 3 years ago by thuettner

You are right, that solves the issue.

comment:25 Changed 3 years ago by dkocher

Thanks for confirming the issue is resolved.

comment:26 Changed 3 years ago by dkocher

#8263 is a duplicate.

Note: See TracTickets for help on using tickets.
swiss made software