-
Notifications
You must be signed in to change notification settings - Fork 623
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 on SDK V2 throws NotImplemented if passed http req.Body io.ReadCloser #1938
Comments
Hi @Sid-Sun , Can you please include your full code, or at least full code example showing how you make a request and assign the body to the s3 request body? thanks, |
Hi! @RanVaknin I will try to provide a more concise, specific snippet later today, however, if it helps you can check the code repo: Thanks! |
@Sid-Sun , I'm not sure I see what is the use case in that commit you linked. Looking forward to seeing your repro code. Thanks, |
This issue has not received a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled. |
Hey @RanVaknin I can reproduce the error with the following:
i get the error:
if i read the body and pass a reader to it, the code works flawlessly, i get no errors and file is uploaded to my S3 bucket:
|
Hi @Sid-Sun, Thanks for including your repro code! 👍 Since you have chi-go setup there, Im not going to reproduce it on my machine, but what I'm guessing is happening, is that since the This is expected behavior for V2. Thanks, |
|
@RanVaknin thanks for the response, however, I don't understand how the SDK would find the body size from a io.Reader interface regardless of its source as the interface only exposes the Read function which reads from source and returns the number of read bytes and error. Can you add any insights here? Thanks |
@Sid-Sun I'm late to the party, but |
Describe the bug
I am receiving a HTTP request whose body I want to put to an object on AWS, on SDK V1 I would just pass the request body ReadCloser to the S3 uploader upload func and it would internally upload it in multipart to S3.
When I pass it to s3 PutObject on SDK V2 I get:
code (v2):
code (v1):
if I read the body and then pass the data through a reader it works perfectly fine
code (v2 - working):
Expected Behavior
AWS SDK V2 S3 PutObject should upload the data to S3 object from request's io read closer without needing to load it in memory and passing a reader over the bytes. Ideally, internally using multipart upload like SDK V1.
Current Behavior
AWS SDK V2 S3 PutObject throws an unimplemented functionality error:
Reproduction Steps
try to use SDK V2 S3 PutObject with a read closer
Possible Solution
No response
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
imported in file:
go mod graph output:
Compiler and Version used
go version go1.18 linux/amd64
Operating System and version
Fedora SilverBlue 36 linux 6.0.8-200.fc36.x86_64 (and on container)
The text was updated successfully, but these errors were encountered: