-
Notifications
You must be signed in to change notification settings - Fork 653
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: PutObject
operation with empty body fails with 501 "NotImplemented" error
#1583
Comments
Thanks for reporting this issue @gdavison I've been able to reproduce this issue locally with the v2 SDK, and have begun investigating why this is happening. It doesn't look like this issue occurs with the v1 SDK. Even though the SDK is able to derive the Did you discover this as a new bug when updating the SDK to a new version? |
Updates the smithy-go HTTP Request to correctly handle building the request to an http.Request. HTTP Client Request must not have a non-nil Body if the ContentLength is 0. The client will treat this case as unknown length and use "transfer-encoding": chunked. This breaks Amazon S3 operations like PutObject which require content-length and do not support "transfer-encoding: chunked" Related to aws/aws-sdk-go-v2#1583
Updates the smithy-go HTTP Request to correctly handle building the request to an http.Request. HTTP Client Request must not have a non-nil Body if the ContentLength is 0. The client will treat this case as unknown length and use "transfer-encoding": chunked. This breaks Amazon S3 operations like PutObject which require content-length and do not support "transfer-encoding: chunked" Related to aws/aws-sdk-go-v2#1583
I've created PR aws/smithy-go#356 in the
|
Updates the smithy-go HTTP Request to correctly handle building the request to an http.Request. HTTP Client Request must not have a non-nil Body if the ContentLength is 0. The client will treat this case as unknown length and use "transfer-encoding": chunked. This breaks Amazon S3 operations like PutObject which require content-length and do not support "transfer-encoding: chunked" Related to aws/aws-sdk-go-v2#1583
This issue has been resolved in the SDK's |
|
@jasdel I added
to my In my case:
|
@lestephane are you still experiencing this issue after updating to the latest version of S3, Setting |
@jasdel I was using 1.26.0 and 1.11.1 when I got the problem and landed upon this issue in GitHub. I'm using a |
Would passing no |
Thanks for the update. You should be able to provide an reader that matches the content length. Though its important to note, if the The reason the SDK is not using your provided |
I will try to not specify any Body when I have time, and report. Hopefully that does the trick. |
Documentation
Describe the bug
When the
PutObject
operation is called with an empty body, the request fails with the following error:Expected behavior
The request should have succeeded
Current behavior
The request fails
Steps to Reproduce
Possible Solution
No response
AWS Go SDK version used
github.com/aws/aws-sdk-go-v2 v1.13.0, github.com/aws/aws-sdk-go-v2/service/s3 v1.24.1
Compiler and Version used
go version go1.17.2 darwin/amd64
Operating System and version
macOS 10.15.7
The text was updated successfully, but these errors were encountered: