Hypervisors returns TemplateSyntaxError instead of error message

Bug #1392316 reported by Pawel Palucki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Pawel Palucki
Juno
Fix Released
Undecided
Alberto Planas

Bug Description

When trying to list hypervisor at /admin/hypervisors/
I got TemplateSyntaxError. It happens when novaclient (nova-api)
cannot fulfil the request.

The exception in Horizon:

Error while rendering table rows.
Traceback (most recent call last):
  File "/opt/stack/horizon/horizon/tables/base.py", line 1751, in get_rows
    for datum in self.filtered_data:
TypeError: 'NoneType' object is not iterable
Internal Server Error: /admin/hypervisors/
Traceback (most recent call last):
  ...
  File "/opt/stack/horizon/horizon/tables/base.py", line 1751, in get_rows
    for datum in self.filtered_data:
TemplateSyntaxError: 'NoneType' object is not iterable

IMO it should be more robust and just return error message. It would be more
consistent with how other views handles unavailable services.

To reproduce the error it is enough that novaclient raise exception. Example for this
is my case was when zookeeper as servicegroup driver is used, but
nova-conductor hasn't yet prepared the required namespace (because of bug [1]) - which
ends that nova-api had internal error:

nova.api.openstack ServiceGroupUnavailable: The service from servicegroup driver
ZooKeeperDriver is temporarily unavailable.

This overall result is that whole hypervisor list page was unaccessible only because is was not possible to list nova services.

[1] https://bugs.launchpad.net/nova/+bug/1389782

Changed in horizon:
assignee: nobody → Pawel Palucki (pawel-palucki-q)
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/134277

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

Reviewed: https://review.openstack.org/134277
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=5c4e827568be429ac5227a950c9f24c578ca8fd8
Submitter: Jenkins
Branch: master

commit 5c4e827568be429ac5227a950c9f24c578ca8fd8
Author: Pawel Palucki <email address hidden>
Date: Mon Nov 10 20:56:51 2014 +0100

    Fix TemplateSyntaxError at hypervisors view

    If somehow nova API service-list isn't available, listing
    hypervisors at /admin/hypervisors/ ends with TemplateSyntaxError.

    Expected result is that the page should load but user will
    see empty list and error message.

    This fix is based on idea found in other views:

    openstack_dashboard/dashboards/admin/...
    images/views.py
    aggregate/views.py
    falvors/views.pu

    that on any exception while getting data (get_data), we just
    return empty list and handle exception to display error message.

    Closes-Bug: #1392316

    Change-Id: Ia665111185abecab6a96e6c72a6088cf2fa2e02b

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
milestone: none → kilo-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-1 → 2015.1.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/200487

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/201368

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (stable/kilo)

Change abandoned by Lin Hua Cheng (<email address hidden>) on branch: stable/kilo
Review: https://review.openstack.org/201368
Reason: this was fixed in Kilo, wrong backport

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/juno)

Reviewed: https://review.openstack.org/200487
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=184f5a6380567e902b06e6013bdb2a757ff8c9b3
Submitter: Jenkins
Branch: stable/juno

commit 184f5a6380567e902b06e6013bdb2a757ff8c9b3
Author: Pawel Palucki <email address hidden>
Date: Mon Nov 10 20:56:51 2014 +0100

    Fix TemplateSyntaxError at hypervisors view

    If somehow nova API service-list isn't available, listing
    hypervisors at /admin/hypervisors/ ends with TemplateSyntaxError.

    Expected result is that the page should load but user will
    see empty list and error message.

    This fix is based on idea found in other views:

    openstack_dashboard/dashboards/admin/...
    images/views.py
    aggregate/views.py
    falvors/views.pu

    that on any exception while getting data (get_data), we just
    return empty list and handle exception to display error message.

    Closes-Bug: #1392316

    Change-Id: Ia665111185abecab6a96e6c72a6088cf2fa2e02b
    (cherry picked from commit 5c4e827568be429ac5227a950c9f24c578ca8fd8)

tags: added: in-stable-juno
Alan Pevec (apevec)
tags: removed: in-stable-juno
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.