New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3 Multipart Content-Length mismatch error #145
Comments
Can you try some different versions of the AWS SDK and perhaps using V2 authentication or disabling chunked encoding? If you submit a full test can I can investigate further. |
Thanks! So looks like val s3 = new AmazonS3Client()
s3.setS3ClientOptions(S3ClientOptions.builder().disableChunkedEncoding().build()) did the trick for the tests. Really bizarre why this started happening. Appreciate the suggestion. |
Ideally chunked encoding should work -- we even have a test for this. Can you give some more detail about the original symptoms, preferably a test case? |
I expect chunk encoded requests to fail previous to 1.5.0 prerelease -- previously S3Proxy did not decode these leading to overlong payloads. However it should work from 1.5.0 onward. |
@andrewgaul: I have the same problem when I upgrade the aws-sdk-java from 1.11.15 to 1.11.16. And I think I have tracked the cause down to the change in If I understand it correct s3proxy doesn't support chunked encoding with v4 signing? I have tried with the latest version of s3proxy 1.5.2. |
@smigfu V4 signature should work for both chunked and unchunked encoding -- see |
Sorry, I think I had a false assumption above. The chunked encoding doesn't work if s3proxy is set to no authentication. We don't set any credentials to the AWS client (in the real world our buckets are protected by IAM roles). We are using s3proxy to execute our tests locally and not against a live backend. S3 is fine with our configuration (no credentials and chunked-encoding but s3proxy throws the error [1]). Our s3proxy config file looks like this:
I haven't been able to reproduce this with the AwsSdkTest yet, because I couldn't set the TestUtils#startS3Proxy to not use authentication :-) [1]
|
I was also having this issue, and your suggestion does appear to have solved my problem. Running S3proxy with AWS_V4 'authorization' works fine with SDK version 1.11.86, 'none' authorization gives me the error listed above. Just wanted to say thanks, saved me from wasting even more time investigating this |
@smigfu Can you provide a complete test case? I set |
(just to add, since from a security point of view it sounds like a nightmare not using HTTPS and no Credentials: All our buckets do use IAM roles and are only accessed from our EC2 instances, thus we can omit the HTTPS overhead and rely on the IAM security model :-) ) |
So I don't think I'm seeing your first point, I'm hitting this error when using 'none' authorization with or without credentials set on the client. I can only get it working with the newer AWS SDK when setting keys in S3proxy (and setting auth to an actual protocol) and having credentials set in the client. |
Also check authentication type correctly in the constructor to handle configurations with anonymous access but set identity and credential. References #145.
@andrewgaul Looks good to me, testing against an S3proxy running locally I can make requests with or without credentials with 'none' authorisation and with AWS_V2_OR_V4 creds are checked as expected. |
Up until today I've been able to do multipart uploads using 1.4.0 version of s3proxy, suddenly I am getting the following errors uploading s3 streams within my tests. I've tried upgrading to 1.5.0 prerelease and downgrading to 1.3.0 but I'm getting the same error. Any debugging tips?
The text was updated successfully, but these errors were encountered: