Bug 888516

Summary: Editing a project in horizon fails
Product: Red Hat OpenStack Reporter: Russell Bryant <rbryant>
Component: python-django-horizonAssignee: Julie Pichon <jpichon>
Status: CLOSED ERRATA QA Contact: Nir Magnezi <nmagnezi>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.1CC: athomas, jpichon, oblaut
Target Milestone: snapshot4Keywords: Triaged
Target Release: 2.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-django-horizon-2012.2.3-3.el6ost Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-21 15:03:41 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On: 890510    
Bug Blocks:    

Description Russell Bryant 2012-12-18 14:57:23 EST
Description of problem:

Attempting to edit a project in Horizon fails.


Version-Release number of selected component (if applicable):

python-django-horizon-2012.2.1-2.el6ost.noarch


How reproducible:

Every time


Steps to Reproduce:

I set up OpenStack using the Folsom getting started guide on docs.redhat.com.  I logged in to Horizon as the admin user.  I went to Projects in the System Panel.  I have two projects defined (as directed by the docs): admin and rhsummit.  I selected the "Edit Project" action for the rhsummit project.  An error popup came up.  I checked /var/log/httpd/error_log and found the following:

[Tue Dec 18 19:50:54 2012] [error] Problem instantiating action class.
[Tue Dec 18 19:50:54 2012] [error] Traceback (most recent call last):
[Tue Dec 18 19:50:54 2012] [error]   File "/usr/lib/python2.6/site-packages/horizon/workflows/base.py", line 361, in action
[Tue Dec 18 19:50:54 2012] [error]     context)
[Tue Dec 18 19:50:54 2012] [error]   File "/usr/lib/python2.6/site-packages/horizon/dashboards/syspanel/projects/workflows.py", line 110, in __init__
[Tue Dec 18 19:50:54 2012] [error]     redirect=reverse(INDEX_URL))
[Tue Dec 18 19:50:54 2012] [error]   File "/usr/lib/python2.6/site-packages/horizon/dashboards/syspanel/projects/workflows.py", line 106, in __init__
[Tue Dec 18 19:50:54 2012] [error]     default_role = api.get_default_role(self.request).id
[Tue Dec 18 19:50:54 2012] [error] AttributeError: 'NoneType' object has no attribute 'id'
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38] mod_wsgi (pid=18172): Exception occurred processing WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'.
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38] Traceback (most recent call last):
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 241, in __call__
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     response = self.get_response(request)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 179, in get_response
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     return callback(request, **param_dict)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     response = view_func(request, *args, **kwargs)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/views/defaults.py", line 33, in server_error
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     return http.HttpResponseServerError(t.render(Context({})))
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/template/base.py", line 140, in render
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     return self._render(context)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/template/base.py", line 134, in _render
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     return self.nodelist.render(context)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/template/base.py", line 823, in render
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     bit = self.render_node(node, context)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/template/base.py", line 837, in render_node
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     return node.render(context)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/template/loader_tags.py", line 123, in render
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     return compiled_parent._render(context)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/template/base.py", line 134, in _render
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     return self.nodelist.render(context)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/template/base.py", line 823, in render
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     bit = self.render_node(node, context)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/template/base.py", line 837, in render_node
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     return node.render(context)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/template/loader_tags.py", line 155, in render
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     return self.render_template(self.template, context)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/template/loader_tags.py", line 137, in render_template
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     output = template.render(context)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/template/base.py", line 140, in render
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     return self._render(context)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/template/base.py", line 134, in _render
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     return self.nodelist.render(context)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/template/base.py", line 823, in render
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     bit = self.render_node(node, context)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/django/template/base.py", line 837, in render_node
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     return node.render(context)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/compressor/templatetags/compress.py", line 147, in render
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     return self.render_compressed(context, self.kind, self.mode, forced=forced)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/compressor/templatetags/compress.py", line 88, in render_compressed
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     cached_offline = self.render_offline(context, forced=forced)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]   File "/usr/lib/python2.6/site-packages/compressor/templatetags/compress.py", line 72, in render_offline
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38]     'You may need to run "python manage.py compress".' % key)
[Tue Dec 18 19:50:54 2012] [error] [client 10.3.112.38] OfflineGenerationError: You have offline compression enabled but key "1056718f92f8d4204721bac759b3871a" is missing from offline manifest. You may need to run "python manage.py compress".
Comment 2 Russell Bryant 2012-12-18 15:52:50 EST
looks like the actions "Modify users" and "Modify quotas" for a project do the same thing.
Comment 3 Julie Pichon 2012-12-21 10:35:52 EST
Reproduced locally.
Comment 4 Julie Pichon 2012-12-27 07:07:06 EST
This is due to a configuration mismatch that happens following the guide -- doc bug filed at bug 890510.

Horizon expects the default Keystone role to be "Member". However following the guide we create the role "user" instead.

A temporary workaround to become able to use Horizon: 
1. Open /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py
2. Edit OPENSTACK_KEYSTONE_DEFAULT_ROLE to be "user" instead of "Member"
3. Restart httpd

It's possible this change would be overwritten when upgrading the package later on though, so creating a "Member" role in Keystone and reassigning the regular users to it might be a more long term solution.
Comment 5 Julie Pichon 2012-12-27 07:08:16 EST
*** Bug 889589 has been marked as a duplicate of this bug. ***
Comment 6 Julie Pichon 2012-12-27 07:11:00 EST
*** Bug 889765 has been marked as a duplicate of this bug. ***
Comment 7 Julie Pichon 2013-01-25 11:48:47 EST
[Tue Dec 18 19:50:54 2012] [error] Problem instantiating action class.
[Tue Dec 18 19:50:54 2012] [error] Traceback (most recent call last):
[Tue Dec 18 19:50:54 2012] [error]   File "/usr/lib/python2.6/site-packages/horizon/workflows/base.py", line 361, in action
[Tue Dec 18 19:50:54 2012] [error]     context)
[Tue Dec 18 19:50:54 2012] [error]   File "/usr/lib/python2.6/site-packages/horizon/dashboards/syspanel/projects/workflows.py", line 110, in __init__
[Tue Dec 18 19:50:54 2012] [error]     redirect=reverse(INDEX_URL))
[Tue Dec 18 19:50:54 2012] [error]   File "/usr/lib/python2.6/site-packages/horizon/dashboards/syspanel/projects/workflows.py", line 106, in __init__
[Tue Dec 18 19:50:54 2012] [error]     default_role = api.get_default_role(self.request).id
[Tue Dec 18 19:50:54 2012] [error] AttributeError: 'NoneType' object has no attribute 'id'

This error message should be changed to better highlight what is happening ("Cannot find role %s in Keystone").

Also an amendment to comment #4: the appropriate file in which to edit the setting would be /etc/openstack-dashboard/local_settings.
Comment 12 Nir Magnezi 2013-03-06 04:12:27 EST
Verified NVR: 

Verification Steps (provided by Julie):

1. Edit /etc/openstack-dashboard/local_settings and set OPENSTACK_KEYSTONE_DEFAULT_ROLE to a role that doesn't exist e.g. "RoleThatDoesntExist" and restart httpd
2. Log in as admin, and go the Admin -> Projects panel. Click on "Modify Users" or "Edit Project". It won't work.
3. Before the fix, the output in comment 7 would appear in the error logs (/var/log/httpd/error_log)
4. Now, in the same log file, there should be instead a more specific error message saying that RoleThatDoesntExist couldn't be found in Keystone.


/var/log/httpd/error_log:

[Wed Mar 06 03:10:10 2013] [error] Problem instantiating action class.
[Wed Mar 06 03:10:10 2013] [error] Traceback (most recent call last):
[Wed Mar 06 03:10:10 2013] [error]   File "/usr/lib/python2.6/site-packages/horizon/workflows/base.py", line 361, in action
[Wed Mar 06 03:10:10 2013] [error]     context)
[Wed Mar 06 03:10:10 2013] [error]   File "/usr/lib/python2.6/site-packages/horizon/dashboards/syspanel/projects/workflows.py", line 120, in __init__
[Wed Mar 06 03:10:10 2013] [error]     redirect=reverse(INDEX_URL))
[Wed Mar 06 03:10:10 2013] [error]   File "/usr/lib/python2.6/site-packages/horizon/dashboards/syspanel/projects/workflows.py", line 116, in __init__
[Wed Mar 06 03:10:10 2013] [error]     raise exceptions.NotFound(msg)
[Wed Mar 06 03:10:10 2013] [error] NotFound: Could not find default role "RoleThatDoesntExist" in Keystone
Comment 13 Nir Magnezi 2013-03-06 04:23:11 EST
Forgot to specify the Verified NVR: python-django-horizon-2012.2.3-5.el6ost.noarch
Comment 15 errata-xmlrpc 2013-03-21 15:03:41 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0672.html