aws/aws-sdk-ruby

get_bucket_policy in 1.52.1 results in Seahorse::Client::NetworkingError Empty or incomplete response body

carolinebeauchamp opened this issue · 5 comments

Describe the bug

My test scripts were failing, with a seahorse networking error when the same scripts worked a few weeks ago.
The offending method is: get_bucket_policy. Reverted back to 1.51.0 and it worked.
D, [2024-06-12T16:15:55.573885 #88512] DEBUG -- : [Aws::S3::Client 500 2.461562 3 retries] get_bucket_policy(bucket:"examplebucket") Seahorse::Client::NetworkingError Empty or incomplete response body

Expected Behavior

Expected it to get the bucket policy without error

Current Behavior

Calling get_bucket_policy results in the following error
D, [2024-06-12T16:15:55.573885 #88512] DEBUG -- : [Aws::S3::Client 500 2.461562 3 retries] get_bucket_policy(bucket:"examplebucket") Seahorse::Client::NetworkingError Empty or incomplete response body

Reproduction Steps

test script


require 'aws-sdk-s3'
require 'logger'
logger = Logger.new(STDOUT)
client = Aws::S3::Client.new(  logger: logger,
                               log_level: :debug,
                               region: "<bucketregion>"
)

resp = client.get_bucket_policy({
                                   bucket: "examplebucket",
                                 })

puts resp.to_h```

### Possible Solution

This PR https://github.com/aws/aws-sdk-ruby/pull/3040 has made changes in how responses are handled, and may have introduced something which breaks the response from get_bucket_policy

### Additional Information/Context

_No response_

### Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-s3

### Environment details (Version of Ruby, OS environment)

ruby 3.2 on MacOS and Debian ruby container

Sorry you're running into this. I was able to reproduce and agree it looks like #3040 may have broken this. I'm investigating a fix now.

Oh. I see the issue. The body in this case is json, so it fails the XML check (but it has members in body). I'm sorry.

We've reverted #3040 for now which should resolve this issue. Should be released today.

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

We are releasing a new fix #3046 which should also correctly handle this case and will be released today.