glance image-list gets HTTP 500 error
Hi, I am wondering why I cannot get glance to work. When I do glance --debug image-list
I get this output:
[root@ost-mgmt-rhel7-001 ~]# glance --debug image-list
curl -i -X GET -H 'User-Agent: python-glanceclient' -H 'Content-Type: application/octet-stream' -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'X-Auth-Token: {SHA1}xxxxxxxxxxxx' --cert None --key None https://ost-el7.example.com:9292/v1/images/detail?sort_key=name&sort_dir=asc&limit=20
Request returned failure status 500.
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/glanceclient/shell.py", line 602, in main
args.func(client, args)
File "/usr/lib/python2.7/site-packages/glanceclient/v1/shell.py", line 107, in do_image_list
utils.print_list(images, columns)
File "/usr/lib/python2.7/site-packages/glanceclient/common/utils.py", line 121, in print_list
for o in objs:
File "/usr/lib/python2.7/site-packages/glanceclient/v1/images.py", line 196, in paginate
images, resp = self._list(url, "images")
File "/usr/lib/python2.7/site-packages/glanceclient/v1/images.py", line 62, in _list
resp, body = self.client.get(url)
File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 253, in get
return self._request('GET', url, **kwargs)
File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 221, in _request
raise exc.from_response(resp, resp.content)
HTTPInternalServerError: HTTPInternalServerError (HTTP 500)
HTTPInternalServerError (HTTP 500)
I see --cert None --key None
in the debug output so I was thinking that I need to set these values:
ca_file = None (StrOpt) CA certificate file to use to verify connecting clients. cert_file = None (StrOpt) Certificate file to use when starting API server securely. key_file = None (StrOpt) Private key file to use when starting API server securely.
But I have no idea what to set them too.
Here's an Update: When I execute the curl that is described in the debug output ...
curl -i -X GET \
-H 'User-Agent: python-glanceclient' \
-H 'Content-Type: application/octet-stream' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Accept: */*' \
-H 'X-Auth-Token: {SHA1}f61557e61a6f594ab6613c79a1e092b78fe46835' \
--cert None \
--key None \
'https://ost-el7.example.com:9292/v1/images/detail?sort_key=name&sort_dir=asc&limit=20' ; echo
... I get this output ...
HTTP/1.1 401 Unauthorized
Content-Length: 358
Content-Type: text/html; charset=UTF-8
Www-Authenticate: Keystone uri='https://ost-el7.example.com:5000/v2.0'
Date: Mon, 02 Mar 2015 20:35:05 GMT
<html>
<head>
<title>401 Unauthorized</title>
</head>
<body>
<h1>401 Unauthorized</h1>
This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.<br /><br />
</body>
</html>
Update:
Update:
Thanks Haneef, I do not thank glance is working. Here's how I checked.
[root@ost-mgmt-rhel7-001 ~]# cat test_glance.sh
#!/bin/sh
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=xxxxxxxxxxxx
export OS_AUTH_URL=https://ost-el7.example.com:35357/v2.0
token=`keystone token-get | grep " id " | cut -d \| -f3 | sed -e's/ //g'`
#glance --debug image-list
echo "token is [$token]"
curl -ki -X GET \
-H 'User-Agent: python-glanceclient' \
-H 'Content-Type: application/octet-stream' \
-H 'Accept-Encoding ...
You can't take the token from the curl command shown in debug. That is mangled token and not the real token. Real token won't have {SHA1}