glance index and report "Failed to show index. Got error: The request returned 500 Internal Server Error "

Asked by Figo Xiao on 2012-06-05

This is the question of "glance index" command
root@ubuntu-xiaofei:~# export SERVICE_TOKEN=admin
root@ubuntu-xiaofei:~# export OS_TENANT_NAME=admin
root@ubuntu-xiaofei:~# export OS_USERNAME=admin
root@ubuntu-xiaofei:~# export OS_PASSWORD=admin
root@ubuntu-xiaofei:~# export OS_AUTH_URL="http://localhost:5000/v2.0/"
root@ubuntu-xiaofei:~# export SERVICE_ENDPOINT=http://localhost:35357/v2.0
root@ubuntu-xiaofei:~# glance index
Failed to show index. Got error:
The request returned 500 Internal Server Error

The response body:
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 210, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 279, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1086, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1055, 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 210, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/glance/common/wsgi.py", line 276, in __call__
    response = self.process_request(req)
  File "/usr/lib/python2.7/dist-packages/glance/common/context.py", line 112, in process_request
    raise exception.NotAuthenticated()
NotAuthenticated: You are not authenticated.
_________________________________________________________________________________________

The fallowing is /var/log/glance/registry.log:

2012-06-05 08:33:02 733 WARNING [glance.registry.db.api] SQL connection failed. 10 attempts left.
2012-06-05 08:33:03 733 WARNING [glance.registry.db.api] SQL connection failed. 9 attempts left.
2012-06-05 08:33:05 733 INFO [sqlalchemy.engine.base.Engine] SELECT images.created_at AS images_created_at, images.updated_at AS images_updated_at, images.deleted_at AS images_deleted_at, images.deleted AS images_deleted, images.id AS images_id, images.name AS images_name, images.disk_format AS images_disk_format, images.container_format AS images_container_format, images.size AS images_size, images.status AS images_status, images.is_public AS images_is_public, images.location AS images_location, images.checksum AS images_checksum, images.min_disk AS images_min_disk, images.min_ram AS images_min_ram, images.owner AS images_owner, images.protected AS images_protected
FROM images
 LIMIT %s
2012-06-05 08:33:05 733 INFO [sqlalchemy.engine.base.Engine] (1,)
2012-06-05 08:33:05 733 INFO [sqlalchemy.engine.base.Engine] SELECT image_properties.created_at AS image_properties_created_at, image_properties.updated_at AS image_properties_updated_at, image_properties.deleted_at AS image_properties_deleted_at, image_properties.deleted AS image_properties_deleted, image_properties.id AS image_properties_id, image_properties.image_id AS image_properties_image_id, image_properties.name AS image_properties_name, image_properties.value AS image_properties_value
FROM image_properties
 LIMIT %s
2012-06-05 08:33:05 733 INFO [sqlalchemy.engine.base.Engine] (1,)
2012-06-05 08:33:05 733 INFO [sqlalchemy.engine.base.Engine] SELECT image_members.created_at AS image_members_created_at, image_members.updated_at AS image_members_updated_at, image_members.deleted_at AS image_members_deleted_at, image_members.deleted AS image_members_deleted, image_members.id AS image_members_id, image_members.image_id AS image_members_image_id, image_members.member AS image_members_member, image_members.can_share AS image_members_can_share
FROM image_members
 LIMIT %s
2012-06-05 08:33:05 733 INFO [sqlalchemy.engine.base.Engine] (1,)
2012-06-05 08:33:05 733 INFO [keystone.middleware.auth_token] Starting keystone auth_token middleware
2012-06-05 08:33:05 733 INFO [eventlet.wsgi.server] Starting single process server
2012-06-05 14:53:54 25596 INFO [glance.registry.db.migration] 升级 mysql://glancedbadmin:sbsmsbsm@10.10.11.134/glance 到版本 13
2012-06-05 14:54:13 25678 INFO [sqlalchemy.engine.base.Engine] SELECT images.created_at AS images_created_at, images.updated_at AS images_updated_at, images.deleted_at AS images_deleted_at, images.deleted AS images_deleted, images.id AS images_id, images.name AS images_name, images.disk_format AS images_disk_format, images.container_format AS images_container_format, images.size AS images_size, images.status AS images_status, images.is_public AS images_is_public, images.location AS images_location, images.checksum AS images_checksum, images.min_disk AS images_min_disk, images.min_ram AS images_min_ram, images.owner AS images_owner, images.protected AS images_protected
FROM images
 LIMIT %s
2012-06-05 14:54:13 25678 INFO [sqlalchemy.engine.base.Engine] (1,)
2012-06-05 14:54:13 25678 INFO [sqlalchemy.engine.base.Engine] SELECT image_properties.created_at AS image_properties_created_at, image_properties.updated_at AS image_properties_updated_at, image_properties.deleted_at AS image_properties_deleted_at, image_properties.deleted AS image_properties_deleted, image_properties.id AS image_properties_id, image_properties.image_id AS image_properties_image_id, image_properties.name AS image_properties_name, image_properties.value AS image_properties_value
FROM image_properties
 LIMIT %s
2012-06-05 14:54:13 25678 INFO [sqlalchemy.engine.base.Engine] (1,)
2012-06-05 14:54:13 25678 INFO [sqlalchemy.engine.base.Engine] SELECT image_members.created_at AS image_members_created_at, image_members.updated_at AS image_members_updated_at, image_members.deleted_at AS image_members_deleted_at, image_members.deleted AS image_members_deleted, image_members.id AS image_members_id, image_members.image_id AS image_members_image_id, image_members.member AS image_members_member, image_members.can_share AS image_members_can_share
FROM image_members
 LIMIT %s
2012-06-05 14:54:13 25678 INFO [sqlalchemy.engine.base.Engine] (1,)
2012-06-05 14:54:13 25678 INFO [keystone.middleware.auth_token] Starting keystone auth_token middleware
2012-06-05 14:54:13 25678 INFO [eventlet.wsgi.server] Starting single process server

The fallowing is /var/log/glance/api.log

2012-06-05 08:33:02 732 INFO [eventlet.wsgi.server] Starting single process server
2012-06-05 14:54:07 25604 INFO [eventlet.wsgi.server] Starting single process server

________________________________
I need your help!
Thank you!

Question information

Language:
English Edit question
Status:
Solved
For:
Glance Edit question
Assignee:
No assignee Edit question
Solved by:
Figo Xiao
Solved:
2012-06-06
Last query:
2012-06-06
Last reply:
Figo Xiao (xyfigo) said : #1

my /etc/glance/glance-api-paste.ini , /etc/glance/glance-scrubber.conf ,/etc/glance/registry-paste.ini config are wrong.
Reference to “OpenStack Install and Deploy Manmual” at Page21!

Xingchao Yu (yuxcer) said : #2

Can you describe exactly how do you solve this problem?Cause I suffer from this error too .

Patrick Tierney (patrickt333) said : #3

+1, please describe the fix, I have been through the walk-thru 3 or 4 times and continue to get the same error.

Xingchao Yu (yuxcer) said : #4

I have solve this problem, Patrick, You could paste your glance log and your glance version, maybe I could give some help.

isador999 (jeanbapt37) said : #5

I know, lot of things has changed in Openstack, but actually for Havana I have the same error.
Any glance commands display "Error 500"
Can you describe how do you solve the problem please ?