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

s3cmd du doesn't support ap-east-1 region #1362

Open
burmecia opened this issue Jan 11, 2024 · 2 comments
Open

s3cmd du doesn't support ap-east-1 region #1362

burmecia opened this issue Jan 11, 2024 · 2 comments

Comments

@burmecia
Copy link

When run s3cmd like below to get size of a bucket located in ap-east-1 region, got an error:

$ s3cmd du s3://bucket/dir
ERROR: S3 error: 400 (IllegalLocationConstraintException): The ap-east-1 location constraint is incompatible for the region specific endpoint this request was sent to.

When specified region still got same error:

$ s3cmd --region=ap-east-1 du s3://bucket/dir
ERROR: S3 error: 400 (IllegalLocationConstraintException): The ap-east-1 location constraint is incompatible for the region specific endpoint this request was sent to.

I can see ap-east-1 isn't in the region list:

  --region=REGION, --bucket-location=REGION
                        Region to create bucket in. As of now the regions are:
                        us-east-1, us-west-1, us-west-2, eu-west-1, eu-
                        central-1, ap-northeast-1, ap-southeast-1, ap-
                        southeast-2, sa-east-1

Is it possible to add support for ap-east-1 region? Thanks.

s3cmd version: 2.4.0
OS: macOS 14.1.2

@fromthestone
Copy link

fromthestone commented Apr 2, 2024

try this in your .s3cfg

bucket_location = ap-east-1
host_base = s3.ap-east-1.amazonaws.com
host_bucket = %(bucket)s.s3.ap-east-1.amazonaws.com

I have done similarly for eu-south-1 region and it works

@fviard
Copy link
Contributor

fviard commented Apr 13, 2024

@burmecia The help has some hint for regions hardcoded, but otherwise we don't have a whitelist and also don't do anything specific per region.

Based on other bug reports, it looks like that ap-east-1 region has a little bit of specific behavior, and so you have to correctly set the host_base and host_bucket with the region.

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

No branches or pull requests

3 participants