fake-s3 icon indicating copy to clipboard operation
fake-s3 copied to clipboard

Uploaded chunks using authorization header are not unwrapped before storing

Open cesmoak opened this issue 9 years ago • 7 comments

When performing a chunked upload using the Authorization header, chunks are wrapped with a chunk length and signature as described here: http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html

When storing these chunks, the wrapper needs to be removed before writing chunks. Right now, fake-s3 does not do this, resulting in the wrappers being written to files, corrupting them.

I have a hacky temporary fix made here: https://github.com/cesmoak/fake-s3. I don't claim to know enough about s3 or fake-s3 to say that this is robust, however it seems to work for me.

cesmoak avatar Oct 05 '15 05:10 cesmoak

We also have that problem.

spr-build avatar Nov 23 '15 06:11 spr-build

Have this problem too. Example http://take.ms/R1oEp

There is an issue https://github.com/jubos/fake-s3/issues/126 that attempted resolution but doesn't work for me.

robzolkos avatar Dec 02 '15 05:12 robzolkos

A work around, depending on your application and test case, is to configure your client to not use chunked uploads:

AmazonS3Client client = new AmazonS3Client(credentials); client.setEndpoint("http://localhost:1234"); client.setS3ClientOptions(S3ClientOptions.builder().setPathStyleAccess(true).disableChunkedEncoding().build());

It would be good to see a fix merged in, but until then hopefully this will save people time in finding a solution.

code-the-pizza avatar Oct 06 '16 22:10 code-the-pizza

I've also encountered this issue.

mvmn avatar Nov 14 '16 17:11 mvmn

we do have the pb with fog/aws also

cyrilchampier avatar Jan 10 '17 13:01 cyrilchampier

I'm also encountering this.

daslicious avatar Sep 28 '18 01:09 daslicious

aws_signature_version: 2 had to be set in the fog credentials of carrierwave

daslicious avatar Sep 28 '18 23:09 daslicious