Open StefH opened 8 years ago
I think it's this https://github.com/jubos/fake-s3/issues/107
I investigated further and the last version of aws-java-sdk-s3
that fake-s3
works with is 1.11.15
... A breaking change must have been introduced in 1.11.16
FWIW, it looks like the Amazon client uses chunked encoding by default now (rather than sending the raw bytes), and fake-s3 ends up calculating the md5 on encoded payload, not the raw data.
You can check by navigating to where fakes3 stores the data, running md5sum content
, and comparing that to the md5sum
of the original file.
A quick workaround is to initialize the AmazonS3Client with chunked-mode disabled, i.e.:
s3client.setS3ClientOptions(
S3ClientOptions.builder
.setPathStyleAccess(true)
.disableChunkedEncoding.build)
When I do this locally, everything works fine.
(I'm running with the AWS SDK version 1.11.41)
can we have a cleaner fix other than this flag?
this make the production code look like:
if (USING_FASKES3)
AmazonS3ClientBuilder.standard().disableChunkedEncoding
else
AmazonS3ClientBuilder.standard()
should have better solution?
-cl
I agree that this is a pretty clunky solution. Will investigate a solution and see if it is easy to get on the roadmap.
the work-around works but as kknd22 commented, I would also like a cleaner solution
I'm using AWS S3 SDK to put a file into this fake s3.