bilelmsekni / OpenStack-Grizzly-Install-Guide

A full install guide for OpenStack Grizzly
352 stars 218 forks source link

Horizon showing "UnAuthorized" errors when trying to create new instance #99

Closed jamski closed 11 years ago

jamski commented 11 years ago

Hello, I followed this guide last week and everything worked great. I got a new server today and followed the instructions again but this time I am getting the following errors in Horizon: Error: Unauthorized: Unable to retrieve list of volume snapshots. Error: Unauthorized: Unable to retrieve list of volumes. Error: Unauthorized: Unable to retrieve quota information.

All my Nova services are running. I have checked all my configs to make sure the path is correct for all the connections.

When I checked /var/log/apache2/error.log, I see this: [Wed Jul 10 00:15:26 2013] [error] \x1b[31;1mUnauthorized: Unauthorized (HTTP 401)\x1b[0m [Wed Jul 10 00:15:26 2013] [error] Traceback (most recent call last): [Wed Jul 10 00:15:26 2013] [error] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/usage/base.py", line 112, in get_quotas [Wed Jul 10 00:15:26 2013] [error] self.quotas = quotas.tenant_quota_usages(self.request) [Wed Jul 10 00:15:26 2013] [error] File "/usr/lib/python2.7/dist-packages/horizon/utils/memoized.py", line 33, in call [Wed Jul 10 00:15:26 2013] [error] value = self.func(_args) [Wed Jul 10 00:15:26 2013] [error] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/usage/quotas.py", line 116, in tenant_quota_usages [Wed Jul 10 00:15:26 2013] [error] disabled_quotas=disabled_quotas): [Wed Jul 10 00:15:26 2013] [error] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/usage/quotas.py", line 99, in get_tenant_quota_data [Wed Jul 10 00:15:26 2013] [error] tenant_id=tenant_id) [Wed Jul 10 00:15:26 2013] [error] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/usage/quotas.py", line 81, in _get_quota_data [Wed Jul 10 00:15:26 2013] [error] quotasets.append(getattr(cinder, method_name)(request, tenant_id)) [Wed Jul 10 00:15:26 2013] [error] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/api/cinder.py", line 126, in tenant_quota_get [Wed Jul 10 00:15:26 2013] [error] return QuotaSet(c_client.quotas.get(tenant_id)) [Wed Jul 10 00:15:26 2013] [error] File "/usr/lib/python2.7/dist-packages/cinderclient/v1/quotas.py", line 37, in get [Wed Jul 10 00:15:26 2013] [error] return self._get("/os-quota-sets/%s" % (tenant_id), "quota_set") [Wed Jul 10 00:15:26 2013] [error] File "/usr/lib/python2.7/dist-packages/cinderclient/base.py", line 141, in _get [Wed Jul 10 00:15:26 2013] [error] resp, body = self.api.client.get(url) [Wed Jul 10 00:15:26 2013] [error] File "/usr/lib/python2.7/dist-packages/cinderclient/client.py", line 185, in get [Wed Jul 10 00:15:26 2013] [error] return self._cs_request(url, 'GET', *_kwargs) [Wed Jul 10 00:15:26 2013] [error] File "/usr/lib/python2.7/dist-packages/cinderclient/client.py", line 147, in _cs_request [Wed Jul 10 00:15:26 2013] [error] self.authenticate() [Wed Jul 10 00:15:26 2013] [error] File "/usr/lib/python2.7/dist-packages/cinderclient/client.py", line 293, in authenticate [Wed Jul 10 00:15:26 2013] [error] auth_url = self._v1_auth(auth_url) [Wed Jul 10 00:15:26 2013] [error] File "/usr/lib/python2.7/dist-packages/cinderclient/client.py", line 311, in _v1_auth [Wed Jul 10 00:15:26 2013] [error] resp, body = self.request(url, 'GET', headers=headers) [Wed Jul 10 00:15:26 2013] [error] File "/usr/lib/python2.7/dist-packages/cinderclient/client.py", line 136, in request [Wed Jul 10 00:15:26 2013] [error] raise exceptions.from_response(resp, body) [Wed Jul 10 00:15:26 2013] [error] Unauthorized: Unauthorized (HTTP 401)

I have already rebooted and that did not solve the problem.

jamski commented 11 years ago

You know what? I think I might have messed something up when I ran the scripts for keystone. Im gonna start over again and post an update.

whitekid commented 11 years ago

Just logout and login again

ijab commented 11 years ago

This "unauthorized error" mostly is related with nova.conf or api-paste.ini, and that means there's sth wrong in the conf file of nova, especially in the filter:authtoken section.

Another possible is the keystone's endpoint.

iJab

jamski commented 11 years ago

You are right. It was the endpoints. I guess you really need to sync the db before running those scripts.

Thanks

appop commented 11 years ago

I found why now,it was your password in /etc/nova/api-paste.ini was wrong,So here has a error.

macy212 commented 10 years ago

I encounted the same problem.Like appop said,I configure the nova.con, like:

AUTHENTICATION

auth_strategy=keystone [keystone_authtoken] auth_host = 127.0.0.1 auth_port = 35357 auth_protocol = http admin_tenant_name = service admin_user = nova admin_password = 123456 signing_dirname = /tmp/keystone-signing-nova

But I forgot to configure the api-paste.ini . We should modify the default configuration in [filter:authtoken] paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory auth_host = 127.0.0.1 auth_port = 35357 auth_protocol = http admin_tenant_name = service admin_user = nova admin_password = 123456

I refer the official installation guide for ubuntu 12.04 LTS