Skip to content
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

ListObjectsV2WithContext fails since. v1.44.292 #4897

Closed
stijndehaes opened this issue Jun 29, 2023 · 2 comments · Fixed by #4898
Closed

ListObjectsV2WithContext fails since. v1.44.292 #4897

stijndehaes opened this issue Jun 29, 2023 · 2 comments · Fixed by #4898
Assignees
Labels
bug This issue is a bug. p0 This issue is the highest priority

Comments

@stijndehaes
Copy link

Describe the bug

Upgrading to v1.44.292 resulted in an error:

InvalidArgument: Invalid attribute name specified.
        status code: 400, request id: 5JYSNZJEXBFJ32JF, host id: K4NIwQPlEtsgD2OusmMA3QzSU0twb/Ztx2vX9WS6Nv2RpkU1+67clWarqLbWNljnZLJjN32jXiM=

Our code goes something like this:

s3Client.ListObjectsV2WithContext(ctx,
  &s3.ListObjectsV2Input{
    Bucket: aws.String(bucket),
    Prefix: aws.String(prefix),
  })

Expected Behavior

The only thing changed is the version, so I expect this call to continue working

Current Behavior

It fails with mentioned message

Reproduction Steps

See description

Possible Solution

No response

Additional Information/Context

No response

SDK version used

v1.44.292

Environment details (Version of Go (go version)? OS name and version, etc.)

go version go1.20.5 darwin/arm64

@stijndehaes stijndehaes added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 29, 2023
@lucix-aws
Copy link
Contributor

Reproduced this. The break happened with yesterday's release (v1.44.291 -> v1.44.292).

S3 added a new enum list field OptionalObjectAttributes to ListObjectsV2 that the SDK isn't serializing correctly:

GET /?list-type=2&prefix=bar HTTP/1.1
Host: foo.s3.us-east-2.amazonaws.com
User-Agent: aws-sdk-go/1.44.292 (go1.19.5; darwin; amd64)
Authorization: [REDACTED]
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20230629T160311Z
X-Amz-Optional-Object-Attributes: 
X-Amz-Security-Token: [REDACTED]
Accept-Encoding: gzip

The X-Amz-Optional-Object-Attributes header is serialized as the empty string when no values are provided in the list. It should be omitted instead.

This isn't a new behavioral error per se, in the sense that this bad serialization behavior is pre-existing, but the S3 API update from yesterday has made it visible. All operations that have an enum list field would serialize this to an empty header when given no input, it'll depend on the individual service/operation whether that results in a request failure.

As an aside, the Go v2 SDK appears to serialize this correctly.

@lucix-aws lucix-aws added p1 This is a high priority issue p0 This issue is the highest priority and removed needs-triage This issue or PR still needs to be triaged. p1 This is a high priority issue labels Jun 29, 2023
@lucix-aws lucix-aws self-assigned this Jun 29, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p0 This issue is the highest priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants