You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.
I'm trying to use s3 as a storage backend, utilising storage.region_name to specify a region in which to place the bucket (eu-west-1).
HeadBucket is failing as expected, which means it's then trying to create the bucket, but is failing with
botocore.exceptions.ClientError: 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.
It looks like boto3 requires CreateBucketConfiguration={'LocationConstraint':'eu-west-1'} to be specified in the bucket.create() function - but this is not possible currently.
Is there a way to get around this, or a possible fix?
pypicloud version = 1.0.11
The text was updated successfully, but these errors were encountered:
a minor patch to check the region_name before setting location_constraint will remove this unexpected hiccup.
AWS is definitely partially to blame here... having the "default" be invalid makes me SMH.
I think I got around this by only setting the config option if it is notus-east-1 through the helm chart I use, but that seems like a bit of silly "gotcha" that people will trip over.
I also resorted to manually creating through the UI before figuring out what was going on, and it's definitely less than ideal user experience.
Suggested code:
if config.region_name and config.region_name != "us-east-1":
location = {'LocationConstraint': config.region_name}
bucket.create(CreateBucketConfiguration=location)
else:
bucket.create()
Might open a PR for this unless someone gets to it before me
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I'm trying to use s3 as a storage backend, utilising storage.region_name to specify a region in which to place the bucket (eu-west-1).
HeadBucket is failing as expected, which means it's then trying to create the bucket, but is failing with
botocore.exceptions.ClientError: 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.
It looks like boto3 requires CreateBucketConfiguration={'LocationConstraint':'eu-west-1'} to be specified in the bucket.create() function - but this is not possible currently.
Is there a way to get around this, or a possible fix?
pypicloud version = 1.0.11
The text was updated successfully, but these errors were encountered: