Skip to content

mkdir (create_bucket) throws IllegalLocationConstraintException #139

Description

@delijati

Error:

fs = s3fs.S3FileSystem(client_kwargs={"region_name": region_name})
# tried also config_kwargs
...

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.

Solution:

s3.create_bucket(                                                                                                                                                                                
    Bucket=target_uri.bucket,
    CreateBucketConfiguration={'LocationConstraint': REGION})

More info [1]

[1] boto/boto3#781

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions