Bug 1213988

Summary: RGW Swift API: response for PUT on /container does not contain the mandatory Content-Length header when FCGI is used
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Yehuda Sadeh <yehuda>
Component: RGWAssignee: Yehuda Sadeh <yehuda>
Status: CLOSED ERRATA QA Contact: Tamil <tmuthami>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.2.3CC: cbodley, ceph-eng-bugs, ceph-qe-bugs, flucifre, hyelloji, kbader, kdreyer, mbenjamin, owasserm, sweil, tmuthami, wusui
Target Milestone: rc   
Target Release: 1.2.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-02 14:07:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yehuda Sadeh 2015-04-21 17:19:16 UTC
Description of problem:

Swift expects a Content-Length header on a container creation request


How reproducible:
always


Steps to Reproduce:
1. Create a container (bucket) through the swift api

Actual results:
No Content-Length header in the response (chunked response).


Expected results:
Content-Length header in the response


Additional info:
Fixed upstream

Comment 1 Federico Lucifredi 2015-04-22 16:48:16 UTC
Fcgi is not 1.3, it is 1.2.z, adjusting accordingly. Yehuda, please flag if I am wrong.

Comment 2 Yehuda Sadeh 2015-06-30 17:50:03 UTC
need qa_ack

Comment 7 Tamil 2015-08-13 01:47:25 UTC
tested this on 1.2.4 on magna016, still seeing the same error,

[ubuntu@magna016 ~]$curl -X PUT -H "X-Auth-Token: AUTH_rgwtk0e00000074657374757365723a73776966747d04ffb8446e91dddb79cd5578527d12247f78316f225f238b834e9eebf3b8ad8a60b43a" -H "X-Container-Read: .r:*" http://10.8.128.16/swift/v1/nwq/nano
MissingContentLength

Comment 8 Yehuda Sadeh 2015-08-13 02:04:45 UTC
The response your seeing is what we return because you didn't provide content length in the request, not really related to the actual big you're testing. You need to provide content length header to the request, and then see whether we return the appropriate header.

Comment 9 Tamil 2015-08-13 18:48:08 UTC
yes, verified this bug and looks good,

[ubuntu@magna016 ~]$ curl -i http://10.8.128.16/swift/v1/my-new-buckets -X PUT -H "Content-Length: 0"  -H "X-Auth-Token: AUTH_rgwtk0e00000074657374757365723a73776966747d04ffb8446e91dddb79cd5578527d12247f78316f225f238b834e9eebf3b8ad8a60b43a" 
HTTP/1.1 201 Created
Date: Thu, 13 Aug 2015 22:47:54 GMT
Accept-Ranges: bytes
Content-Length: 0
Connection: close
Content-Type: text/plain; charset=utf-8

Comment 10 Warren 2015-08-26 05:17:00 UTC
Works on 1.2.3.2 trusty and precise

Comment 11 Warren 2015-09-01 02:25:09 UTC
Failed on Centos 6.7

On Centos 6.7 I ran the commands below and got a zero length value

1. create a bucket
2. curl -i http://<ip of the rgw host>/swift/v1/<bucket_name> -X PUT -H "Content-Length: 0" -H "X-Auth-Token: <Auth-token>"
[inorder to find auth token, use the swift command below,
swift -A http://{IP ADDRESS}/auth/1.0 -U testuser:swift -K '{swift_secret_key}' stats -v ]
3. verify the content-length is displayed in the output.

Comment 12 Warren 2015-09-02 01:24:23 UTC
Whoops.  looks like zero length is correct.

Passed on Centos 6.7

Comment 14 errata-xmlrpc 2015-09-02 14:07:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1703.html