More heplful error message for the default role

Bug #1108063 reported by Julie Pichon
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Julie Pichon
Folsom
Fix Released
Undecided
Julie Pichon

Bug Description

Horizon requires a default keystone role to be defined in the settings. Depending on the installation guide they follow, users can easily end up with no "Member" group defined (the current default) and not be aware of the issue except for a few admin functions not working.

When the default group doesn't exist and an admin user tries to e.g. edit a project, the message on the web UI will read:

"Error: An error occurred. Please try again."

And in the logs: "AttributeError: 'NoneType' object has no attribute 'id'", e.g.

[Wed Jan 16 01:15:29 2013] [error] extra_context = {"form": self.action,
[Wed Jan 16 01:15:29 2013] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/workflows/base.py", line 360, in action
[Wed Jan 16 01:15:29 2013] [error] context)
[Wed Jan 16 01:15:29 2013] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/admin/projects/workflows.py", line 117, in __init__
[Wed Jan 16 01:15:29 2013] [error] redirect=reverse(INDEX_URL))
[Wed Jan 16 01:15:29 2013] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/admin/projects/workflows.py", line 113, in __init__
[Wed Jan 16 01:15:29 2013] [error] default_role = api.keystone.get_default_role(self.request).id
[Wed Jan 16 01:15:29 2013] [error] AttributeError: 'NoneType' object has no attribute 'id'

(see also bug #1084119).

Horizon should provide a more specific and helpful error message, such as "Could not find default role %s in Keystone" in the logs and ideally on the UI as well.

Steps to reproduce:
1. Change the OPENSTACK_KEYSTONE_DEFAULT_ROLE in the local settings to a role name that doesn't exist
2. Restart the webserver
3. As an admin, go to the Admin Project tabs and click on Modify users

Julie Pichon (jpichon)
Changed in horizon:
assignee: nobody → Julie Pichon (jpichon)
Julie Pichon (jpichon)
description: updated
Changed in horizon:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/21647

Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/21647
Committed: http://github.com/openstack/horizon/commit/0e414a9474232770285768ce1d88d0f0356c4ea7
Submitter: Jenkins
Branch: master

commit 0e414a9474232770285768ce1d88d0f0356c4ea7
Author: Julie Pichon <email address hidden>
Date: Mon Feb 11 13:42:19 2013 +0000

    Improve error message when the default role doesn't exist

    To add members to a project, Horizon requires a default role to exist
    in Keystone. This provides a clearer error message when the role
    cannot be found.

    Fixes bug #1108063

    Change-Id: I0e3cd4cb96c7896c675055671e0875840b1a41d3

Changed in horizon:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/folsom)

Fix proposed to branch: stable/folsom
Review: https://review.openstack.org/22339

Thierry Carrez (ttx)
Changed in horizon:
milestone: none → grizzly-3
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/folsom)

Reviewed: https://review.openstack.org/22339
Committed: http://github.com/openstack/horizon/commit/abe2f61a879103ba431b8c33c08566a55d785b14
Submitter: Jenkins
Branch: stable/folsom

commit abe2f61a879103ba431b8c33c08566a55d785b14
Author: Julie Pichon <email address hidden>
Date: Tue Feb 19 18:32:32 2013 +0000

    Improve error message when the default role doesn't exist

    To add members to a project, Horizon requires a default role to exist
    in Keystone. This provides a clearer error message when the role
    cannot be found.

    Fixes bug #1108063

    Change-Id: I0e3cd4cb96c7896c675055671e0875840b1a41d3

Thierry Carrez (ttx)
Changed in horizon:
milestone: grizzly-3 → 2013.1
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.