Bug 987841 - [REST]:GET request to a subdirectory results in /volume_not_in_ring/0/AUTH_** error
Summary: [REST]:GET request to a subdirectory results in /volume_not_in_ring/0/AUTH_**...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: gluster-swift
Version: 2.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
: RHGS 2.1.2
Assignee: crisbud@redhat.com
QA Contact: pushpesh sharma
URL:
Whiteboard:
Depends On: 1046233
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-24 09:31 UTC by pushpesh sharma
Modified: 2015-05-15 18:20 UTC (History)
7 users (show)

Fixed In Version: glusterfs-3.4.0.50rhs
Doc Type: Bug Fix
Doc Text:
Previously, the GET requests on subdirectories would result in a traceback in Object Store. With this update, GET requests work as expected.
Clone Of:
Environment:
Last Closed: 2014-02-25 07:33:42 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2014:0208 0 normal SHIPPED_LIVE Red Hat Storage 2.1 enhancement and bug fix update #2 2014-02-25 12:20:30 UTC

Description pushpesh sharma 2013-07-24 09:31:40 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
[psharma@dhcp193-181 ~]$ curl -v -X PUT -H 'X-Auth-Token: AUTH_tk44b09617995d4305a19676857a86b86e' -k http://10.65.207.210:8080/v1/AUTH_test/container
* About to connect() to 10.65.207.210 port 8080 (#0)
*   Trying 10.65.207.210...
* Connected to 10.65.207.210 (10.65.207.210) port 8080 (#0)
> PUT /v1/AUTH_test/container HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 10.65.207.210:8080
> Accept: */*
> X-Auth-Token: AUTH_tk44b09617995d4305a19676857a86b86e
> 
< HTTP/1.1 201 Created
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
< Date: Wed, 24 Jul 2013 09:02:49 GMT
< 
* Connection #0 to host 10.65.207.210 left intact

2. 
[psharma@dhcp193-181 ~]$ curl -v -X PUT -T ~/dummy_files/1k-H 'X-Auth-Token: AUTH_tk44b09617995d4305a19676857a86b86e' -k http://10.65.207.210:8080/v1/AUTH_test/container/dir-l0/file.txt
1k_mod.txt  1k.txt      
[psharma@dhcp193-181 ~]$ curl -v -X PUT -T ~/dummy_files/1k.txt -H 'X-Auth-Token: AUTH_tk44b09617995d4305a19676857a86b86e' -k http://10.65.207.210:8080/v1/AUTH_test/container/dir-l0/file.txt
* About to connect() to 10.65.207.210 port 8080 (#0)
*   Trying 10.65.207.210...
* Connected to 10.65.207.210 (10.65.207.210) port 8080 (#0)
> PUT /v1/AUTH_test/container/dir-l0/file.txt HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 10.65.207.210:8080
> Accept: */*
> X-Auth-Token: AUTH_tk44b09617995d4305a19676857a86b86e
> Content-Length: 1024
> Expect: 100-continue
> 
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 201 Created
< Last-Modified: Wed, 24 Jul 2013 09:03:25 GMT
< Content-Length: 0
< Etag: 568ee44fdfc5763002295ac7f732aada
< Content-Type: text/html; charset=UTF-8
< Date: Wed, 24 Jul 2013 09:03:25 GMT
< 
* Connection #0 to host 10.65.207.210 left intact

3.

[psharma@dhcp193-181 ~]$ curl -v -X GET -H 'X-Auth-Token: AUTH_tk44b09617995d4305a19676857a86b86e' -k http://10.65.207.210:8080/v1/AUTH_test/container/dir-l0
* About to connect() to 10.65.207.210 port 8080 (#0)
*   Trying 10.65.207.210...
* Connected to 10.65.207.210 (10.65.207.210) port 8080 (#0)
> GET /v1/AUTH_test/container/dir-l0 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 10.65.207.210:8080
> Accept: */*
> X-Auth-Token: AUTH_tk44b09617995d4305a19676857a86b86e
> Content-Length: 1024
> Expect: 100-continue
> 
< HTTP/1.1 400 Bad Request
< Content-Length: 62
< Content-Type: text/html; charset=UTF-8
< Date: Wed, 24 Jul 2013 09:03:52 GMT
* HTTP error before end of send, stop sending
< 
* Closing connection 0
Invalid path: /volume_not_in_ring/0/AUTH_test/container/dir-l0[psharma@dhcp193-181 ~]$ 


Actual results:

#tail /var/log/messages 

Jul 24 14:35:36 dhcp207-210 object-server 127.0.0.1 - - [24/Jul/2013:09:05:36 +0000] "GET /test/0/AUTH_test/container/dir-l0" 200 - "-" "txce7c188872f743a08ba6c1651f0835ce" "curl/7.29.0" 0.0021
Jul 24 14:35:36 dhcp207-210 proxy-server ERROR with Object server 127.0.0.1:6010/test re: Trying to GET /v1/AUTH_test/container/dir-l0: #012Traceback (most recent call last):#012  File "/usr/lib/python2.6/site-packages/swift/proxy/controllers/base.py", line 795, in GETorHEAD_base#012    possible_source = conn.getresponse()#012  File "/usr/lib/python2.6/site-packages/swift/common/bufferedhttp.py", line 102, in getresponse#012    response = HTTPConnection.getresponse(self)#012  File "/usr/lib64/python2.6/httplib.py", line 990, in getresponse#012    response.begin()#012  File "/usr/lib64/python2.6/httplib.py", line 391, in begin#012    version, status, reason = self._read_status()#012  File "/usr/lib64/python2.6/httplib.py", line 355, in _read_status#012    raise BadStatusLine(line)#012BadStatusLine (txn: txce7c188872f743a08ba6c1651f0835ce) (client_ip: 10.65.193.181)
Jul 24 14:35:36 dhcp207-210 proxy-server Handoff requested (1) (txn: txce7c188872f743a08ba6c1651f0835ce) (client_ip: 10.65.193.181)
Jul 24 14:35:36 dhcp207-210 account-server 127.0.0.1 - - [24/Jul/2013:09:05:36 +0000] "GET /volume_not_in_ring/0/AUTH_test/container/dir-l0" 400 62 "txce7c188872f743a08ba6c1651f0835ce" "-" "curl/7.29.0" 0.0001 ""


Expected results:

Error Code is fine, but the messaged should be like this "object with '/' suffix are not allowed.However you may wish to use ?path=/subdir/xxx/xxx or ?delimiter=/ options. " 

Additional info:

[root@dhcp207-210 ~]# rpm -qa|grep gluster
gluster-swift-object-1.8.0-6.3.el6rhs.noarch
vdsm-gluster-4.10.2-22.7.el6rhs.noarch
gluster-swift-plugin-1.8.0-2.el6rhs.noarch
glusterfs-geo-replication-3.4.0.12rhs.beta3-1.el6rhs.x86_64
glusterfs-3.4.0.12rhs.beta3-1.el6rhs.x86_64
gluster-swift-1.8.0-6.3.el6rhs.noarch
glusterfs-server-3.4.0.12rhs.beta3-1.el6rhs.x86_64
gluster-swift-proxy-1.8.0-6.3.el6rhs.noarch
gluster-swift-account-1.8.0-6.3.el6rhs.noarch
glusterfs-rdma-3.4.0.12rhs.beta3-1.el6rhs.x86_64
glusterfs-fuse-3.4.0.12rhs.beta3-1.el6rhs.x86_64
gluster-swift-container-1.8.0-6.3.el6rhs.noarch

Comment 2 pushpesh sharma 2013-07-24 13:33:25 UTC
Even the directory is created with 'Content-Type: application/directory' -H 'Content-Length: 0' headers then even the problem is same. Which is not acceptable with 400 bad request. HEAD request to this type of resources are working fine. 

[psharma@dhcp193-181 ~]$ curl -v -X PUT -H 'X-Auth-Token: AUTH_tk44b09617995d4305a19676857a86b86e' -H 'Content-Type: application/directory' -H 'Content-Length: 0' -k http://10.65.207.210:8080/v1/AUTH_test/container/dir-l0
* About to connect() to 10.65.207.210 port 8080 (#0)
*   Trying 10.65.207.210...
* Connected to 10.65.207.210 (10.65.207.210) port 8080 (#0)
> PUT /v1/AUTH_test/container/dir-l0 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 10.65.207.210:8080
> Accept: */*
> X-Auth-Token: AUTH_tk44b09617995d4305a19676857a86b86e
> Content-Type: application/directory
> Content-Length: 0
> 
< HTTP/1.1 201 Created
< Last-Modified: Wed, 24 Jul 2013 13:29:15 GMT
< Content-Length: 0
< Etag: d41d8cd98f00b204e9800998ecf8427e
< Content-Type: text/html; charset=UTF-8
< Date: Wed, 24 Jul 2013 13:29:16 GMT
< 
* Connection #0 to host 10.65.207.210 left intact
[psharma@dhcp193-181 ~]$ curl -v -X GET -H 'X-Auth-Token: AUTH_tk44b09617995d4305a19676857a86b86e' -k http://10.65.207.210:8080/v1/AUTH_test/container/dir-l0
* About to connect() to 10.65.207.210 port 8080 (#0)
*   Trying 10.65.207.210...
* Connected to 10.65.207.210 (10.65.207.210) port 8080 (#0)
> GET /v1/AUTH_test/container/dir-l0 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 10.65.207.210:8080
> Accept: */*
> X-Auth-Token: AUTH_tk44b09617995d4305a19676857a86b86e
> 
< HTTP/1.1 400 Bad Request
< Content-Length: 62
< Content-Type: text/html; charset=UTF-8
< Date: Wed, 24 Jul 2013 13:29:33 GMT
< 
* Connection #0 to host 10.65.207.210 left intact
Invalid path: /volume_not_in_ring/0/AUTH_test/container/dir-l0[psharma@dhcp193-181 ~]$

Comment 3 crisbud@redhat.com 2013-07-29 13:10:24 UTC
I will try to reproduce it myself tomorrow.

Comment 4 crisbud@redhat.com 2013-07-30 13:49:09 UTC
The GET on a sub directory or a directory object created with 'Content-Type: applicatoin/directory' && 'Content-Length: 0' currently not working with G4S. I am looking at your commit to understand how you provided the functionality to PUT such directories. So that can figure out how we can perform GET on such directories.

Luis's change : 
Change-Id: I31038a59699a8e3eeaba902db322218c6400093e

Comment 5 crisbud@redhat.com 2013-08-02 06:58:23 UTC
http://review.gluster.org/#/c/5458/

Posted this patch for review.

Comment 6 crisbud@redhat.com 2013-08-07 08:39:09 UTC
http://review.gluster.org/#/c/5457/

Comment 9 crisbud@redhat.com 2013-08-29 06:12:09 UTC
Changes are merged to upstream master, via http://review.gluster.org/#/c/5511/

Comment 10 Scott Haines 2013-09-23 23:18:59 UTC
Retargeting for 2.1.z U2 (Corbett) release.

Comment 11 crisbud@redhat.com 2013-09-24 06:11:33 UTC
http://review.gluster.org/#/c/5991/

Changes are posted for review to be merged in Grizzly branch.

Comment 12 crisbud@redhat.com 2013-10-01 05:07:53 UTC
The above patch is reviewed but not yet merged to Grizzly. Please let me know if there are any steps to follow for merging it to grizzly ?

Comment 13 crisbud@redhat.com 2013-10-04 10:34:43 UTC
The bug fix patch (http://review.gluster.org/#/c/5991/) will be merged after unit test coverage patch (http://review.gluster.org/#/c/6037/)is merged to master and grizzly.

Comment 14 Luis Pabón 2013-10-22 02:11:31 UTC
http://review.gluster.org/#/c/6037/ Has been committed upstream

Comment 15 crisbud@redhat.com 2013-11-15 06:06:58 UTC
http://review.gluster.org/#/c/5511/

http://review.gluster.org/#/c/6037/ 

Code changes related to above two patches are merged to G4S (master) and then they made it to G4S(HAVANA). Changing the state of the bug on QA.

Comment 16 crisbud@redhat.com 2013-11-15 06:10:15 UTC
It was decided to not put in grizzly anymore.

Comment 17 crisbud@redhat.com 2013-11-15 06:15:51 UTC
Correction.

Comment 18 pushpesh sharma 2013-12-27 07:14:37 UTC
It now returns 200 OK for GET on sub-directory, which is correct response, However GET on a container return 200 OK and list of all content.So OK with the fix if could do following:

1.Document in the user guide that we currently not support listing of sub- directories. 

2. I personally believe this a nice feature to have, If all stakeholders agree I will raise a RFE. 

Steps:
###################################
[root@luigi ~]# curl -v -X PUT -H -k http://10.65.207.210:8080/v1/AUTH_test/container
* About to connect() to 10.65.207.210 port 8080 (#0)
*   Trying 10.65.207.210... No route to host
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host
[root@luigi ~]# curl -v -X PUT -H -k http://localhost:8080/v1/AUTH_test/container
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> PUT /v1/AUTH_test/container HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
> 
< HTTP/1.1 201 Created
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: txa97163f565644d5b9f582-0052bc6acb
< Date: Thu, 26 Dec 2013 17:43:39 GMT
< 
* Connection #0 to host localhost left intact
* Closing connection #0
[root@luigi ~]# curl -v -X PUT -H 'Content-Type: application/directory' -H 'Content-Length: 0' -k http://localhost:8080/v1/AUTH_test/container/dir1
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> PUT /v1/AUTH_test/container/dir1 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
> Content-Type: application/directory
> Content-Length: 0
> 
< HTTP/1.1 201 Created
< Last-Modified: Thu, 26 Dec 2013 17:44:11 GMT
< Content-Length: 0
< Etag: d41d8cd98f00b204e9800998ecf8427e
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: tx48a4022d743c4d469e354-0052bc6aeb
< Date: Thu, 26 Dec 2013 17:44:11 GMT
< 
* Connection #0 to host localhost left intact
* Closing connection #0
[root@luigi ~]# curl -v -X PUT -H 'Content-Type: application/directory' -H 'Content-Length: 0' -k http://localhost:8080/v1/AUTH_test/container/dir2
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> PUT /v1/AUTH_test/container/dir2 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
> Content-Type: application/directory
> Content-Length: 0
> 
< HTTP/1.1 201 Created
< Last-Modified: Thu, 26 Dec 2013 17:44:23 GMT
< Content-Length: 0
< Etag: d41d8cd98f00b204e9800998ecf8427e
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: txc8d0e2bc92a54618b0f92-0052bc6af7
< Date: Thu, 26 Dec 2013 17:44:23 GMT
< 
* Connection #0 to host localhost left intact
* Closing connection #0
[root@luigi ~]# curl -v -X PUT -T install.log -k http://localhost:8080/v1/AUTH_test/container/dir1/install1.txt
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> PUT /v1/AUTH_test/container/dir1/install1.txt HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
> Content-Length: 30373
> Expect: 100-continue
> 
< HTTP/1.1 100 Continue
< HTTP/1.1 201 Created
< Last-Modified: Thu, 26 Dec 2013 17:44:41 GMT
< Content-Length: 0
< Etag: de52b12183a6d501e83a35ef5d70874a
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: tx807edbfe0bdc4deb89a6d-0052bc6b09
< Date: Thu, 26 Dec 2013 17:44:41 GMT
< 
* Connection #0 to host localhost left intact
* Closing connection #0
[root@luigi ~]# curl -v -X PUT -T install.log -k http://localhost:8080/v1/AUTH_test/container/dir1/install2.txt
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> PUT /v1/AUTH_test/container/dir1/install2.txt HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
> Content-Length: 30373
> Expect: 100-continue
> 
< HTTP/1.1 100 Continue
< HTTP/1.1 201 Created
< Last-Modified: Thu, 26 Dec 2013 17:44:48 GMT
< Content-Length: 0
< Etag: de52b12183a6d501e83a35ef5d70874a
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: txaa9a2abe3e934ae3aa791-0052bc6b10
< Date: Thu, 26 Dec 2013 17:44:48 GMT
< 
* Connection #0 to host localhost left intact
* Closing connection #0
[root@luigi ~]# curl -v -X HEAD -k http://localhost:8080/v1/AUTH_test/container
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> HEAD /v1/AUTH_test/container HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
> 
< HTTP/1.1 204 No Content
< Content-Length: 0
< X-Container-Object-Count: 0
< Accept-Ranges: bytes
< X-Timestamp: 1
< X-Container-Bytes-Used: 0
< Content-Type: text/plain; charset=utf-8
< X-Trans-Id: tx7274f0cab4364de5ad13a-0052bc6b2f
< Date: Thu, 26 Dec 2013 17:45:19 GMT
< 
* Connection #0 to host localhost left intact
* Closing connection #0
[root@luigi ~]# curl -v -X GET -k http://localhost:8080/v1/AUTH_test/container
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /v1/AUTH_test/container HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Length: 46
< X-Container-Object-Count: 0
< Accept-Ranges: bytes
< X-Timestamp: 1
< X-Container-Bytes-Used: 0
< Content-Type: text/plain; charset=utf-8
< X-Trans-Id: txa4407dd4cbce4d64bff1d-0052bc6b3a
< Date: Thu, 26 Dec 2013 17:45:30 GMT
< 
dir1
dir1/install1.txt
dir1/install2.txt
dir2
* Connection #0 to host localhost left intact
* Closing connection #0
[root@luigi ~]# curl -v -X GET -k http://localhost:8080/v1/AUTH_test/container/dir1
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /v1/AUTH_test/container/dir1 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.3.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Length: 0
< Accept-Ranges: bytes
< Last-Modified: Thu, 26 Dec 2013 17:44:11 GMT
< Etag: d41d8cd98f00b204e9800998ecf8427e
< X-Timestamp: 1388079851.42453
< Content-Type: application/directory
< X-Trans-Id: txe93cb06e47674a2b80316-0052bc6b4e
< Date: Thu, 26 Dec 2013 17:45:50 GMT
< 
* Connection #0 to host localhost left intact
* Closing connection #0
[root@luigi ~]#

Comment 19 crisbud@redhat.com 2013-12-27 07:26:06 UTC
Was there a upstream bug on not listing sub directories ?

Comment 20 crisbud@redhat.com 2013-12-27 07:28:21 UTC
If there is no upstream bug for not listing sub directories then please file one for the same. Lets decide on that bug if we want to fix that in this release or later release, document and move ahead for corbett. 

And can you please update/complete your verification status on this bug ?

Comment 21 crisbud@redhat.com 2013-12-27 08:55:28 UTC
upstream bug or RFE I meant.

Comment 22 pushpesh sharma 2013-12-27 09:34:31 UTC
Upstream RFE(Launchpad Blueprint)
https://blueprints.launchpad.net/gluster-swift/+spec/sub-directory-listing

Documentation BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1046888

Marking this BZ as verified as it correctly returns the response code with no errors.

Comment 23 Pavithra 2014-01-06 07:30:59 UTC
Hi Chetan,

Please verify the doc text for technical accuracy and sign off.

Comment 24 crisbud@redhat.com 2014-01-06 08:49:46 UTC
perfect as discussed. Good to go. Thanks.

Comment 26 errata-xmlrpc 2014-02-25 07:33:42 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.

http://rhn.redhat.com/errata/RHEA-2014-0208.html


Note You need to log in before you can comment on or make changes to this bug.