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: specifying bucket region causes Container() to return non-existent containers #247

Open
colemickens opened this issue Dec 3, 2020 · 4 comments

Comments

@colemickens
Copy link

If you specify S3_REGION then the code path never actually seems to query s3 for the existence of the bucket....

@colemickens
Copy link
Author

try this:

S3_ACCESS_KEY_ID=redact
S3_SECRET_KEY=redact
S3_REGION=us-west-2

and try to get a location.Container("non-existent") and it will return successfully

try this:

S3_ACCESS_KEY_ID=redact
S3_SECRET_KEY=redact

and it now queries for the bucket region at the end of the function and errors out.

colemickens added a commit to colemickens/stow that referenced this issue Dec 3, 2020
colemickens added a commit to colemickens/stow that referenced this issue Dec 3, 2020
@colemickens
Copy link
Author

@colemickens
Copy link
Author

note: this fix doesn't cover another case I've discovered: if you set endpoint + region, it similarly fails to do the region check. This seems somewhat intentional, maybe due to other providers not having the region concept?

@jeevb
Copy link

jeevb commented Apr 9, 2021

Would it make sense to call HeadBucket to verify the existence of the container before returning it in these cases: https://docs.aws.amazon.com/sdk-for-go/api/service/s3/#S3.HeadBucket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants