s5cmd icon indicating copy to clipboard operation
s5cmd copied to clipboard

`s5cmd sync` silently fails when syncing from bucket in wrong region

Open batterseapower opened this issue 5 months ago • 0 comments

If e.g. we are running in us-east-2:

$ s5cmd sync 's3://my-us-east-1-bucket/example/*' /tmp/example/
ERROR "sync s3://my-us-east-1-bucket/example/* /tmp/example/": BucketRegionError: incorrect region, the bucket is not in 'us-east-2' region at endpoint '', bucket is in 'us-east-1' region status code: 301, request id: <redacted>, host id: <redacted>
$ echo $?
0

Even if cross-region syncs are not supported, they shouldn't silently fail - I would expect a non-zero exit code here.

Related: https://github.com/peak/s5cmd/issues/816

batterseapower avatar Aug 14 '25 19:08 batterseapower