Unhandled exception in quota code leads to missing buttons

Bug #1491309 reported by Frode Nordahl
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Frode Nordahl

Bug Description

2015-09-02 09:22:20.600587 Error while checking action permissions.
2015-09-02 09:22:20.600607 Traceback (most recent call last):
2015-09-02 09:22:20.600610 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/base.py", line 1270, in _filter_action
2015-09-02 09:22:20.600624 return action._allowed(request, datum) and row_matched
2015-09-02 09:22:20.600626 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/tables/actions.py", line 135, in _allowed
2015-09-02 09:22:20.600628 self.allowed(request, datum))
2015-09-02 09:22:20.600642 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/project/networks/tables.py", line 94, in allowed
2015-09-02 09:22:20.600645 usages = quotas.tenant_quota_usages(request)
2015-09-02 09:22:20.600647 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/utils/memoized.py", line 90, in wrapped
2015-09-02 09:22:20.600649 value = cache[key] = func(*args, **kwargs)
2015-09-02 09:22:20.600651 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/usage/quotas.py", line 356, in tenant_quota_usages
2015-09-02 09:22:20.600654 tenant_id=tenant_id):
2015-09-02 09:22:20.600656 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/usage/quotas.py", line 166, in get_tenant_quota_data
2015-09-02 09:22:20.600659 tenant_id=tenant_id)
2015-09-02 09:22:20.600661 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/usage/quotas.py", line 148, in _get_quota_data
2015-09-02 09:22:20.600663 quotasets.append(getattr(cinder, method_name)(request, tenant_id))
2015-09-02 09:22:20.600666 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/api/cinder.py", line 418, in tenant_quota_get
2015-09-02 09:22:20.600669 return base.QuotaSet(c_client.quotas.get(tenant_id))
2015-09-02 09:22:20.600671 File "/usr/local/lib/python2.7/dist-packages/cinderclient/v2/quotas.py", line 37, in get
2015-09-02 09:22:20.600673 "quota_set")
2015-09-02 09:22:20.600675 File "/usr/local/lib/python2.7/dist-packages/cinderclient/base.py", line 173, in _get
2015-09-02 09:22:20.600677 resp, body = self.api.client.get(url)
2015-09-02 09:22:20.600679 File "/usr/local/lib/python2.7/dist-packages/cinderclient/client.py", line 305, in get
2015-09-02 09:22:20.600681 return self._cs_request(url, 'GET', **kwargs)
2015-09-02 09:22:20.600683 File "/usr/local/lib/python2.7/dist-packages/cinderclient/client.py", line 268, in _cs_request
2015-09-02 09:22:20.600685 **kwargs)
2015-09-02 09:22:20.600687 File "/usr/local/lib/python2.7/dist-packages/cinderclient/client.py", line 251, in request
2015-09-02 09:22:20.600690 raise exceptions.from_response(resp, body)
2015-09-02 09:22:20.600692 ClientException: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-85e49670-ce04-4fcb-9d3c-3282c2889723)

Changed in horizon:
assignee: nobody → Frode Nordahl (fnordahl)
status: New → In Progress
Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

I filed a related Cinder bug here https://bugs.launchpad.net/cinder/+bug/1491495

Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

For some reason, the CR wasn't posted here. Fixing it: https://review.openstack.org/#/c/219620/

Changed in horizon:
importance: Undecided → High
Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

Keystone hierarchical projects + the recent Cinder change at https://github.com/openstack/cinder/commit/8a7ab267a6bbd48fc5e9ccb91a1472cf1e017e3f#diff-03a7544f58abd38d6c39e9433b0c7017R138 seem to be the root cause of this bug.

Revision history for this message
Frode Nordahl (fnordahl) wrote :

Good job tracking that one down! I think we should implement proper error handling for this in Horizon nonetheless? Cinder may fail on volume quotas for other reasons.

Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

Yes, your fix still looks perfectly valid to me. Yet I don't know how is it better to detect that quotas are no longer visible for simple users :/.

David Lyle (david-lyle)
Changed in horizon:
milestone: none → liberty-rc1
Changed in horizon:
assignee: Frode Nordahl (fnordahl) → Amogh (amogh-r-mavinagidad)
Changed in horizon:
assignee: Amogh (amogh-r-mavinagidad) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/219620
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=4994df59ce1c72d0bb0002ac0bf2be8dd514a88e
Submitter: Jenkins
Branch: master

commit 4994df59ce1c72d0bb0002ac0bf2be8dd514a88e
Author: Frode Nordahl <email address hidden>
Date: Wed Sep 2 11:41:58 2015 +0200

    Fix unhandled exceptions from cinder in quota code

    Enclose calls to Cinder in try except blocks.

    Change-Id: Id8559f4936e8ed55078ddc839f2e9bc4ff4152fe
    Closes-Bug: 1491309

Changed in horizon:
status: In Progress → Fix Committed
Frode Nordahl (fnordahl)
Changed in horizon:
assignee: nobody → Frode Nordahl (fnordahl)
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: liberty-rc1 → 8.0.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.