swift3 doesn't recognize specific create bucket request with location
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Swift3 |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
request body: <CreateBucketCo
response: 400
logs:
swift: Expecting element CreateBucketCon
steps to reproduce:
1) download cirros image
wget http://
2) download and unzip OFFICIAL tools
wget http://
unzip ec2-ami-tools.zip
export TOOLS_DIR=
3) source cloud credentials and download certificates
nova x509-get-root-cert
nova x509-create-cert
4) prepare bundle
mkdir images
$TOOLS_
5) get s3 url
openstack endpoint list --service s3 --interface public --os-identity-
6) list and create credentials if needed
openstack ec2 credentials list
openstack ec2 credentials create
6) upload bundle and get error
$TOOLS_
->
ERROR: Error talking to S3: Server.
This seems like a bug in ec2-ami-tools. CreateBucketCon figuration is what's documented for the API [1] as well as what other clients use [2] [3] [4].
And yet, sure enough, AWS accepts CreateBucketCon straint:
> PUT / HTTP/1.1 4.s3.amazonaws. com json;q= 1, text/*;q=.9, */*;q=.8 SCYCA:lnKWPdY6P x8HmZ/Fl77AVkyX EpM= CFqZxSiSCsSnexQ Xyf7M8zcHTKXcGq EJbmrnY6eCGtiJF +x1h59c4BLxd+ 5Y= b349581c95cb0fa 4.s3.amazonaws. com/
> Host: b349581c95cb0fa
> Accept: application/
> x-amz-date: Wed, 28 Dec 2016 16:12:43 -0800
> Authorization: AWS AKIAINX36BBVRCI
> Content-Length: 99
>
* upload completely sent off: 99 out of 99 bytes
< HTTP/1.1 200 OK
< x-amz-id-2: 5+5eNAdV8xJnbhP
< x-amz-request-id: D5D78288796C428A
< Date: Thu, 29 Dec 2016 00:12:45 GMT
< Location: http://
< Content-Length: 0
< Server: AmazonS3
<
> GET / HTTP/1.1 4.s3.amazonaws. com json;q= 1, text/*;q=.9, */*;q=.8 SCYCA:glfdAWag+ 2XC50DTE4Az8JwV eNs= region: us-west-1 R0IJiK8pSxC9l6T BIXl345rfCz3k9e Jc/EEubf9qijEn4 8gFY1WGKrJnXKaX RSA= /b349581c95cb0f a4.s3-us- west-1. amazonaws. com/
> Host: b349581c95cb0fa
> Accept: application/
> x-amz-date: Wed, 28 Dec 2016 16:12:44 -0800
> Authorization: AWS AKIAINX36BBVRCI
> Content-Length: 99
>
* upload completely sent off: 99 out of 99 bytes
< HTTP/1.1 307 Temporary Redirect
< x-amz-bucket-
< x-amz-request-id: C04BDC83F73C85CA
< x-amz-id-2: xJR/BGFKs6h+
< Location: https:/
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Date: Thu, 29 Dec 2016 00:12:44 GMT
< Connection: close
< Server: AmazonS3
<
In fact, it even accepts junk data, like "<foo>< LocationConstra int>us- west-1< /LocationConstr aint></ foo>":
> PUT / HTTP/1.1 6.s3.amazonaws. com json;q= 1, text/*;q=.9, */*;q=.8 SCYCA:jjyByg8+ HCGGktvrgmrXcKE XzMg= NAckK4w6BMdh7VR dP8Mx0nEMLbLvHH zqcHyica8qPI20t GZ/qqb+ 5zQsVmxZcZ2A= b349581c95cb0fa 6.s3.amazonaws. com/
> Host: b349581c95cb0fa
> Accept: application/
> x-amz-date: Wed, 28 Dec 2016 16:22:25 -0800
> Authorization: AWS AKIAINX36BBVRCI
> Content-Length: 61
>
* upload completely sent off: 61 out of 61 bytes
< HTTP/1.1 200 OK
< x-amz-id-2: V+K/bmU3we/
< x-amz-request-id: B2AEBF2ECA183277
< Date: Thu, 29 Dec 2016 00:22:27 GMT
< Location: http://
< Content-Length: 0
< Server: AmazonS3
<
> GET / HTTP/1.1 6.s3.amazonaws. com json;q= 1, text/*;q=.9, */*;q=.8 SCYCA:au7fUHeGy thnpzCs81437xza mE8= region: us-west-1 S0S8M3XfWtL4nOk MV3tMsNOAgfrrbP TEiIhIMYW+ NMHNQ0g9OpcmYFx YNmYg= /b349581c95cb0f a6.s3-us- west-1. amazonaws. com/
> Host: b349581c95cb0fa
> Accept: application/
> x-amz-date: Wed, 28 Dec 2016 16:22:26 -0800
> Authorization: AWS AKIAINX36BBVRCI
>
< HTTP/1.1 307 Temporary Redirect
< x-amz-bucket-
< x-amz-request-id: 21B3CABC0401A6A0
< x-amz-id-2: W5NjXbClam0N1p4
< Location: https:/
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Date: Thu, 29 Dec 2016 00:22:26 GMT
< Server: AmazonS3
<
Going stranger than that, like "<foo>< bar>us- west-1< /bar></ foo>", thankfully *is* rejected:
> PUT / HTTP/1.1 7.s3-us- west-1. amazonaws. com json;q= 1, text/*;q=.9, */*;q=.8
> Host: b349581c95cb0fa
> Accept: application/
> x-amz-date: Wed, 28 Dec 2016 16:24:46 -0800...