s5cmd icon indicating copy to clipboard operation
s5cmd copied to clipboard

`s5cmd ls` fails with BucketRegionError, but `aws s3 ls` works

Open timotheecour4 opened this issue 3 years ago • 0 comments

  • s5cmd ls should detect the region (like aws s3 ls does)
  • furthermore, instead of just saying "the bucket is not in 'us-west-2' region at endpoint", it should also say the actual region
aws s3 ls s3://mybucket/
works

s5cmd ls s3://mybucket/
ERROR "ls s3://mybucket/": BucketRegionError: incorrect region, the bucket is not in 'us-west-2' region at endpoint '' status code: 301, request id: , host id:

note

AWS_REGION isn't set in my environment, but the region is set in my aws profile (the error disappears if I remove the region from the environment profile)

So this looks like very related to https://github.com/peak/s5cmd/issues/519, and the same recommendation would fix this issue:

While using the AWS_REGION or "Region section of AWS profile" makes sense for the destination bucket, it doesn't make as much sense for the source bucket.

timotheecour4 avatar Oct 06 '22 02:10 timotheecour4