glance add problem:NotAuthorized: None

Asked by keller412 on 2012-03-22

i want to add image use glance with this command:"glance add -A 39a3f95c-bbc0-4b2c-a0b3-e390c81aed38 name="tty-kernel" is_public=true container_format=aki disk_format=aki < stackimages/aki-tty/image
"
get this result:
Failed to add image. Got error:
Internal Server error: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 113, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1053, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1022, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 110, in __call__
    response = self.process_request(req)
  File "/usr/lib/python2.7/dist-packages/glance/common/context.py", line 104, in process_request
    raise exception.NotAuthorized()
NotAuthorized: None

Note: Your image metadata may still be in the registry, but the image's status will likely be 'killed'.

how can i resolve this problem,thanks

i have use command"sudo keystone-manage token list"to list the token
token user expiration tenant
-------------------------------------------------------------------------------
11121314151617181920 1 2015-02-05 00:00:00 2
6325f6b8-d532-4805-949d-5cdab5ebd835 1 2012-03-20 18:31:04 None
79306847-8c1e-444c-b55e-880dbeb24abd 1 2012-03-21 23:23:52 None
39a3f95c-bbc0-4b2c-a0b3-e390c81aed38 1 2012-03-23 01:16:38 None

find tenant is NONE,is this the problem?

Question information

Language:
English Edit question
Status:
Answered
For:
Glance Edit question
Assignee:
No assignee Edit question
Last query:
2012-03-23
Last reply:
2012-03-30
Jay Pipes (jaypipes) said : #1

What version of Keystone and Glance are you using? Thanks!

keller412 (keller412) said : #2

glance 2011.3.1 dev
keystone 2011.3.1

keller412 (keller412) said : #3

wanglu@ubuntu:~$ dpkg -l | grep glance
ii glance 2011.3.1~20120117~1549-0mit1~22.gbp5e7c88 OpenStack Image Registry and Delivery Service - Daemons
ii python-glance 2011.3.1~20120117~1549-0mit1~22.gbp5e7c88 OpenStack Image Registry and Delivery Service - Python library
wanglu@ubuntu:~$ dpkg -l | grep keystone
ii keystone 2011.3.1+20120119~0000-0mit1~14.gbp0e5503 Proposed OpenStack identity service - Daemons
ii python-keystone 2011.3.1+20120119~0000-0mit1~14.gbp0e5503 Proposed OpenStack identity service - Python library

yong sheng gong (gongysh) said : #4

For current trunk version.

check if your keystone configuration is using keystone as auth:
you need in your glance-api.conf
[paste_deploy]
flavor = keystone
and check glance-api-paste.ini to make sure the right credentials are used:
[filter:authtoken]
paste.filter_factory = keystone.middleware.auth_token:filter_factory
service_protocol = http
service_host = 127.0.0.1
service_port = 5000
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = http
auth_uri = http://127.0.0.1:5000/
admin_tenant_name = admin
admin_user = admin
admin_password = password

also check the glance-registry's configurations.

#for keystone client
export SERVICE_ENDPOINT=http://localhost:35357/v2.0
export SERVICE_TOKEN=ADMIN
# 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

to run glance add

antiError (zhonghuabaima0913) said : #5

Dear yong,
   i did it under you introduction,but glance service cannot start also.

Who can help me?

Can you help with this problem?

Provide an answer of your own, or ask keller412 for more information if necessary.

To post a message you must log in.