Cinderclient not converting third-party exceptions

Bug #1207635 reported by Christian Berendt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Christian Berendt
python-cinderclient
Fix Released
Undecided
Christian Berendt

Bug Description

When Cinder is available in the service catalog but it's not usable the /admin/info panel only shows a ConnectionError. There is no exception handling in openstack_dashboard/usage/quotas.py in the method _get_quota_data.

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/39866

Changed in horizon:
assignee: nobody → Christian Berendt (berendt)
status: New → In Progress
Revision history for this message
Christian Berendt (berendt) wrote : Re: panel /admin/info/ not usable when Cinder is listed in service catalog but it's not usable
Download full text (5.2 KiB)

Environment:

Request Method: GET
Request URL: http://192.168.122.78/admin/info/

Django Version: 1.4.5
Python Version: 2.6.8
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_dashboard.dashboards.project',
 'openstack_dashboard.dashboards.admin',
 'openstack_dashboard.dashboards.settings',
 'openstack_auth')
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/lib64/python2.6/site-packages/django/core/handlers/base.py" in get_response
  111. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib64/python2.6/site-packages/horizon/decorators.py" in dec
  38. return view_func(request, *args, **kwargs)
File "/usr/lib64/python2.6/site-packages/horizon/decorators.py" in dec
  86. return view_func(request, *args, **kwargs)
File "/usr/lib64/python2.6/site-packages/horizon/decorators.py" in dec
  54. return view_func(request, *args, **kwargs)
File "/usr/lib64/python2.6/site-packages/horizon/decorators.py" in dec
  38. return view_func(request, *args, **kwargs)
File "/usr/lib64/python2.6/site-packages/django/views/generic/base.py" in view
  48. return self.dispatch(request, *args, **kwargs)
File "/usr/lib64/python2.6/site-packages/django/views/generic/base.py" in dispatch
  69. return handler(request, *args, **kwargs)
File "/usr/lib64/python2.6/site-packages/horizon/tabs/views.py" in get
  136. context = self.get_context_data(**kwargs)
File "/usr/lib64/python2.6/site-packages/horizon/tables/views.py" in get_context_data
  107. context = super(MultiTableMixin, self).get_context_data(**kwargs)
File "/usr/lib64/python2.6/site-packages/horizon/tabs/views.py" in get_context_data
  44. exceptions.handle(self.request)
File "/usr/lib64/python2.6/site-packages/horizon/tabs/views.py" in get_context_data
  42. context["tab_group"].load_tab_data()
File "/usr/lib64/python2.6/site-packages/horizon/tabs/base.py" in load_tab_data
  122. exceptions.handle(self.request)
File "/usr/lib64/python2.6/site-packages/horizon/tabs/base.py" in load_tab_data
  119. tab._data = tab.get_context_data(self.request)
File "/usr/lib64/python2.6/site-packages/horizon/tabs/base.py" in get_context_data
  450. self.load_table_data()
File "/usr/lib64/python2.6/site-packages/horizon/tabs/base.py" in load_table_data
  434. table.data = data_func()
File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/das...

Read more...

Revision history for this message
Kieran Spear (kspear) wrote :

Looks like a cinderclient bug to me. Any bug raised by cinderclient should be a subclass of cinderclient.exceptions.ClientException, and our exception handling depends on that to catch errors from the client. But in this case it's just passing an exception from the requests library straight though.

For now I'd suggest working around this by adding this particular exception to the list of recoverable settings in your local_settings.py:

from requests.exceptions import ConnectionError

# Default OpenStack Dashboard configuration.
HORIZON_CONFIG = {
[snip]
    'exceptions': {'recoverable': exceptions.RECOVERABLE + (ConnectionError,),
                             'not_found': exceptions.NOT_FOUND,
                             'unauthorized': exceptions.UNAUTHORIZED},
}

Kieran Spear (kspear)
summary: - panel /admin/info/ not usable when Cinder is listed in service catalog
- but it's not usable
+ Cinderclient not converting third-party exceptions
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/40383

Changed in python-cinderclient:
status: New → In Progress
assignee: nobody → Christian Berendt (berendt)
Revision history for this message
Christian Berendt (berendt) wrote :

review request python-cinderclient: https://review.openstack.org/#/c/40382/
review request horizon (depends on the review request for python-cinderclient): https://review.openstack.org/#/c/40383/

Not sure how I have to set the commit message to attach both review requests here.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-cinderclient (master)

Reviewed: https://review.openstack.org/40382
Committed: http://github.com/openstack/python-cinderclient/commit/c95e59f51041dc01812d34a6b6e0765dc8c4d034
Submitter: Jenkins
Branch: master

commit c95e59f51041dc01812d34a6b6e0765dc8c4d034
Author: Christian Berendt <email address hidden>
Date: Tue Aug 6 11:59:34 2013 +0200

    convert third-party exception to ConnectionError

    fixes bug #1207635

    Change-Id: I37da522e812286e72706409b8a6d4652515f720f

Changed in python-cinderclient:
status: In Progress → Fix Committed
David Lyle (david-lyle)
Changed in horizon:
importance: Undecided → Medium
importance: Medium → Undecided
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/40383
Committed: http://github.com/openstack/horizon/commit/0959866f38f20791a3f70798f8cec091cefeeeff
Submitter: Jenkins
Branch: master

commit 0959866f38f20791a3f70798f8cec091cefeeeff
Author: Christian Berendt <email address hidden>
Date: Tue Aug 6 12:02:53 2013 +0200

    added new exception cinderclient.ConnectionError

    Introduced new exception cinderclient.ConnectionError
    with the change I37da522e812286e72706409b8a6d4652515f720f.

    Adding the exception cinderclient.ConnectionError to the
    RECOVERABLE list solves the issues described in the
    bug ##1207635.

    fixes bug #1207635

    Change-Id: I6b90343e79433fe554d84df1db65e096c8ed4423

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-1 → 2014.1
Changed in python-cinderclient:
milestone: none → 1.3.1
status: Fix Committed → Fix Released
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.