Invalid Bucket Name Error with Ceph and Swift API

Bug #1520966 reported by Jerome Bell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Won't Fix
Medium
Radoslaw Zarzynski

Bug Description

I installed Mirantis OpenStack 7.0 with

1 Controller/Ceph Node
1 Compute/Ceph Node
1 Ceph Node
x3 replication factor

I sourced a file and executed

swift --debug list

and got the following output

DEBUG:keystoneclient.auth.identity.v2:Making authentication request to http://192.168.2.8:5000/v2.0/tokens
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.2.8
DEBUG:requests.packages.urllib3.connectionpool:"POST /v2.0/tokens HTTP/1.1" 200 4665
DEBUG:iso8601.iso8601:Parsed 2015-11-29T18:59:57Z into {'tz_sign': None, 'second_fraction': None, 'hour': u'18', 'daydash': u'29', 'tz_hour': None, 'month': None, 'timezone': u'Z', 'second': u'57', 'tz_minute': None, 'year': u'2015', 'separator': u'T', 'monthdash': u'11', 'day': None, 'minute': u'59'} with default timezone <iso8601.iso8601.Utc object at 0x02F86F70>
DEBUG:iso8601.iso8601:Got u'2015' for 'year' with default None
DEBUG:iso8601.iso8601:Got u'11' for 'monthdash' with default 1
DEBUG:iso8601.iso8601:Got 11 for 'month' with default 11
DEBUG:iso8601.iso8601:Got u'29' for 'daydash' with default 1
DEBUG:iso8601.iso8601:Got 29 for 'day' with default 29
DEBUG:iso8601.iso8601:Got u'18' for 'hour' with default None
DEBUG:iso8601.iso8601:Got u'59' for 'minute' with default None
DEBUG:iso8601.iso8601:Got u'57' for 'second' with default None
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.2.8
DEBUG:requests.packages.urllib3.connectionpool:"GET /v1/AUTH_42a6c9d5a69a4bf7a0279c329a50dbde?format=json HTTP/1.1" 400 83
INFO:swiftclient:REQ: curl -i http://192.168.2.8:8080/v1/AUTH_42a6c9d5a69a4bf7a0279c329a50dbde?format=json -X GET -H "X-Auth-Token: 37bc580e8d4044438e93cbbd9f98e9e5"
INFO:swiftclient:RESP STATUS: 400 Bad Request
INFO:swiftclient:RESP HEADERS: [('date', 'Sun, 29 Nov 2015 17:59:57 GMT'), ('accept-ranges', 'bytes'), ('content-type', 'application/xml'), ('content-length', '83'), ('server', 'Apache')]
INFO:swiftclient:RESP BODY: <?xml version="1.0" encoding="UTF-8"?><Error><Code>InvalidBucketName</Code></Error>
ERROR:swiftclient:Account GET failed: http://192.168.2.8:8080/v1/AUTH_42a6c9d5a69a4bf7a0279c329a50dbde?format=json 400 Bad Request [first 60 chars of response] <?xml version="1.0" encoding="UTF-8"?><Error><Code>InvalidBu
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\swiftclient\client.py", line 1302, in _retry
    rv = func(self.url, self.token, *args, **kwargs)
  File "C:\Python27\lib\site-packages\swiftclient\client.py", line 549, in get_account
    http_response_content=body)
ClientException: Account GET failed: http://192.168.2.8:8080/v1/AUTH_42a6c9d5a69a4bf7a0279c329a50dbde?format=json 400 Bad Request [first 60 chars of response] <?xml version="1.0" encoding="UTF-8"?><Error><Code>InvalidBu
Account GET failed: http://192.168.2.8:8080/v1/AUTH_42a6c9d5a69a4bf7a0279c329a50dbde?format=json 400 Bad Request [first 60 chars of response] <?xml version="1.0" encoding="UTF-8"?><Error><Code>InvalidBu

Thus, it seems like I have an issue with an invalid bucket name. Given that I am simply trying to list the objects in the account I don't see how I could have an issue with a bucket name. Am I missing something here? Any help is appreciated. Thanks!

Changed in mos:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → MOS Ceph (mos-ceph)
milestone: none → 8.0
Revision history for this message
Radoslaw Zarzynski (rzarzynski) wrote :

It looks that StorageURL is wrongly configured:

INFO:swiftclient:REQ: curl -i http://192.168.2.8:8080/v1/AUTH_42a6c9d5a69a4bf7a0279c329a50dbde?format=json -X GET -H "X-Auth-Token: 37bc580e8d4044438e93cbbd9f98e9e5"

radosgw doesn't support the full URL schema from Swift.
In order to list an account the supplied URL should look like
the following one:

http://192.168.2.8:8080/swift/v1

Account ID will be extracted by radosgw basing only on token
provided in X-Auth-Token HTTP header, not from the URL itself.

Changed in mos:
assignee: MOS Ceph (mos-ceph) → Radoslaw Zarzynski (rzarzynski)
Revision history for this message
Jerome Bell (jeromebell) wrote :

Is there a workaround for this issue?

Revision history for this message
Radoslaw Zarzynski (rzarzynski) wrote :

Pull request [1] with full support for Swift's URL schema (including account
identifier extracted from URL, not only from an auth token) has been sent.

However, it won't be available in MOS 8.0, so the appropriate status has
been changed to "Won't fix".

As a workaround skipping the account part from endpoint URL could be
employed. For example, those are URLs used in Keystone as endpoints
for radosgw as a Swift API provider:

root@node-1:~# keystone endpoint-list | grep a80b73bb22024bea81dd4ea6674dcddb
/usr/lib/python2.7/dist-packages/keystoneclient/shell.py:65: DeprecationWarning: The keystone CLI is deprecated in favor of python-openstackclient. For a Python library, continue using python-keystoneclient.
  'python-keystoneclient.', DeprecationWarning)
| 6510840a15004c73b71cb22b20b5d4c3 | RegionOne | https://10.109.3.3:8080/swift/v1 | http://192.168.0.2:8080/swift/v1 | http://192.168.0.2:8080/swift/v1 | a80b73bb22024bea81dd4ea6674dcddb |

As can be seen the tenant/account part (denoted in Keystone by
"KEY_$(tenant_id)s") is absent.

[1] https://github.com/ceph/ceph/pull/7296

Changed in mos:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.