Hey,
I am trying to use libcloud to work with various cloud providers object
storage backend. I have been successfully able to get it working with
Amazon but I've installed two different installations of openstack and it
does not appear to work. My first installation I followed the SAIO guide,
http://docs.openstack.org/developer/swift/development_saio.html this one to
be exact. I am successfully able to connect to it, list, upload, and
download objects from another computer using curl and the swift client.
Whenever I try and connect via libcloud though I get a malformed error
response. This instance uses version 1 of the authentication. I set up
another installation but this time a full installation, following the
openstack documenations, on three servers using keystone for
authentication. Again I am able to successfully connect using curl and
swift client but libcloud I am not. It's quite possible I am doing
something wrong and I've asked in the IRC channel quite a bit over the past
week but that channel seems to be quite dead. I did find that another user
is having this problem and he filed a bug but so far nobody has done
anything to fix it. The bug is located here,
https://issues.apache.org/jira/browse/LIBCLOUD-542 .
So when I run my test script this is the error I'm getting,
[root@bruenor python_scripts]# python pyCloud.py
Traceback (most recent call last):
File "pyCloud.py", line 84, in <module>
driver_os.create_container("python")
File
"/usr/lib/python2.7/site-packages/libcloud/storage/drivers/cloudfiles.py",
line 325, in create_container
'/%s' % (container_name_encoded), method='PUT')
File
"/usr/lib/python2.7/site-packages/libcloud/storage/drivers/cloudfiles.py",
line 181, in request
raw=raw)
File "/usr/lib/python2.7/site-packages/libcloud/common/openstack.py",
line 575, in request
return super(OpenStackBaseConnection, self).request(**kwargs)
File "/usr/lib/python2.7/site-packages/libcloud/common/base.py", line
596, in request
action = self.morph_action_hook(action)
File "/usr/lib/python2.7/site-packages/libcloud/common/openstack.py",
line 571, in morph_action_hook
self._populate_hosts_and_request_paths()
File "/usr/lib/python2.7/site-packages/libcloud/common/openstack.py",
line 600, in _populate_hosts_and_request_paths
osa.authenticate() # may throw InvalidCreds
File "/usr/lib/python2.7/site-packages/libcloud/common/openstack.py",
line 155, in authenticate
return self.authenticate_2_0_with_apikey()
File "/usr/lib/python2.7/site-packages/libcloud/common/openstack.py",
line 240, in authenticate_2_0_with_apikey
return self.authenticate_2_0_with_body(reqbody)
File "/usr/lib/python2.7/site-packages/libcloud/common/openstack.py",
line 264, in authenticate_2_0_with_body
driver=self.driver)
libcloud.common.types.MalformedResponseError: <MalformedResponseException
in None 'Malformed response'>: 'code: 400 body: {"error": {"message":
"Expecting to find passwordCredentials in auth. The server could not comply
with the request since it is either malformed or otherwise incorrect. The
client is assumed to be in error.", "code": 400, "title": "Bad Request"}}'
Now when I connect to this instance using the swift client I source this
file for authentication,
export OS_USERNAME=admin
export OS_PASSWORD=password
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://172.16.103.90:35357/v2.0
I have also set LIBCLOUD_DEBUG in my bashrc and here is the output for that
for my request
# -------- begin 38136000 request ----------
curl -i -X POST -H 'Content-Length: 92' -H 'Accept-Encoding: gzip,deflate'
-H 'X-LC-Request-ID: 38136000' -H 'Accept: application/json' -H
'User-Agent: libcloud/0.14.1 ' -H 'Host: 172.16.103.90:35357' -H
'Content-Type: application/json; charset=UTF-8' --data-binary '{"auth":
{"RAX-KSKEY:apiKeyCredentials": {"username": "admin:admin", "apiKey":
"password"}}}' --compress http://172.16.103.90:35357/v2.0
# -------- begin 38136000:38547400 response ----------
HTTP/1.1 400 Bad Request
Date: Tue, 20 May 2014 13:28:52 GMT
Content-Type: application/json
Content-Length: 121
Vary: X-Auth-Token
X-Distribution: Ubuntu
{"error": {"message": "get_version_v2() got an unexpected keyword argument
'auth'", "code": 400, "title": "Bad Request"}}
# -------- end 38136000:38547400 response ----------
# -------- begin 18843768 request ----------
curl -i -X POST -H 'Content-Length: 92' -H 'Accept-Encoding: gzip,deflate'
-H 'X-LC-Request-ID: 18843768' -H 'Accept: application/json' -H
'User-Agent: libcloud/0.14.1 ' -H 'Host: 172.16.103.90:5000' -H
'Content-Type: application/json; charset=UTF-8' --data-binary '{"auth":
{"RAX-KSKEY:apiKeyCredentials": {"username": "admin:admin", "apiKey":
"password"}}}' --compress http://172.16.103.90:5000/v2.0/tokens
# -------- begin 18843768:19255168 response ----------
HTTP/1.1 400 Bad Request
Date: Tue, 20 May 2014 13:29:09 GMT
Content-Type: application/json
Content-Length: 245
Vary: X-Auth-Token
X-Distribution: Ubuntu
{"error": {"message": "Expecting to find passwordCredentials in auth. The
server could not comply with the request since it is either malformed or
otherwise incorrect. The client is assumed to be in error.", "code": 400,
"title": "Bad Request"}}
# -------- end 18843768:19255168 response ----------
Also here is the script I'm using to connect, create a container, and list
the containers to check to see if I'm doing something wrong.
http://paste.fedoraproject.org/103410/59383214
Thanks for the help!
Shade