Getting Unauthorized at /project/ on devstack

Asked by Dimitri Mazmanov

What am I doing wrong?!
Finally I managed to "successfully" install devstack using vagrant, but after another run of ./stack.sh I got the following error in the dashboard.

Environment:

Request Method: GET
Request URL: http://localhost:8080/project/

Django Version: 1.5.5
Python Version: 2.7.3
Installed Applications:
['openstack_dashboard',
 'django.contrib.contenttypes',
 'django.contrib.auth',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'compressor',
 'horizon',
 'openstack_auth',
 'openstack_dashboard.dashboards.project',
 'openstack_dashboard.dashboards.admin',
 'openstack_dashboard.dashboards.settings']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'horizon.middleware.HorizonMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware')

Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  115. response = callback(request, *callback_args, **callback_kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py" in dec
  38. return view_func(request, *args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py" in dec
  54. return view_func(request, *args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py" in dec
  38. return view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in view
  68. return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in dispatch
  86. return handler(request, *args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/views.py" in get
  154. handled = self.construct_tables()
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/views.py" in construct_tables
  145. handled = self.handle_table(table)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/views.py" in handle_table
  118. data = self._get_data_dict()
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/views.py" in _get_data_dict
  181. self._data = {self.table_class._meta.name: self.get_data()}
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/project/overview/views.py" in get_data
  57. super(ProjectOverview, self).get_data()
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/usage/views.py" in get_data
  43. self.usage.summarize(*self.usage.get_date_range())
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/usage/base.py" in summarize
  200. if not api.nova.extension_supported('SimpleTenantUsage', self.request):
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/utils/memoized.py" in wrapped
  90. value = cache[key] = func(*args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/nova.py" in extension_supported
  752. extensions = list_extensions(request)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/utils/memoized.py" in wrapped
  90. value = cache[key] = func(*args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/nova.py" in list_extensions
  743. return nova_list_extensions.ListExtManager(novaclient(request)).show_all()
File "/opt/stack/python-novaclient/novaclient/v1_1/contrib/list_extensions.py" in show_all
  37. return self._list("/extensions", 'extensions')
File "/opt/stack/python-novaclient/novaclient/base.py" in _list
  64. _resp, body = self.api.client.get(url)
File "/opt/stack/python-novaclient/novaclient/client.py" in get
  283. return self._cs_request(url, 'GET', **kwargs)
File "/opt/stack/python-novaclient/novaclient/client.py" in _cs_request
  275. raise e

Exception Type: Unauthorized at /project/
Exception Value: Unauthorized (HTTP 401)

-------
I'm using the following configuration for my local.conf, which gives me the trunk

ENABLED_SERVICES+=,horizon
HORIZON_REPO=https://github.com/openstack/horizon
HORIZON_BRANCH=master

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Dashboard (Horizon) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Mike BRIGHT (k5-openstack) said :
#1

Hi, I'm also seeing this problem with a vagrant-dockstack installation.
I first hit a problem with "No module named config" which I fix (hack!) with a symlink and then I hit this authorization problem.

Clueless for the moment ...

Revision history for this message
Xi Yang (xi-yang) said :
#2

Anyone can help?

Seems i have met this issue too.. I cloned the latest devstack code and did a successful installation. I can login in dashboard the first time, but after that, error comes: (command line execution on the machine is OK)

Environment:

Request Method: GET
Request URL: http://10.32.179.158/project/

Django Version: 1.5.5
Python Version: 2.7.3
Installed Applications:
['openstack_dashboard',
 'django.contrib.contenttypes',
 'django.contrib.auth',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'compressor',
 'horizon',
 'openstack_auth',
 'openstack_dashboard.dashboards.project',
 'openstack_dashboard.dashboards.admin',
 'openstack_dashboard.dashboards.settings']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'horizon.middleware.HorizonMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware')

Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  115. response = callback(request, *callback_args, **callback_kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py" in dec
  38. return view_func(request, *args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py" in dec
  54. return view_func(request, *args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py" in dec
  38. return view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in view
  68. return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in dispatch
  86. return handler(request, *args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/views.py" in get
  154. handled = self.construct_tables()
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/views.py" in construct_tables
  145. handled = self.handle_table(table)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/views.py" in handle_table
  118. data = self._get_data_dict()
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/views.py" in _get_data_dict
  181. self._data = {self.table_class._meta.name: self.get_data()}
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/project/overview/views.py" in get_data
  57. super(ProjectOverview, self).get_data()
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/usage/views.py" in get_data
  43. self.usage.summarize(*self.usage.get_date_range())
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/usage/base.py" in summarize
  200. if not api.nova.extension_supported('SimpleTenantUsage', self.request):
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/utils/memoized.py" in wrapped
  90. value = cache[key] = func(*args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/nova.py" in extension_supported
  756. extensions = list_extensions(request)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/utils/memoized.py" in wrapped
  90. value = cache[key] = func(*args, **kwargs)
File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/nova.py" in list_extensions
  747. return nova_list_extensions.ListExtManager(novaclient(request)).show_all()
File "/opt/stack/python-novaclient/novaclient/v1_1/contrib/list_extensions.py" in show_all
  37. return self._list("/extensions", 'extensions')
File "/opt/stack/python-novaclient/novaclient/base.py" in _list
  64. _resp, body = self.api.client.get(url)
File "/opt/stack/python-novaclient/novaclient/client.py" in get
  283. return self._cs_request(url, 'GET', **kwargs)
File "/opt/stack/python-novaclient/novaclient/client.py" in _cs_request
  275. raise e

Exception Type: Unauthorized at /project/
Exception Value: Unauthorized (HTTP 401)

Revision history for this message
Alex Mance (alejandrogmance) said :
#3

Same error/problem here...

Using git repository: DevStack.
Ubuntu 13.10 server (minimal)
kernel 3.11-0-15-generic

preinstalled packages:
git apache2 ruby ruby-dev gem gcc npm wget uml-utilities qemu-kvm

I repeat this installation dozens of times with same hardware, same procedure (installing packages, edit configs..) and this is the first time i have this error.

i try with different branches (havana/glizzy), but stack.sh crash with differents errors...

Regards, Alex.

Revision history for this message
Xi Yang (xi-yang) said :
#4

Some log from n-api :

2014-03-11 22:52:18.340 DEBUG nova.openstack.common.service [-] spice.server_proxyclient_address = 127.0.0.1 from (pid=3307) log_opt_values /opt/stack/oslo.config/oslo/config/cfg.py:1921
2014-03-11 22:52:18.340 DEBUG nova.openstack.common.service [-] ******************************************************************************** from (pid=3307) log_opt_values /opt/stack/oslo.config/oslo/config/cfg.py:1923
2014-03-11 22:52:22.692 DEBUG keystoneclient.middleware.auth_token [-] Authenticating user token from (pid=3321) __call__ /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:588
2014-03-11 22:52:22.693 DEBUG keystoneclient.middleware.auth_token [-] Removing headers from request environment: X-Identity-Status,X-Domain-Id,X-Domain-Name,X-Project-Id,X-Project-Name,X-Project-Domain-Id,X-Project-Domain-Name,X-User-Id,X-User-Name,X-User-Domain-Id,X-User-Domain-Name,X-Roles,X-Service-Catalog,X-User,X-Tenant-Id,X-Tenant-Name,X-Tenant,X-Role from (pid=3321) _remove_auth_headers /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:647
2014-03-11 22:52:22.740 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTP connection (1): 10.32.179.147
2014-03-11 22:52:22.745 DEBUG requests.packages.urllib3.connectionpool [-] "GET / HTTP/1.1" 300 960 from (pid=3321) _make_request /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py:344
2014-03-11 22:52:22.844 DEBUG keystoneclient.middleware.auth_token [-] Server reports support for api versions: v3.0, v2.0 from (pid=3321) _get_supported_versions /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:578
2014-03-11 22:52:22.845 INFO keystoneclient.middleware.auth_token [-] Auth Token confirmed use of v2.0 apis
2014-03-11 22:52:22.846 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTP connection (1): 10.32.179.147
2014-03-11 22:52:22.878 DEBUG requests.packages.urllib3.connectionpool [-] "GET /v2.0/tokens/e7a4574c1dc05dc3312326a7ea2b8791 HTTP/1.1" 500 189 from (pid=3321) _make_request /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py:344
2014-03-11 22:52:22.878 ERROR keystoneclient.middleware.auth_token [-] Bad response code while validating token: 500
2014-03-11 22:52:22.878 INFO keystoneclient.middleware.auth_token [-] Retrying validation
2014-03-11 22:52:22.879 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTP connection (1): 10.32.179.147
2014-03-11 22:52:22.895 DEBUG requests.packages.urllib3.connectionpool [-] "GET /v2.0/tokens/e7a4574c1dc05dc3312326a7ea2b8791 HTTP/1.1" 500 189 from (pid=3321) _make_request /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py:344
2014-03-11 22:52:22.895 ERROR keystoneclient.middleware.auth_token [-] Bad response code while validating token: 500
2014-03-11 22:52:22.896 WARNING keystoneclient.middleware.auth_token [-] Invalid user token. Keystone response: {u'error': {u'message': u"An unexpected error prevented the server from fulfilling your request. 'RevokeTree' object has no attribute 'remove'", u'code': 500, u'title': u'Internal Server Error'}}
2014-03-11 22:52:22.896 DEBUG keystoneclient.middleware.auth_token [-] Token validation failure. from (pid=3321) _validate_user_token /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:850
2014-03-11 22:52:22.896 TRACE keystoneclient.middleware.auth_token Traceback (most recent call last):
2014-03-11 22:52:22.896 TRACE keystoneclient.middleware.auth_token File "/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py", line 840, in _validate_user_token
2014-03-11 22:52:22.896 TRACE keystoneclient.middleware.auth_token data = self.verify_uuid_token(user_token, retry)
2014-03-11 22:52:22.896 TRACE keystoneclient.middleware.auth_token File "/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py", line 1224, in verify_uuid_token
2014-03-11 22:52:22.896 TRACE keystoneclient.middleware.auth_token return self.verify_uuid_token(user_token, False)
2014-03-11 22:52:22.896 TRACE keystoneclient.middleware.auth_token File "/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py", line 1228, in verify_uuid_token
2014-03-11 22:52:22.896 TRACE keystoneclient.middleware.auth_token raise InvalidUserToken()
2014-03-11 22:52:22.896 TRACE keystoneclient.middleware.auth_token InvalidUserToken
2014-03-11 22:52:22.896 TRACE keystoneclient.middleware.auth_token
2014-03-11 22:52:22.904 DEBUG keystoneclient.middleware.auth_token [-] Marking token as unauthorized in memcache from (pid=3321) _cache_store_invalid /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:1170
2014-03-11 22:52:22.904 WARNING keystoneclient.middleware.auth_token [-] Authorization failed for token
2014-03-11 22:52:22.904 INFO keystoneclient.middleware.auth_token [-] Invalid user token - rejecting request
2014-03-11 22:52:22.905 INFO nova.osapi_compute.wsgi.server [-] 10.32.179.147 "GET /v2/e4b4bb3a3dc646c6ad57e723103a44d4/extensions HTTP/1.1" status: 401 len: 196 time: 0.2166848
2014-03-11 22:52:22.909 DEBUG keystoneclient.middleware.auth_token [-] Authenticating user token from (pid=3321) __call__ /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:588
2014-03-11 22:52:22.909 DEBUG keystoneclient.middleware.auth_token [-] Removing headers from request environment: X-Identity-Status,X-Domain-Id,X-Domain-Name,X-Project-Id,X-Project-Name,X-Project-Domain-Id,X-Project-Domain-Name,X-User-Id,X-User-Name,X-User-Domain-Id,X-User-Domain-Name,X-Roles,X-Service-Catalog,X-User,X-Tenant-Id,X-Tenant-Name,X-Tenant,X-Role from (pid=3321) _remove_auth_headers /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:647
2014-03-11 22:52:22.909 WARNING keystoneclient.middleware.auth_token [-] Unable to find authentication token in headers
2014-03-11 22:52:22.911 DEBUG keystoneclient.middleware.auth_token [-] Headers: {'SCRIPT_NAME': '/v2', 'webob.adhoc_attrs': {'response': <Response at 0x6332dd0 200 OK>}, 'HTTP_X_AUTH_KEY': 'e7a4574c1dc05dc3312326a7ea2b8791', 'REQUEST_METHOD': 'GET', 'PATH_INFO': '/e4b4bb3a3dc646c6ad57e723103a44d4', 'SERVER_PROTOCOL': 'HTTP/1.0', 'wsgi.url_scheme': 'http', 'HTTP_USER_AGENT': 'python-novaclient', 'REMOTE_PORT': '59674', 'SERVER_NAME': '10.32.179.147', 'REMOTE_ADDR': '10.32.179.147', 'eventlet.input': <eventlet.wsgi.Input object at 0x63329d0>, 'HTTP_X_AUTH_USER': 'admin', 'SERVER_PORT': '8774', 'wsgi.input': <eventlet.wsgi.Input object at 0x63329d0>, 'HTTP_HOST': '10.32.179.147:8774', 'HTTP_X_AUTH_PROJECT_ID': 'e4b4bb3a3dc646c6ad57e723103a44d4', 'wsgi.multithread': True, 'eventlet.posthooks': [], 'HTTP_ACCEPT': 'application/json', 'wsgi.version': (1, 0), 'RAW_PATH_INFO': '/v2/e4b4bb3a3dc646c6ad57e723103a44d4', 'GATEWAY_INTERFACE': 'CGI/1.1', 'wsgi.run_once': False, 'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7fe47cd2f270>, 'wsgi.multiprocess': False, 'CONTENT_TYPE': 'text/plain', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate, compress', 'nova.best_content_type': 'application/json'} from (pid=3321) _get_user_token_from_header /opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py:666
2014-03-11 22:52:22.912 INFO keystoneclient.middleware.auth_token [-] Invalid user token - rejecting request

Revision history for this message
Alex Mance (alejandrogmance) said :
#5

I didn't resolve the problem changing between Projects, but with this tricks i can deploy a instance without problems.

(Solving conflict with dnsmasq used for openstack)
apt-get remove bind9

then ensure u have dnsmasq running.

Tip: take a look of you env $PATH for the user "stack"....

seeing other bug in log, (don't found sysctl) we create a ln -s for solve that problem
ln -s /sbin/sysctl /bin/
sudo ln -s /sbin/sysctl /bin/
sudo ln -s /sbin/sysctl /usr/bin/
sudo ln -s /sbin/sysctl /usr/local/bin/
....

This is NOT an official/clean solution, this is my approach to resolve a little part of the problem.

Apologize for my english.

Regards, Alex.

Revision history for this message
Alex Mance (alejandrogmance) said :
#6

Ok... Ubuntu server 13.10 MINIMAL version work's without any problem... But with ubuntu server 13.10 normal version i get all this errors... take care of that detail..

Revision history for this message
bosschaert (david-bosschaert) said :
#7

I had a similar issue, but it was actually caused by browser cookies. This happend when I try to access an openstack horizon dashboard from the browser if the openstack machine was rebooted. Clearing your cookies or using an incognito browser window got around the problem for me.

Revision history for this message
bosschaert (david-bosschaert) said :
#8

Actually, I take that back. The problem resurfaces later on again :(

Revision history for this message
bosschaert (david-bosschaert) said :
#9

I was experiencing this with Ubuntu 14.04 but once I switched to Fedora 20 the problem disappeared.

Revision history for this message
John Griffith (john-griffith) said :
#10

This is often caused when you rerun devstack. Just clear the browser data (cookies and cached image data) for the dashboard instance you were trying to access and you should be good to go.

Can you help with this problem?

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

To post a message you must log in.