Completely disabled availability zone cause horizon to trace at availability zones list

Bug #1297920 reported by George Shuklin
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Santiago Baldassin
Havana
Fix Released
Medium
George Shuklin
Icehouse
Fix Released
Medium
Adrien Cunin

Bug Description

If all compute nodes in some availability zone are disabled, horizon trace at availability zones list.

Steps to reproduce:

1. Create host aggregate and availability zone (nova aggreage-create some some)
2. Add some (at least one) host to that host aggregate (nova aggreage-add-host some compute_host)
3. Disable service at all compute_hosts (nova service-disable compute_host nova-compute)
4. Go to (in dashboard) Admin -> System Info -> Availability Zones

Expected result:

Output with list of availabilizy zones

Actual Result:

TemplateSyntaxError at /admin/info/

'NoneType' object has no attribute 'items'

Request Method: GET
Request URL: http://dashboard.local/horizon/admin/info/
Django Version: 1.5.4
Exception Type: TemplateSyntaxError
Exception Value:

'NoneType' object has no attribute 'items'

Exception Location: /usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/admin/info/tables.py in get_hosts, line 60
Python Executable: /usr/bin/python
Python Version: 2.7.3
Python Path:

['/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../..',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/share/openstack-dashboard/',
 '/usr/share/openstack-dashboard/openstack_dashboard']

Server time: Wed, 26 Mar 2014 15:53:32 +0000

P. S.
+------------------+------+-----------+----------+-------+----------------------------+-----------------+
| Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+------------------+------+-----------+----------+-------+----------------------------+-----------------+
| nova-scheduler | pp1 | internal | enabled | up | 2014-03-26T15:54:34.000000 | None |
| nova-consoleauth | pp1 | internal | enabled | up | 2014-03-26T15:54:32.000000 | None |
| nova-conductor | pp1 | internal | enabled | up | 2014-03-26T15:54:39.000000 | None |
| nova-cert | pp1 | internal | enabled | up | 2014-03-26T15:54:35.000000 | None |
| nova-compute | pp7 | test,nova | disabled | up | 2014-03-26T15:54:34.000000 | None |
| nova-compute | pp4 | nova | enabled | up | 2014-03-26T15:54:33.000000 | None |
| nova-compute | pp3 | nova | enabled | up | 2014-03-26T15:54:39.000000 | None |
+------------------+------+-----------+----------+-------+----------------------------+-----------------+

description: updated
Changed in horizon:
assignee: nobody → Santiago Baldassin (santiago-b-baldassin)
Changed in horizon:
status: New → In Progress
Akihiro Motoki (amotoki)
Changed in horizon:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/83651
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=7f30ab5124618c5b11eebf9c6d69bcfd8a47adc3
Submitter: Jenkins
Branch: master

commit 7f30ab5124618c5b11eebf9c6d69bcfd8a47adc3
Author: Santiago Baldassin <email address hidden>
Date: Fri Mar 28 00:11:07 2014 -0300

    Check host is not none in host aggregate page

    Check that host is not none before trying to parse
    the services that are up in each availability zone

    Change-Id: I757f35ca2fa84da3441b544280c1c430bf3e8fb8
    Closes-Bug: #1297920

Changed in horizon:
status: In Progress → Fix Committed
Adrien Cunin (adri2000)
tags: added: icehouse-backport-potential
Julie Pichon (jpichon)
Changed in horizon:
milestone: none → juno-1
Revision history for this message
George Shuklin (george-shuklin) wrote :

Please do not forget havana, which is affected too. Thanks.

Revision history for this message
Julie Pichon (jpichon) wrote :

Hi George, thanks for the comment. Anyone is welcome to add the "backport potential" tag for a release to a bug, if they think it would be a good backport candidate (see https://wiki.openstack.org/wiki/StableBranch#Appropriate_Fixes for some of the considerations to keep in mind). Cheers!

tags: added: havana-backport-potential
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix proposed to horizon (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/88596

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to horizon (stable/icehouse)

Reviewed: https://review.openstack.org/88596
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=306c5ca86c149a864692bb311488ef8ab08d1c27
Submitter: Jenkins
Branch: stable/icehouse

commit 306c5ca86c149a864692bb311488ef8ab08d1c27
Author: Santiago Baldassin <email address hidden>
Date: Fri Mar 28 00:11:07 2014 -0300

    Check host is not none in host aggregate page

    Check that host is not none before trying to parse
    the services that are up in each availability zone

    Change-Id: I757f35ca2fa84da3441b544280c1c430bf3e8fb8
    Closes-Bug: #1297920
    (cherry picked from commit 7f30ab5124618c5b11eebf9c6d69bcfd8a47adc3)

Revision history for this message
Adrien Cunin (adri2000) wrote :

George, I don't have an Havana cloud available to test this right now. If you can test and make sure the patch works correctly in Havana, tell me and I will propose the patch for backport.

Revision history for this message
George Shuklin (george-shuklin) wrote :

I afraid it's not directly applicable. I've try to apply https://review.openstack.org/gitweb?p=openstack/horizon.git;a=patch;h=306c5ca86c149a864692bb311488ef8ab08d1c27

But I can't find aggregates directory in openstash_dashboard.

Grep for some lines from patch get the file openstack_dashboard/dashboards/admin/info/tables.py instead of openstack_dashboard/dashboards/admin/aggregates/tables.py

By mangling patch to use 'info' instead 'aggregates', i've got:
patch -p1 < /tmp/patch
patching file openstack_dashboard/dashboards/admin/info/tables.py
Hunk #1 succeeded at 57 with fuzz 1 (offset -27 lines).

... and it works! For havanna.

I'm not familiar with patch submssion procedure, but here patch (adopted from link above):
https://gist.github.com/anonymous/11174357

Revision history for this message
Julie Pichon (jpichon) wrote :

George, you can find the contribution guidelines at http://wiki.openstack.org/HowToContribute

More specifically, the procedure for proposing a backport is described here: https://wiki.openstack.org/wiki/StableBranch#Proposing_Fixes

If you have any question or hit an issue, feel free to drop by #openstack-horizon on IRC, people are usually happy to help.

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix proposed to horizon (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/89569

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

Reviewed: https://review.openstack.org/89569
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=6027a9558c4997cba2eb8ecd93e5cb7138b7510d
Submitter: Jenkins
Branch: stable/havana

commit 6027a9558c4997cba2eb8ecd93e5cb7138b7510d
Author: George Shuklin <email address hidden>
Date: Tue Apr 22 18:31:42 2014 +0300

    Check host is not none in each availability zone

    Check that host is not none before trying to parse the services that
    are up in each availability zone

    Change-Id: I757f35ca2fa84da3441b544280c1c430bf3e8fb8
    Closes-Bug: #1297920
    (adopted from commit 7f30ab5124618c5b11eebf9c6d69bcfd8a47adc3,
    change path from 'dashboards/admin/aggregate' to
    'dashboards/admin/info')
    Original fix by Santiago Baldassin <email address hidden>

Thierry Carrez (ttx)
Changed in horizon:
milestone: juno-1 → 2014.2
Yaguang Tang (heut2008)
tags: removed: havana-backport-potential icehouse-backport-potential
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.