NotRegistered: Dashboard with slug "router" is not registered.

Bug #1258421 reported by li,chen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Invalid
Undecided
Unassigned

Bug Description

I'm working under CentOS 6.4 + Openstack - Havana, everything works fine except Horizon.

I get error in /var/log/httpd/error_log:

[Fri Dec 06 01:27:42 2013] [error] REQ: curl -i -X GET http://192.168.11.11:35357/v2.0/tenants -H "User-Agent: python-keystoneclient" -H "Forwarded: for=192.168.4.254;by=python-keystoneclient" -H "X-Auth-Token: 3626890532059c0fc72580224dd15ab1"
[Fri Dec 06 01:27:42 2013] [error] INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.11.11
[Fri Dec 06 01:27:42 2013] [error] DEBUG:urllib3.connectionpool:"GET /v2.0/tenants HTTP/1.1" 200 381
[Fri Dec 06 01:27:42 2013] [error] RESP: [200] {'date': 'Fri, 06 Dec 2013 07:27:42 GMT', 'content-type': 'application/json', 'content-length': '381', 'vary': 'X-Auth-Token'}
[Fri Dec 06 01:27:42 2013] [error] RESP BODY: {"tenants_links": [], "tenants": [{"description": "admin tenant", "enabled": true, "id": "45c69667e2a64c889719ef8d8e0dd098", "name": "admin"}, {"description": "Tenant for the openstack services", "enabled": true, "id": "4cc060c11bc046178c253aa9521aa152", "name": "services"}, {"description": null, "enabled": true, "id": "ca47670e792e46d48363dee7e7e43688", "name": "policy_test"}]}
[Fri Dec 06 01:27:42 2013] [error]
[Fri Dec 06 01:27:42 2013] [error] ERROR:django.request:Internal Server Error: /dashboard/admin/
[Fri Dec 06 01:27:42 2013] [error] Traceback (most recent call last):
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 136, in get_response
[Fri Dec 06 01:27:42 2013] [error] response = response.render()
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/response.py", line 104, in render
[Fri Dec 06 01:27:42 2013] [error] self._set_content(self.rendered_content)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/response.py", line 81, in rendered_content
[Fri Dec 06 01:27:42 2013] [error] content = template.render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/base.py", line 140, in render
[Fri Dec 06 01:27:42 2013] [error] return self._render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/base.py", line 134, in _render
[Fri Dec 06 01:27:42 2013] [error] return self.nodelist.render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/base.py", line 823, in render
[Fri Dec 06 01:27:42 2013] [error] bit = self.render_node(node, context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/debug.py", line 74, in render_node
[Fri Dec 06 01:27:42 2013] [error] return node.render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/loader_tags.py", line 123, in render
[Fri Dec 06 01:27:42 2013] [error] return compiled_parent._render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/base.py", line 134, in _render
[Fri Dec 06 01:27:42 2013] [error] return self.nodelist.render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/base.py", line 823, in render
[Fri Dec 06 01:27:42 2013] [error] bit = self.render_node(node, context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/debug.py", line 74, in render_node
[Fri Dec 06 01:27:42 2013] [error] return node.render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/loader_tags.py", line 62, in render
[Fri Dec 06 01:27:42 2013] [error] result = block.nodelist.render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/base.py", line 823, in render
[Fri Dec 06 01:27:42 2013] [error] bit = self.render_node(node, context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/debug.py", line 74, in render_node
[Fri Dec 06 01:27:42 2013] [error] return node.render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/loader_tags.py", line 62, in render
[Fri Dec 06 01:27:42 2013] [error] result = block.nodelist.render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/base.py", line 823, in render
[Fri Dec 06 01:27:42 2013] [error] bit = self.render_node(node, context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/debug.py", line 74, in render_node
[Fri Dec 06 01:27:42 2013] [error] return node.render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/loader_tags.py", line 155, in render
[Fri Dec 06 01:27:42 2013] [error] return self.render_template(self.template, context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/loader_tags.py", line 137, in render_template
[Fri Dec 06 01:27:42 2013] [error] output = template.render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/base.py", line 140, in render
[Fri Dec 06 01:27:42 2013] [error] return self._render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/base.py", line 134, in _render
[Fri Dec 06 01:27:42 2013] [error] return self.nodelist.render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/base.py", line 823, in render
[Fri Dec 06 01:27:42 2013] [error] bit = self.render_node(node, context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/debug.py", line 74, in render_node
[Fri Dec 06 01:27:42 2013] [error] return node.render(context)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/django/template/base.py", line 1178, in render
[Fri Dec 06 01:27:42 2013] [error] _dict = func(*resolved_args, **resolved_kwargs)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/horizon/templatetags/horizon.py", line 53, in horizon_main_nav
[Fri Dec 06 01:27:42 2013] [error] for dash in Horizon.get_dashboards():
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/horizon/base.py", line 647, in get_dashboards
[Fri Dec 06 01:27:42 2013] [error] dashboard = self._registered(item)
[Fri Dec 06 01:27:42 2013] [error] File "/usr/lib/python2.6/site-packages/horizon/base.py", line 158, in _registered
[Fri Dec 06 01:27:42 2013] [error] "slug": slug})
[Fri Dec 06 01:27:42 2013] [error] NotRegistered: Dashboard with slug "router" is not registered.
~

Here is my /etc/openstack-dashboard/local_settings:

import os

from django.utils.translation import ugettext_lazy as _

DEBUG = True
TEMPLATE_DEBUG = DEBUG
PROD = False
USE_SSL = False

# Note: You should change this value
SECRET_KEY = '14944dc86ead4079bc95bd648a0539a6'

# Specify a regular expression to validate user passwords.
# HORIZON_CONFIG = {
# "password_validator": {
# "regex": '.*',
# "help_text": _("Your password does not meet the requirements.")
# }
# }

LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))

# We recommend you use memcached for development; otherwise after every reload
# of the django development server, you will have to login again. To use
# memcached set CACHE_BACKED to something like 'memcached://127.0.0.1:11211/'
CACHE_BACKEND = 'memcached://127.0.0.1:11211/'

# Send email to the console by default
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# Or send them to /dev/null
#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'

# Configure these for your outgoing email host
# EMAIL_HOST = 'smtp.my-company.com'
# EMAIL_PORT = 25
# EMAIL_HOST_USER = 'djangomail'
# EMAIL_HOST_PASSWORD = 'top-secret!'

# For multiple regions uncomment this configuration, and add (endpoint, title).
# AVAILABLE_REGIONS = [
# ('http://cluster1.example.com:5000/v2.0', 'cluster1'),
# ('http://cluster2.example.com:5000/v2.0', 'cluster2'),
# ]

OPENSTACK_HOST = "192.168.11.11"
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"

# The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the
# capabilities of the auth backend for Keystone.
# If Keystone has been configured to use LDAP as the auth backend then set
# can_edit_user to False and name to 'ldap'.
#
# TODO(tres): Remove these once Keystone has an API to identify auth backend.
OPENSTACK_KEYSTONE_BACKEND = {
    'name': 'native',
    'can_edit_user': True
}

OPENSTACK_HYPERVISOR_FEATURES = {
    'can_set_mount_point': True
}

# OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints
# in the Keystone service catalog. Use this setting when Horizon is running
# external to the OpenStack environment. The default is 'internalURL'.
#OPENSTACK_ENDPOINT_TYPE = "publicURL"

# The number of Swift containers and objects to display on a single page before
# providing a paging element (a "more" link) to paginate results.
API_RESULT_LIMIT = 1000

# If you have external monitoring links, eg:
EXTERNAL_MONITORING = [ ]
LOGGING = {
        'version': 1,
        # When set to True this will disable all logging except
        # for loggers specified in this configuration dictionary. Note that
        # if nothing is specified here and disable_existing_loggers is True,
        # django.db.backends will still log unless it is disabled explicitly.
        'disable_existing_loggers': False,
        'handlers': {
            'null': {
                'level': 'DEBUG',
                'class': 'django.utils.log.NullHandler',
                },
            'console': {
                # Set the level to "DEBUG" for verbose output logging.
                'level': 'INFO',
                'class': 'logging.StreamHandler',
                },
            'file': {
                'level': 'DEBUG',
                'class': 'logging.FileHandler',
                'filename': '/var/log/horizon/horizon.log'
                },
            },
        'loggers': {
            # Logging from django.db.backends is VERY verbose, send to null
            # by default.
            'django.db.backends': {
                'handlers': ['null'],
                'propagate': False,
                },
            'horizon': {
                'handlers': ['file'],
                'propagate': False,
            },
            'openstack_dashboard': {
                'handlers': ['file'],
                'propagate': False,
            },
            'novaclient': {
                'handlers': ['file'],
                'propagate': False,
            },
            'glanceclient': {
                'handlers': ['file'],
                'propagate': False,
            },
            'keystoneclient': {
                'handlers': ['file'],
                'propagate': False,
            },
            'nose.plugins.manager': {
                'handlers': ['file'],
                'propagate': False,
            }
        }
}
LOGIN_URL='/dashboard/auth/login/'
LOGIN_REDIRECT_URL='/dashboard'

# The Ubuntu package includes pre-compressed JS and compiled CSS to allow
# offline compression by default. To enable online compression, install
# the node-less package and enable the following option.
COMPRESS_OFFLINE = True

SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
CACHES = {
    'default':{
        'BACKEND':'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION' : '192.168.11.11:11211'
    }
}

OPENSTACK_API_VERSIONS = {
     "identity": 2.0
}

Anyone know why this error happened ??

Thanks.
-chen

~
~
~

Revision history for this message
Matthias Runge (mrunge) wrote :

chen, could you please provide your settings.py as well?

Revision history for this message
li,chen (chen-li) wrote :

what is settings.py ?

Revision history for this message
li,chen (chen-li) wrote :

where can I find settings.py ?

Revision history for this message
Matthias Runge (mrunge) wrote :

did you change anything on your package? please give the corresponding version
rpm -q openstack-dashboard

you can find settings.py under /usr/share/openstack-dashboard/openstack_dashboard/

how did you manage to produce your issue?

Revision history for this message
Matthias Runge (mrunge) wrote :

if you don't know, where to locate settings.py, it's unlikely, you changed it. in that case it's not necessary to provide it.

Revision history for this message
li,chen (chen-li) wrote :

rpm -q openstack-dashboard
openstack-dashboard-2013.2-3.el6.noarch

Revision history for this message
li,chen (chen-li) wrote :

>> "how did you manage to produce your issue?" ?

1. start httpd
2. use firefox to connect dashboard
3. use admin user to login => issue appears

Revision history for this message
Matthias Runge (mrunge) wrote :

Chen, could you please use the distributed config file? Apparently you made changes, e.g. you set CACHES twice and changed keystone API as well.

David Lyle (david-lyle)
Changed in horizon:
status: New → Incomplete
Revision history for this message
li,chen (chen-li) wrote :

What should I do to use "distributed config file" ??
Sorry , I'm really new here......

Thanks.
-chen

Revision history for this message
li,chen (chen-li) wrote :

I have the "CACHE_BACKEND" setting after I installed dashboard, but I didn't find anything about this from internet, all settings are
"CACHES ", so I just add "CACHES" at the end.

About keystone,I don't have any V3 API endpoint exist, but I noticed there is some request to keystone with V3 in the URL, so I googled for it, and set it to use v2.

Revision history for this message
li,chen (chen-li) wrote :
Download full text (4.0 KiB)

I download horizon code from github(https://github.com/openstack/horizon.git).
And, did cp /home/git/horizon/openstack_dashboard/local/local_settings.py.example /etc/openstack-dashboard/local_settings.

But, after I restart httpd, i get error:

[Mon Dec 09 01:21:11 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Dec 09 01:21:11 2013] [warn] module wsgi_module is already loaded, skipping
[Mon Dec 09 01:21:11 2013] [notice] Digest: generating secret for digest authentication ...
[Mon Dec 09 01:21:11 2013] [notice] Digest: done
[Mon Dec 09 01:21:12 2013] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_wsgi/3.2 Python/2.6.6 configured -- resuming normal operations
[Mon Dec 09 01:21:30 2013] [warn] [client 192.168.4.254] incomplete redirection target of '/dashboard/' for URI '/' modified to 'http://192.168.11.11/dashboard/'
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] mod_wsgi (pid=1975): Exception occurred processing WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'.
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] Traceback (most recent call last):
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 219, in __call__
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] self.load_middleware()
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 39, in load_middleware
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] for middleware_path in settings.MIDDLEWARE_CLASSES:
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 184, in inner
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] self._setup()
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 42, in _setup
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] self._wrapped = Settings(settings_module)
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 93, in __init__
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] mod = importlib.import_module(self.SETTINGS_MODULE)
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] File "/usr/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] __import__(name)
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/settings.py", line 221, in <module>
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] from local.local_settings import * # noqa
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/local/local_settings.py", line 92, in <module>
[Mon Dec 09 01:21:30 2013] [error] [client 192.168.4.254] SECRET_KEY = secret_key.generate_or_...

Read more...

li,chen (chen-li)
Changed in horizon:
status: Incomplete → Invalid
Revision history for this message
Matthias Runge (mrunge) wrote :

to comment #11:

that's clear, because the lock file can not be created under /usr/share....

Were you able to find the reason for your issue?

CACHE and CACHES settings are the same
CACHE is old syntax, CACHES for the newer one.

Revision history for this message
li,chen (chen-li) wrote :

The issue is gone, after I run:

1. cd /usr/share/openstack-dashboard
2. chown -R apache:apache *

And also, the previous issue have gone too.
I think this is because I'm using the distributed config file as you suggested.

I add the v2 configuration back to the local_settings:
     OPENSTACK_API_VERSIONS = {
          "identity": 2.0
     }

Still, everything works fine.

So, I set this bug to Invalid because I think the issue is caused by the CACHE configurations.
It is an configuration issue not a bug.

But, there is no "SESSION_ENGINE" parameter exist in local_settings.py.example.
I'm still really confused about "http://docs.openstack.org/trunk/openstack-compute/install/yum/content/dashboard-sessions.html"

Thanks.
-chen

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.