vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.55k stars 1.38k forks source link

regression: aws-sdk-go-v2 bump removed region hint breaking GetBucketRegion #8022

Closed kaovilai closed 1 month ago

kaovilai commented 1 month ago

What steps did you take and what happened:

The bump removed region hint which is required in environments where ~/.aws/credentials do not specify credentials or specified region.

time="2024-07-12T17:30:17Z" level=error msg="Failed to determine bucket's region bucket: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, error: operation error S3: HeadBucket, resolve auth scheme: resolve endpoint: endpoint rule error, Invalid region: region was not a valid DNS name." backup-storage-location=openshift-adp/ts-velero-test-1 cmd=/plugins/velero-plugin-for-aws controller=backup-storage-location logSource="/opt/app-root/src/velero-plugin-for-aws/velero-plugin-for-aws/object_store.go:153" pluginName=velero-plugin-for-aws

Per following https://github.com/aws/aws-sdk-go-v2/blob/4599f78694cabb6853addabc6f92cb197fdb5647/feature/s3/manager/bucket_region.go#L45-L47 AWS will make a request to bucketname.s3.\<regionHint>.amazonaws.com/ Where region hint is obtained via config which in local dev machine could be loaded from ~/.aws/credentials so unit tests if any won't fail but in a container/k8s environment where cred file is not specified it may not work.

This bug affects users who do not specify region in their BSL config and rely on automatic region discovery.

What did you expect to happen: Not error

The following information will help us better understand what's going on:

If you are using velero v1.7.0+:
Please use velero debug --backup <backupname> --restore <restorename> to generate the support bundle, and attach to this issue, more options please refer to velero debug --help

If you are using earlier versions:
Please provide the output of the following commands (Pasting long output into a GitHub gist or other pastebin is fine.)

Anything else you would like to add:

Environment:

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.

kaovilai commented 1 month ago

target v1.14.2?

reasonerjt commented 1 month ago

target v1.14.2?

v1.14.1 is still WIP so I think it we can ship it in v1.14.1 (plugin v1.10.1)