glance image upload fails during installation

Asked by Sumit Sengupta on 2012-04-09

When I install openstack including glance using devstack on RHEL6, I get following error. It looks like the auth-token from keystone which glance uses as its option has some issues. Any idea ?

ERROR: @devstack.image.uploader : Installing 'http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz' failed due to: None
Command: glance -A 03fbad35089b4f5684667b237421f76e details
Exit code: 1
Stdout: 'Failed to show details. Got error:\nAn object with the specified identifier was not found.\nDetails: 404 Not Found\n\nThe resource could not be found.\n\n \n'
Stderr: ''
Traceback (most recent call last):
  File "/home/sumitsen/DevstackPy/devstack/image/uploader.py", line 372, in install
    name = Image(uri, token).install()
  File "/home/sumitsen/DevstackPy/devstack/image/uploader.py", line 245, in install
    if self._registry.has_image(name):
  File "/home/sumitsen/DevstackPy/devstack/image/uploader.py", line 296, in has_image
    return image in self.get_image_names()
  File "/home/sumitsen/DevstackPy/devstack/image/uploader.py", line 299, in get_image_names
    self._load()
  File "/home/sumitsen/DevstackPy/devstack/image/uploader.py", line 289, in _load
    res = utils.execute_template(cmd, params=params)
  File "/home/sumitsen/DevstackPy/devstack/utils.py", line 130, in execute_template
    **kargs)
  File "/home/sumitsen/DevstackPy/devstack/shell.py", line 183, in execute
    stderr=stderr, cmd=str_cmd)
ProcessExecutionError: None
Command: glance -A 03fbad35089b4f5684667b237421f76e details
Exit code: 1
Stdout: 'Failed to show details. Got error:\nAn object with the specified identifier was not found.\nDetails: 404 Not Found\n\nThe resource could not be found.\n\n \n'
Stderr: ''

Question information

Language:
English Edit question
Status:
Solved
For:
Glance Edit question
Assignee:
No assignee Edit question
Solved by:
Sumit Sengupta
Solved:
2012-04-13
Last query:
2012-04-13
Last reply:
2012-04-13
Jay Pipes (jaypipes) said : #1

If you do:

curl -v -H "X-Auth-User: <SERVICE_USERNAME>" -H "X-Auth-Key: <SERVICE_PASSWORD>" http://<KEYSTONE_HOST>:35357/v2.0/tokens/03fbad35089b4f5684667b237421f76e

and replace with appropriate service user/password credentials, what is the response?

-jay

Michael Lin (michael-lin) said : #2

I had the same question on ubuntu 11.10 and tried Jay's method to solve question, but it doesn't work :<

Any methods can solve this question, or it is a bug?

antiError (zhonghuabaima0913) said : #3

i also have this question.

antiError (zhonghuabaima0913) said : #4

i also have this question.

Sumit Sengupta (sumit-sngpt) said : #5

Its not able to authenticate now. This has started throwing error since day before yesterday. Before it was working fine. This on RHEL6.2 machine.

[sumitsen@sorrygate-dr DevstackPy]$ curl -v -H "X-Auth-User: admin" -H "X-Auth-Key: openstack" http://localhost:35357/v2.0/tokens/3afca52edcb247f9b2bfc8bd524cb0f2
* About to connect() to localhost port 35357 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 35357 (#0)
> GET /v2.0/tokens/3afca52edcb247f9b2bfc8bd524cb0f2 HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
> Host: localhost:35357
> Accept: */*
> X-Auth-User: admin
> X-Auth-Key: openstack
>
< HTTP/1.1 401 Not Authorized
< Content-Type: application/json
< Vary: X-Auth-Token
< Content-Length: 116
< Date: Wed, 11 Apr 2012 11:12:20 GMT
<
* Connection #0 to host localhost left intact
* Closing connection #0
{"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Not Authorized"}}

Jay Pipes (jaypipes) said : #6

Hi Sumit,

What does this return? Please pastebin it. Thanks!

curl -v -X POST -H "X-Auth-User: <SERVICE_USERNAME>" -H "X-Auth-Key: <SERVICE_PASSWORD>" http://<KEYSTONE_HOST>:5000/v2.0/tokens

yong sheng gong (gongysh) said : #7

To verify token by head option, the command should be:

#curl -H "X-Auth-Token:ADMIN" http://localhost:35357/v2.0/tokens/7e1d790f2e844b8296f9216928d3d2a7

where ADMIN is the admin_token defined in keystone.conf:
[DEFAULT]
#bind_host = 0.0.0.0
public_port = 5000
admin_port = 35357
admin_token = ADMIN

7e1d790f2e844b8296f9216928d3d2a7 is one we got when we auth a username and password.

Document is at http://keystone.openstack.org/api_curl_examples.html#id1

About run glance details, please set env:
#for keystone client

export SERVICE_ENDPOINT=http://localhost:35357/v2.0
export SERVICE_TOKEN=ADMIN

#for nova client
export NOVA_AUTH_STRATEGY=keystone
export NOVA_USERNAME=admin
export NOVA_PASSWORD=password
export NOVA_PROJECT_ID=admin
export NOVA_URL=http://localhost:35357/v2.0
export NOVA_VERSION=1.1

#for glance client
export OS_AUTH_USER=admin
export OS_AUTH_KEY=password
export OS_AUTH_TENANT=admin
export OS_AUTH_URL=http://localhost:35357/v2.0
export OS_AUTH_STRATEGY=keystone

and also make sure your glance is using keystone for auth.
in glance-api.conf and glance-registry.conf:
[paste_deploy]
flavor = keystone

Sumit Sengupta (sumit-sngpt) said : #8

That's strange that when I restarted my machine everything started working fine including the glance error I stated.

Thanks all for your help!