-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Incorrect chunked encoding with 0-length underlying stream #3259
Comments
I think the problem is quite likely in the code below: aws-sdk-cpp/src/aws-cpp-sdk-core/include/aws/core/utils/stream/AwsChunkedStream.h Lines 31 to 47 in 18df00a
The gotcha is that Replacing the |
Also, in the reproducer above: Aws::S3::Model::PutObjectRequest req;
req.SetBucket(ToAwsString("bucket"));
req.SetKey(ToAwsString("emptydir/"));
req.SetBody(std::make_shared<std::stringstream>(""));
s3_client->PutObject(req); removing the |
Fwiw we have this integration test to try to test the case and its currently running and succeeding in AWS S3 so im curious, are you seeing issues with AWS S3 or just minio, or other 3rd party api compatible services. also its related to Announcement: S3 default integrity change #3253 where we now send trailing checksums as a default. We extensively tested with aws s3 but usage with third party may vary. the RFC seems fairly clear here though and minio does support all of this, so let me try your solution out, it makes sense. |
As the issue description says, we found this out with Minio as a server. Also, regarding https://github.com/aws/aws-sdk-cpp/blob/main/tests/aws-cpp-sdk-s3-integration-tests/BucketAndObjectOperationTest.cpp#L2390-L2410 : as pointed out in #3259 (comment) above, you would need to add a |
Yep seeing that now, creating another test, pushing a fix out, will have it ready momentarily.
This isnt exactly the issue, the issue is that we were sending one zero sized "chunk" then one trailing zero. i.e. the chunked stream would look like
where as it should look like
also the term "chunk" here is overloaded, the error in question is referring to aws-chunked NOT transfer encoding chunked which is a little confusing. still malformed though, missed this test case, my bad, adding the test and pushing out a fix momentarily |
I see, but the client is sending the header "transfer-encoding: chunked" anyway :) Are both happening at the same time? |
Yeah both are happening at the same time, libcurl is handling A while back we actually had a nasty bug where so hopefully that gives a little bit of a back history of whats going on there. fix coming soon though, finishing up some tests. |
fix merged, will be tagged with todays relesase, give a shout if you dont see it work as intended |
Thanks a lot for the super-quick handling! |
Describe the bug
On the Apache Arrow CI, newer versions of the AWS SDK lead to test failures against Minio:
apache/arrow#45304
A network traffic capture exhibits a problem around chunked encoding when the body is 0 bytes. The AWS SDK sends this request:
To which Minio responds this:
The HTTP 1.1 RFC around chunked encoding makes it clear that a 0-size trailing chunk is mandatory, but the AWS SDK doesn't send one.
Regression Issue
Expected Behavior
The AWS SDK should send a 0-size trailing chunk even if the underlying stream is empty.
Current Behavior
The AWS SDK sends an empty request body even though it declares the transfer-encoding as chunked, which is incorrect.
Reproduction Steps
Typical reproduction step:
(with
s3_client
configured to access a Minio endpoint)Possible Solution
No response
Additional Information/Context
No response
AWS CPP SDK version used
1.1.488
Compiler and Version used
Not sure, but likely irrelevant
Operating System and version
Ubuntu 22.04
The text was updated successfully, but these errors were encountered: