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

Comments

Projects
None yet
2 participants
@tvh

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

This comment has been minimized.

Show comment
Hide comment
@tvh

tvh Nov 17, 2015

This would also fail if LocationConstraint is set to EU.

tvh commented Nov 17, 2015

This would also fail if LocationConstraint is set to EU.

@brendanhay

This comment has been minimized.

Show comment
Hide comment
@brendanhay

brendanhay Nov 17, 2015

Owner

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

Owner

brendanhay commented Nov 17, 2015

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

@brendanhay brendanhay self-assigned this Nov 17, 2015

@tvh

This comment has been minimized.

Show comment
Hide comment
@tvh

tvh 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.

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

This comment has been minimized.

Show comment
Hide comment
@brendanhay

brendanhay Nov 17, 2015

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.

Owner

brendanhay commented Nov 17, 2015

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

Adding custom LocationConstraint type
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

Adding custom LocationConstraint type
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