Ask Your Question
1

401 on "glance image-list"

asked 2013-05-18 01:47:46 -0600

JakeWarner gravatar image

updated 2013-05-18 01:51:23 -0600

Hello all,

When running 'glance image-list', I get a 401. This issue only appears about 48 hours after my cloud is up and running.

[root@controller ~]# glance image-list
Request returned failure status.
Invalid OpenStack Identity credentials.

With debug:

[root@controller ~]# glance --debug image-list
curl -i -X GET -H 'X-Auth-Token: <stripped token for sake of readability>' -H 'Content-Type: application/json' -H 'User-Agent: python-glanceclient' http://192.168.1.100:9292/v1/images/detail?sort_key=name&sort_dir=asc&limit=20

HTTP/1.1 401 Unauthorized
date: Sat, 18 May 2013 06:38:38 GMT
content-length: 253
content-type: text/plain; charset=UTF-8

401 Unauthorized

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.



Request returned failure status.
Invalid OpenStack Identity credentials.

With debug enabled in /etc/glance/glance.conf, the log shows:

[root@controller ~]# tail /var/log/glance/api.log
2013-05-18 01:38:38.541 16020 DEBUG glance.api.middleware.version_negotiation [-] Matched version: v1 process_request /usr/lib/python2.7/site-packages/glance/api/middleware/version_negotiation.py:71
2013-05-18 01:38:38.541 16020 DEBUG glance.api.middleware.version_negotiation [-] new uri /v1/images/detail process_request /usr/lib/python2.7/site-packages/glance/api/middleware/version_negotiation.py:72
2013-05-18 01:41:32.206 16020 DEBUG glance.api.middleware.version_negotiation [-] Determining version of request: GET //v1/images/detail Accept:  process_request /usr/lib/python2.7/site-packages/glance/api/middleware/version_negotiation.py:46
2013-05-18 01:41:32.207 16020 DEBUG glance.api.middleware.version_negotiation [-] Using url versioning process_request /usr/lib/python2.7/site-packages/glance/api/middleware/version_negotiation.py:59
2013-05-18 01:41:32.207 16020 DEBUG glance.api.middleware.version_negotiation [-] Matched version: v1 process_request /usr/lib/python2.7/site-packages/glance/api/middleware/version_negotiation.py:71
2013-05-18 01:41:32.207 16020 DEBUG glance.api.middleware.version_negotiation [-] new uri /v1/images/detail process_request /usr/lib/python2.7/site-packages/glance/api/middleware/version_negotiation.py:72
2013-05-18 01:41:32.371 16020 DEBUG glance.api.middleware.version_negotiation [-] Determining version of request: GET //v1/images/detail Accept:  process_request /usr/lib/python2.7/site-packages/glance/api/middleware/version_negotiation.py:46
2013-05-18 01:41:32.372 16020 DEBUG glance.api.middleware.version_negotiation [-] Using url versioning process_request /usr/lib/python2.7/site-packages/glance/api/middleware/version_negotiation.py:59
2013-05-18 01:41:32.372 16020 DEBUG glance.api.middleware.version_negotiation [-] Matched version: v1 process_request /usr/lib/python2.7/site-packages/glance/api/middleware/version_negotiation.py:71
2013-05-18 01:41:32.372 16020 DEBUG glance.api.middleware.version_negotiation [-] new uri /v1/images/detail process_request /usr/lib/python2.7/site-packages/glance/api/middleware/version_negotiation.py:72

Does anyone have any ideas why this is happening after 48 hours?

Thanks!

Edit: I know my environment variables aren't the problem as other commands ("nova flavor-list", "nova hypervisor-list", etc) all work.

edit retag flag offensive close merge delete

Comments

Do you have those variables exported OSUSERNAME, OSTENANTNAME, OSPASSWORD, OSAUTHURL, OSREGIONNAME?

Alen Komljen gravatar imageAlen Komljen ( 2013-05-18 01:54:50 -0600 )edit

Yup, please see my 'Edit'. :)

JakeWarner gravatar imageJakeWarner ( 2013-05-18 01:55:29 -0600 )edit

5 answers

Sort by ยป oldest newest most voted
0

answered 2015-01-08 10:02:19 -0600

sandlbn gravatar image

In my case was a problem with bad region :(

edit flag offensive delete link more
1

answered 2013-05-21 07:32:11 -0600

lusoheart gravatar image

updated 2013-05-21 07:32:49 -0600

Hi,

We face a similar issue in our configuration after 48 hours as well. We have been investigating this problem for quite some time: changing tenant, users, etc in glance and/or keystone, but nothing worked out.

And what finally solved the problem -but that we can't explain- was to change in /etc/glance/glance-api.conf:

[keystoneauthtoken]
auth
host = $IpAddress

to

[keystoneauthtoken]
auth
host = 127.0.0.1

We then restarted the glance services and it worked!

To make sure it was this setting affecting our system we restored it to the previous value, however putting this value back to the original IP address didn't broke the system again; it is still running fine. :/

Hope it helps,

Regards,

edit flag offensive delete link more
0

answered 2013-07-09 03:31:44 -0600

n-paladi gravatar image

updated 2013-07-09 03:36:34 -0600

FYI

I had a similar issue, however the value auth_host was already 127.0.0.1;

Changing this to the host's public IP solved the issue and it kept working after changing the value back to 127.0.0.1.

edit flag offensive delete link more
0

answered 2016-09-10 19:51:18 -0600

updated 2016-09-10 19:51:45 -0600

Double check your credentials in glance-api.conf and glance-registry.conf

In my case that was wrong variable name "auth_tenant_name" instead of "admin_tenant_name"

file /etc/glance/glance-api.conf

    [keystone_authtoken]
    auth_uri = http://controller:5000/
    auth_host = controller
    auth_port = 35357
    auth_protocol = http
    admin_tenant_name = service
    admin_user = glance
    admin_password = <yourpass>

file /etc/glance/glance-registry.conf

    [keystone_authtoken]
    auth_uri = http://controller:5000
    auth_host = controller
    auth_port = 35357
    auth_protocol = http
    admin_tenant_name = service
    admin_user = glance
    admin_password = <yourpass>
edit flag offensive delete link more
0

answered 2015-02-02 08:38:20 -0600

jdiaz9 gravatar image

I had a similar issue where I would get the same error. I made sure glance-registry and glance-api had the proper auth_xxx info and restarted the services with no success. Ultimately, rebooting the controller node solved the issue. Don't know why. Hope this helps, even after several years. Who knows, it might help someone else.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2013-05-18 01:47:46 -0600

Seen: 6,367 times

Last updated: Sep 10 '16