Skip to content

[v15] fix: access graph fails to fetch s3 bucket details#50765

Merged
tigrato merged 1 commit intobranch/v15from
tigrato/fix-sdk2-s3-list-errs-v15
Jan 6, 2025
Merged

[v15] fix: access graph fails to fetch s3 bucket details#50765
tigrato merged 1 commit intobranch/v15from
tigrato/fix-sdk2-s3-list-errs-v15

Conversation

@tigrato
Copy link
Copy Markdown
Contributor

@tigrato tigrato commented Jan 6, 2025

Backport #50758 to branch/v15

changelog: Fixes a bug where S3 bucket details fail to fetch due to incorrect bucket region.

* fix: access graph fails to fetch s3 bucket details

With SDK V1, AWS get bucket details such as policies, acls, status...
didn't require the specification of the target s3 bucket location. With
the recent changes to support newer versions of the AWS SDK, the get
bucket details started to fail with the following error:

```
BucketRegionError: incorrect region, the bucket is not in 'ap-south-1' region at endpoint '', bucket is in 'eu-central-1' region
status code: 301, request id: QS5C24H12ZV3VNM4, host id: mzVDk4010MPTCFdxyE/XwERX9W35MSge85PG+h5Jvwyvi7MhxdXLaysb2PTZCMY9r1ngBi6Gv6g=, failed to fetch bucket "cyz" acls polic
```

This PR uses `HeadBucket` to retrieve the location of the s3 bucket and
then uses the bucket location client to retrieve the s3 bucket details.

Fixes #50757

* fix tests

* handle review comments
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 6, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
tigrato/fix-sdk2-s3-list-errs-v15 HEAD 1 ✅SUCCEED tigrato-fix-sdk2-s3-list-errs-v15 2025-01-06 13:33:26

@tigrato tigrato added this pull request to the merge queue Jan 6, 2025
Merged via the queue into branch/v15 with commit 7c7f522 Jan 6, 2025
@tigrato tigrato deleted the tigrato/fix-sdk2-s3-list-errs-v15 branch January 6, 2025 16:31
@doggydogworld doggydogworld mentioned this pull request Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants