cells v1: error when reporting child cell capacity: "TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'"

Bug #1648983 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
int32bit

Bug Description

http://logs.openstack.org/27/408727/3/check/gate-tempest-dsvm-cells-ubuntu-xenial/e788689/logs/screen-n-cell-child.txt.gz?level=TRACE

2016-12-09 21:25:50.743 23726 ERROR nova Traceback (most recent call last):
2016-12-09 21:25:50.743 23726 ERROR nova File "/usr/local/bin/nova-cells", line 10, in <module>
2016-12-09 21:25:50.743 23726 ERROR nova sys.exit(main())
2016-12-09 21:25:50.743 23726 ERROR nova File "/opt/stack/new/nova/nova/cmd/cells.py", line 43, in main
2016-12-09 21:25:50.743 23726 ERROR nova manager='nova.cells.manager.CellsManager')
2016-12-09 21:25:50.743 23726 ERROR nova File "/opt/stack/new/nova/nova/service.py", line 228, in create
2016-12-09 21:25:50.743 23726 ERROR nova periodic_interval_max=periodic_interval_max)
2016-12-09 21:25:50.743 23726 ERROR nova File "/opt/stack/new/nova/nova/service.py", line 101, in __init__
2016-12-09 21:25:50.743 23726 ERROR nova self.manager = manager_class(host=self.host, *args, **kwargs)
2016-12-09 21:25:50.743 23726 ERROR nova File "/opt/stack/new/nova/nova/cells/manager.py", line 82, in __init__
2016-12-09 21:25:50.743 23726 ERROR nova self.state_manager = cell_state_manager()
2016-12-09 21:25:50.743 23726 ERROR nova File "/opt/stack/new/nova/nova/cells/state.py", line 146, in __new__
2016-12-09 21:25:50.743 23726 ERROR nova return CellStateManagerDB(cell_state_cls)
2016-12-09 21:25:50.743 23726 ERROR nova File "/opt/stack/new/nova/nova/cells/state.py", line 162, in __init__
2016-12-09 21:25:50.743 23726 ERROR nova self._cell_data_sync(force=True)
2016-12-09 21:25:50.743 23726 ERROR nova File "/usr/local/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py", line 271, in inner
2016-12-09 21:25:50.743 23726 ERROR nova return f(*args, **kwargs)
2016-12-09 21:25:50.743 23726 ERROR nova File "/opt/stack/new/nova/nova/cells/state.py", line 453, in _cell_data_sync
2016-12-09 21:25:50.743 23726 ERROR nova self._update_our_capacity(ctxt)
2016-12-09 21:25:50.743 23726 ERROR nova File "/opt/stack/new/nova/nova/cells/state.py", line 285, in _update_our_capacity
2016-12-09 21:25:50.743 23726 ERROR nova _get_compute_hosts()
2016-12-09 21:25:50.743 23726 ERROR nova File "/opt/stack/new/nova/nova/cells/state.py", line 279, in _get_compute_hosts
2016-12-09 21:25:50.743 23726 ERROR nova free_disk = compute.free_disk_gb * 1024
2016-12-09 21:25:50.743 23726 ERROR nova TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
2016-12-09 21:25:50.743 23726 ERROR nova

Tags: cells
int32bit (int32bit)
Changed in nova:
assignee: nobody → int32bit (int32bit)
Revision history for this message
int32bit (int32bit) wrote :

I'm not really sure what the root cause is, but I think the most direct way is to check the value whether is None or not.

Changed in nova:
status: New → In Progress
Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/409501
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=58bf5d005394d2b31bab9e8971e765c35974ca07
Submitter: Jenkins
Branch: master

commit 58bf5d005394d2b31bab9e8971e765c35974ca07
Author: int32bit <email address hidden>
Date: Sun Dec 11 15:08:45 2016 +0800

    Fix error if free_disk_gb is None in CellStateManager

    The field 'free_disk_gb' in Objects.ComputeNode can be nullable.
    In CellStateManager._get_compute_hosts, we compute free_disk_mb
    by 'free_disk_gb * 1024'. If the free_disk_gb is None, it will raise
    a TypeError exception because None type can't multiply by an integer.
    We should check this value, and if it's None, we just let it return
    zero.

    Closes-Bug: #1648983

    Change-Id: I558d544ff838807c1d605cb5ed8d0e0fa97ab00e

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 15.0.0.0b3

This issue was fixed in the openstack/nova 15.0.0.0b3 development milestone.

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.