POST with empty body results in 411 Error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Undecided
|
Unassigned | ||
tempest |
Invalid
|
Undecided
|
Andrea Frittoli |
Bug Description
Some API commands don't need a body - for example allocating a floating IP. However making a request without a body results in a 411 error:
curl -i https:/
HTTP/1.1 411 Length Required
nnCoection: close
Content-Length: 284
Fault Name: HttpRequestRece
Error Type: Default
Description: Http request received failed
Root Cause Code: -19013
Root Cause : HTTP Transport: Couldn't determine the content length
Binding State: CLIENT_
Service: null
Endpoint: null
Passing an Empty body works:
curl -i https:/
HTTP/1.1 200 OK
Content-Length: 164
Content-Type: application/xml; charset=UTF-8
Date: Fri, 31 May 2013 11:13:26 GMT
X-Compute-
<?xml version='1.0' encoding='UTF-8'?>
<floating_ip instance_id="None" ip="15.184.42.154" fixed_ip="None" id="3f9ce21c-
Phil,
seems to work for me.
dims@dims- desktop: ~/devstack$ curl -vs -i http:// 127.0.0. 1:8774/ v2/068bbe5294a4 4591aa138d0de5f e8f42/os- floating- ips -H "Content-Type: application/xml" -H "Accept: application/xml" -H "X-Auth-Token: 357bc34f43f140c 2b5f4f0b373712e 17" -X POST 44591aa138d0de5 fe8f42/ os-floating- ips HTTP/1.1 2b5f4f0b373712e 17 Request- Id: req-fae30a8e- f143-4556- 90db-cfff970667 ec Request- Id: req-fae30a8e- f143-4556- 90db-cfff970667 ec
* About to connect() to 127.0.0.1 port 8774 (#0)
* Trying 127.0.0.1...
* connected
* Connected to 127.0.0.1 (127.0.0.1) port 8774 (#0)
> POST /v2/068bbe5294a
> User-Agent: curl/7.27.0
> Host: 127.0.0.1:8774
> Content-Type: application/xml
> Accept: application/xml
> X-Auth-Token: 357bc34f43f140c
>
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Content-Type: application/xml
Content-Type: application/xml
< Content-Length: 127
Content-Length: 127
< X-Compute-
X-Compute-
< Date: Fri, 11 Oct 2013 12:07:36 GMT
Date: Fri, 11 Oct 2013 12:07:36 GMT
<
<?xml version='1.0' encoding='UTF-8'?>
* Connection #0 to host 127.0.0.1 left intact
<floating_ip instance_id="None" ip="172.24.4.226" fixed_ip="None" id="2" pool="public"/>* Closing connection #0