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

S3 GetBucketLocation fails when location is US Classic #249

Closed
tvh opened this issue Nov 17, 2015 · 4 comments
Closed

S3 GetBucketLocation fails when location is US Classic #249

tvh opened this issue Nov 17, 2015 · 4 comments
Assignees

Comments

@tvh
Copy link

tvh commented Nov 17, 2015

When the bucket's region is US Classic, Amazon S3 returns an empty string for the bucket's region:

<LocationConstraint xmlns="http://s3.amazonaws.com/doc/2006-03-01/"/>

This results in the following error in amazonka-s3:

SerializeError (SerializeError' {_serializeAbbrev = Abbrev "S3", _serializeStatus = Status {statusCode = 200, statusMessage = "OK"}, _serializeMessage = "empty node list, when expecting single node Region"})
@tvh
Copy link
Author

tvh commented Nov 17, 2015

This would also fail if LocationConstraint is set to EU.

@brendanhay
Copy link
Owner

Thanks for reporting, I'll look into fixing it.

@brendanhay brendanhay self-assigned this Nov 17, 2015
@tvh
Copy link
Author

tvh commented Nov 17, 2015

Related to this, CreateBucket will fail to work in us-east-1 as well. According to http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUT.html, it expects the value to be missing in this case.

@brendanhay
Copy link
Owner

Right, thanks. It seems the decision to replace the stringly-typed BucketLocationConstraint from the service definitions with the core Region-type was incorrect, albeit convenient. I'll introduced a newtype for Region that can handle the expected de/serialisation behaviour.

brendanhay added a commit that referenced this issue Nov 18, 2015
This allows more fine-grained (correct) control of de/serialisation
for BucketLocationConstraint values.

Fixes #249.
brendanhay added a commit that referenced this issue Nov 18, 2015
This allows more fine-grained (correct) control of de/serialisation
for BucketLocationConstraint values.

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

No branches or pull requests

2 participants