s5cmd
s5cmd copied to clipboard
`s5cmd ls` fails with BucketRegionError, but `aws s3 ls` works
-
s5cmd lsshould detect the region (likeaws s3 lsdoes) - 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.