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

S3 get_object_attributes error parsing XML #609

Closed
jaketreacher opened this issue Aug 23, 2022 · 5 comments
Closed

S3 get_object_attributes error parsing XML #609

jaketreacher opened this issue Aug 23, 2022 · 5 comments
Assignees
Labels
bug This issue is a bug.

Comments

@jaketreacher
Copy link

jaketreacher commented Aug 23, 2022

Describe the bug

Attempting to query S3 object attributes. It results in an error: Error parsing XML.

Expected Behavior

I receive S3 Object Attributes.

Current Behavior

An error occurs.

Reproduction Steps

Make a get_object_attributes request to an existing bucket/key.

s3_client.get_object_attributes()
    .bucket("my_bucket")
    .key("my_key")
    .object_attributes(ObjectAttributes::Checksum)
    .send()
    .await
    .unwrap();

Possible Solution

No response

Additional Information/Context

No response

Version

cargo tree | grep aws-
│   ├── aws-sig-auth v0.8.0
│   │   ├── aws-sigv4 v0.8.0
│   │   │   ├── aws-smithy-http v0.38.0
│   │   │   │   ├── aws-smithy-types v0.38.0
│   │   ├── aws-smithy-http v0.38.0 (*)
│   │   ├── aws-types v0.8.0
│   │   │   ├── aws-smithy-async v0.38.0
│   │   │   ├── aws-smithy-client v0.38.0
│   │   │   │   ├── aws-smithy-async v0.38.0 (*)
│   │   │   │   ├── aws-smithy-http v0.38.0 (*)
│   │   │   │   ├── aws-smithy-http-tower v0.38.0
│   │   │   │   │   ├── aws-smithy-http v0.38.0 (*)
│   │   │   │   ├── aws-smithy-types v0.38.0 (*)
│   │   │   ├── aws-smithy-types v0.38.0 (*)
│   ├── aws-smithy-async v0.38.0 (*)
│   ├── aws-smithy-client v0.38.0 (*)
│   ├── aws-smithy-http v0.38.0 (*)
│   ├── aws-smithy-http-tower v0.38.0 (*)
│   ├── aws-smithy-types v0.38.0 (*)
│   ├── aws-types v0.8.0 (*)
├── aws-config v0.47.0
│   ├── aws-http v0.47.0
│   │   ├── aws-smithy-http v0.47.0
│   │   │   ├── aws-smithy-eventstream v0.47.0
│   │   │   │   ├── aws-smithy-types v0.47.0
│   │   │   ├── aws-smithy-types v0.47.0 (*)
│   │   ├── aws-smithy-types v0.47.0 (*)
│   │   ├── aws-types v0.47.0
│   │   │   ├── aws-smithy-async v0.47.0
│   │   │   ├── aws-smithy-client v0.47.0
│   │   │   │   ├── aws-smithy-async v0.47.0 (*)
│   │   │   │   ├── aws-smithy-http v0.47.0 (*)
│   │   │   │   ├── aws-smithy-http-tower v0.47.0
│   │   │   │   │   ├── aws-smithy-http v0.47.0 (*)
│   │   │   │   ├── aws-smithy-types v0.47.0 (*)
│   │   │   ├── aws-smithy-http v0.47.0 (*)
│   │   │   ├── aws-smithy-types v0.47.0 (*)
│   ├── aws-sdk-sso v0.17.0
│   │   ├── aws-endpoint v0.47.0
│   │   │   ├── aws-smithy-http v0.47.0 (*)
│   │   │   ├── aws-types v0.47.0 (*)
│   │   ├── aws-http v0.47.0 (*)
│   │   ├── aws-sig-auth v0.47.0
│   │   │   ├── aws-sigv4 v0.47.0
│   │   │   │   ├── aws-smithy-eventstream v0.47.0 (*)
│   │   │   │   ├── aws-smithy-http v0.47.0 (*)
│   │   │   ├── aws-smithy-eventstream v0.47.0 (*)
│   │   │   ├── aws-smithy-http v0.47.0 (*)
│   │   │   ├── aws-types v0.47.0 (*)
│   │   ├── aws-smithy-async v0.47.0 (*)
│   │   ├── aws-smithy-client v0.47.0 (*)
│   │   ├── aws-smithy-http v0.47.0 (*)
│   │   ├── aws-smithy-http-tower v0.47.0 (*)
│   │   ├── aws-smithy-json v0.47.0
│   │   │   └── aws-smithy-types v0.47.0 (*)
│   │   ├── aws-smithy-types v0.47.0 (*)
│   │   ├── aws-types v0.47.0 (*)
│   ├── aws-sdk-sts v0.17.0
│   │   ├── aws-endpoint v0.47.0 (*)
│   │   ├── aws-http v0.47.0 (*)
│   │   ├── aws-sig-auth v0.47.0 (*)
│   │   ├── aws-smithy-async v0.47.0 (*)
│   │   ├── aws-smithy-client v0.47.0 (*)
│   │   ├── aws-smithy-http v0.47.0 (*)
│   │   ├── aws-smithy-http-tower v0.47.0 (*)
│   │   ├── aws-smithy-query v0.47.0
│   │   │   ├── aws-smithy-types v0.47.0 (*)
│   │   ├── aws-smithy-types v0.47.0 (*)
│   │   ├── aws-smithy-xml v0.47.0
│   │   ├── aws-types v0.47.0 (*)
│   ├── aws-smithy-async v0.47.0 (*)
│   ├── aws-smithy-client v0.47.0 (*)
│   ├── aws-smithy-http v0.47.0 (*)
│   ├── aws-smithy-http-tower v0.47.0 (*)
│   ├── aws-smithy-json v0.47.0 (*)
│   ├── aws-smithy-types v0.47.0 (*)
│   ├── aws-types v0.47.0 (*)
├── aws-sdk-s3 v0.17.0
│   ├── aws-endpoint v0.47.0 (*)
│   ├── aws-http v0.47.0 (*)
│   ├── aws-sig-auth v0.47.0 (*)
│   ├── aws-sigv4 v0.47.0 (*)
│   ├── aws-smithy-async v0.47.0 (*)
│   ├── aws-smithy-checksums v0.47.0
│   │   ├── aws-smithy-http v0.47.0 (*)
│   │   ├── aws-smithy-types v0.47.0 (*)
│   ├── aws-smithy-client v0.47.0 (*)
│   ├── aws-smithy-eventstream v0.47.0 (*)
│   ├── aws-smithy-http v0.47.0 (*)
│   ├── aws-smithy-http-tower v0.47.0 (*)
│   ├── aws-smithy-types v0.47.0 (*)
│   ├── aws-smithy-xml v0.47.0 (*)
│   ├── aws-types v0.47.0 (*)

Environment details (OS name and version, etc.)

AL2

Logs

message=Error parsing XML: invalid root, expected GetObjectAttributesOutput got StartEl { name: Name { prefix: "", local: "GetObjectAttributesResponse" }, attributes: [Attr { name: Name { prefix: "", local: "xmlns" }, value: "http://s3.amazonaws.com/doc/2006-03-01/" }], closed: false, depth: 0 }
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ServiceError { err: GetObjectAttributesError { kind: Unhandled(Custom("invalid root, expected GetObjectAttributesOutput got StartEl { name: Name { prefix: \"\", local: \"GetObjectAttributesResponse\" }, attributes: [Attr { name: Name { prefix: \"\", local: \"xmlns\" }, value: \"http://s3.amazonaws.com/doc/2006-03-01/\" }], closed: false, depth: 0 }")), meta: Error { code: None, message: None, request_id: None, extras: {} } }, raw: Response { inner: Response { status: 200, version: HTTP/1.1, headers: {"x-amz-id-2": "1nyU53SoiSBV2SeSnGdpr95cAmCSmdMTQD0nDfqpeaJZkgKfo/aYHdy/wCtRyOncvVc1ijYRq+Q=", "x-amz-request-id": "6SW9505AEYDB6CWD", "date": "Tue, 23 Aug 2022 01:01:52 GMT", "last-modified": "Tue, 23 Aug 2022 00:41:50 GMT", "server": "AmazonS3", "content-length": "244"}, body: SdkBody { inner: Once(Some(b"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<GetObjectAttributesResponse xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><Checksum><ChecksumSHA256>sOvNvkEhZKZenCcdBmS1115cgn7r2Mja3ZL7psTuncw=</ChecksumSHA256></Checksum></GetObjectAttributesResponse>")), retryable: true } }, properties: SharedPropertyBag(Mutex { data: PropertyBag, poisoned: false, .. }) } }', src/main.rs:63:10
@jaketreacher jaketreacher added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 23, 2022
@rcoh
Copy link
Contributor

rcoh commented Aug 23, 2022

looks like a bug, thanks for reporting we'll get a fix out

@Velfi Velfi removed the needs-triage This issue or PR still needs to be triaged. label Aug 23, 2022
@Velfi Velfi self-assigned this Aug 23, 2022
@Velfi
Copy link
Contributor

Velfi commented Aug 23, 2022

@jaketreacher This issue is caused by the fact that S3 isn't returning XML in the form specified by their model and the Rust SDK validates response XML. Most other SDKs ignore name mismatch issues with the response XML's root element. We can address this issue by suppressing that validation for S3 specifically. I'm going to look into what that would entail.

Thanks for surfacing this issue!

@Velfi
Copy link
Contributor

Velfi commented Aug 24, 2022

I have a fix for this smithy-lang/smithy-rs#1665
If it gets merged by tomorrow, I'll run a release.

@Velfi Velfi moved this from In Progress to In Review in AWS Rust SDK Public Roadmap Aug 24, 2022
@Velfi Velfi moved this from In Review to Pending Release in AWS Rust SDK Public Roadmap Aug 29, 2022
@jdisanti
Copy link
Contributor

jdisanti commented Sep 1, 2022

The fix for this went out with the 2022-08-31 release. Thanks again for reporting this!

@jdisanti jdisanti closed this as completed Sep 1, 2022
Repository owner moved this from Pending Release to Done in AWS Rust SDK Public Roadmap Sep 1, 2022
@jdisanti jdisanti removed the pending-release This issue will be fixed by an approved PR that hasn't been released yet. label Sep 1, 2022
@github-actions
Copy link

github-actions bot commented Sep 1, 2022

⚠️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.
Projects
Archived in project
Development

No branches or pull requests

4 participants