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

aws s3 mb fails due to IllegalLocationConstraintException #3567

Closed
holtc opened this issue Sep 15, 2018 · 10 comments
Closed

aws s3 mb fails due to IllegalLocationConstraintException #3567

holtc opened this issue Sep 15, 2018 · 10 comments
Labels
confusing-error duplicate This issue is a duplicate. feature-request A feature should be added or improved.

Comments

@holtc
Copy link

holtc commented Sep 15, 2018

When I try to create a bucket from the aws cli, I get an error that I cannot resolve. Any hints? Thanks!

Command: aws s3 mb s3://bucket-name --region us-east-1
Error: make_bucket failed: s3:///bucket-name An error occurred (IllegalLocationConstraintException) when calling the CreateBucket operation: The unspecified location constraint is incompatible for the region specific endpoint this request was sent to.
Version: aws-cli/1.16.14 Python/3.6.6 Darwin/17.6.0 botocore/1.12.4

@holtc holtc changed the title aws s3 mb fails due to LocationConstraint error aws s3 mb fails due to IllegalLocationConstraintException Sep 15, 2018
@holtc
Copy link
Author

holtc commented Sep 15, 2018

I was able to create the bucket by changing the name. I think this error was thrown because the name was not unique, but the error message was completely misleading. I only found out the name issue by trying to create it via the AWS web console. May want to update this error message

@diehlaws diehlaws self-assigned this Sep 25, 2018
@diehlaws diehlaws added feature-request A feature should be added or improved. confusing-error labels Sep 25, 2018
@diehlaws
Copy link

diehlaws commented Sep 25, 2018

Thanks for reaching out to us about this @holtc. This error occurs as a result of the AWS CLI getting redirected to the endpoint where the existing bucket was created. After the redirect occurs the request is not updated with the location constraint of the new region, resulting in the location constraint and the S3 endpoint not matching up which in turn causes the IllegalLocationConstraint exception.

This behavior is something we are aware of and plan to change, however in the meantime you can override the endpoint URL for the request with --endpoint-url (e.g. aws s3 mb s3://bucket-name --region us-east-1 --endpoint-url https://s3.us-east-1.amazonaws.com). Please do let us know if using this option does not work as expected from your end.

@diehlaws diehlaws added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Sep 25, 2018
@fe01134
Copy link

fe01134 commented Apr 20, 2019

@diehlaws Your suggestion worked for me. Thank you.

@acdha
Copy link

acdha commented May 1, 2019

@diehlaws That workaround worked for me. It'd be nice if the client got fixed soon or at least had a doc pointer in the error message

@justnance justnance added the duplicate This issue is a duplicate. label May 6, 2019
@justnance
Copy link

Closing this issue as we are tracking the process under issue #3723. It has also been escalated internally to our documentation writers.

@yankouskia
Copy link

yankouskia commented Nov 1, 2019

I have also noticed, that if you create bucket with name without extension (bucketname.extension) - it causes the same error

@nbhradio
Copy link

the answer for @diehlaws worked for me.

@abitrolly
Copy link

@justnance this issue should be reopened. The title of #3723 doesn't reflect the problem with s3 mb that is still not fixed. For a high level tool the s3 mb command could include the workaround.

@yash0923
Copy link

This behavior is something we are aware of and plan to change, however in the meantime you can override the endpoint URL for the request with --endpoint-url (e.g. aws s3 mb s3://bucket-name --region us-east-1 --endpoint-url https://s3.us-east-1.amazonaws.com). Please do let us know if using this option does not work as expected from your end.

(e.g. aws s3 mb s3://bucket-name --region us-east-1 --endpoint-url https://s3.us-east-1.amazonaws.com)
It really works for me , thanks mate

thoward-godaddy pushed a commit to thoward-godaddy/aws-cli that referenced this issue Feb 12, 2022
* fix package regression test cases to remove the new added SAM related metadata.

* fix failing windows issue

* update ruby version. Ruby v2.5 is not supported any more

* update ruby version. Ruby v2.5 is not supported any more

* use layer full path to generate the dependency layer
@ArtemChemist
Copy link

The issue persists as of June 2024. Same deal: non-unique bucket name resulted in this misleading error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confusing-error duplicate This issue is a duplicate. feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

11 participants