ADD_EXCEPTIONS plugin config is replacing the Exception category list rather than appending to it.

Bug #1404032 reported by Eric Peterson
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Paul Karikh

Bug Description

We are having problems where the admin volumes page is bombing out / error / http 500. This seems to occur due to an issue in

openstack_dashboard/dashboards/project/volumes/volumes/tables.py

in the function def get_attachment_name(request, attachment):

The problem seems to be that a volume still thinks it is attached to an instance that is missing.

Revision history for this message
Eric Peterson (ericpeterson-l) wrote :

If you'd like to reproduce, just raise novaclient.exceptions.NotFound within that block that gets the instance, and see how it blows up.

Revision history for this message
Eric Peterson (ericpeterson-l) wrote :

We have monasca plugin installed, which seems to be creating this issue.

Their plugin adds some new exceptions to handle:
https://github.com/stackforge/monasca-ui/blob/master/monitoring/enabled/_50_admin_add_monitoring_panel.py

But this line of code actually replaces the NotFound exceptions:
https://github.com/openstack/horizon/blob/master/openstack_dashboard/utils/settings.py#L113

Essentially this means when a plugin tries to add exceptions - they replace the exceptions like the NotFound tuple of NotFounds.

Revision history for this message
Eric Peterson (ericpeterson-l) wrote :

This ugly workaround demonstrates how you deal with this in the meantime:

https://github.com/openstack/tuskar-ui/blob/master/tuskar_ui/exceptions.py

Revision history for this message
Eric Peterson (ericpeterson-l) wrote :

git diff
diff --git a/openstack_dashboard/utils/settings.py b/openstack_dashboard/utils/settings.py
index 2046cfb..229cc9b 100644
--- a/openstack_dashboard/utils/settings.py
+++ b/openstack_dashboard/utils/settings.py
@@ -98,7 +98,7 @@ def update_dashboards(modules, horizon_config, installed_apps):

     enabled_dashboards = []
     disabled_dashboards = []
- exceptions = {}
+ exceptions = horizon_config.get('exceptions', {})
     apps = []
     angular_modules = []
     js_files = set()
@@ -110,7 +110,8 @@ def update_dashboards(modules, horizon_config, installed_apps):
                 disabled_dashboards.append(config.get('DASHBOARD'))
             continue
         apps.extend(config.get('ADD_INSTALLED_APPS', []))
- exceptions.update(config.get('ADD_EXCEPTIONS', {}))
+ for category, exc_list in config.get('ADD_EXCEPTIONS', {}).iteritems():
+ exceptions[category] = exceptions.get(category, ()) + exc_list
         angular_modules.extend(config.get('ADD_ANGULAR_MODULES', []))
         js_files.update(config.get('ADD_JS_FILES', []))
         update_horizon_config.update(

Revision history for this message
Eric Peterson (ericpeterson-l) wrote :

Apologies for the pasted patch above, but it seems to fix the issue.

summary: - admin volumes page fails when attached instance is missing
+ ADD_EXCEPTIONS plugin config is replacing the Exception category list
+ rather than appending to it.
Paul Karikh (pkarikh)
Changed in horizon:
assignee: nobody → Paul Karikh (pkarikh)
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/143832

Changed in horizon:
status: New → In Progress
tags: added: juno-backport-potential
Changed in horizon:
importance: Undecided → Medium
milestone: none → kilo-2
tags: added: icehouse-backport-potential
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-2 → kilo-3
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-3 → kilo-rc1
David Lyle (david-lyle)
Changed in horizon:
importance: Medium → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/143832
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=69d73ee9c4f97f7b156ff45c1523b6cd9b09f525
Submitter: Jenkins
Branch: master

commit 69d73ee9c4f97f7b156ff45c1523b6cd9b09f525
Author: Paul Karikh <email address hidden>
Date: Mon Dec 22 16:01:09 2014 +0300

    Fix replacement of exception category list

    Make config of ADD_EXCEPTIONS plugin append to the
    exception category list and not replace it.

    Change-Id: Ib52012bc93311ac019312b0f92b5fcb8842de53d
    Co-Authored-By: Eric Peterson <email address hidden>
    Closes-Bug: #1404032

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-rc1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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