BandwidthUsage object has no attribute 'instance_uuid'

Bug #1463039 reported by Bob Ball
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Andrew Laski

Bug Description

XenServer CI is hitting the following issue (e.g. http://dd6b71949550285df7dc-dda4e480e005aaa13ec303551d2d8155.r49.cf1.rackcdn.com/64/188764/2/137/index.html)

Traceback (most recent call last):
  File "/opt/stack/new/nova/nova/compute/manager.py", line 6037, in _error_out_instance_on_exception
    yield
  File "/opt/stack/new/nova/nova/compute/manager.py", line 2658, in rebuild_instance
    extra_usage_info=extra_usage_info)
  File "/opt/stack/new/nova/nova/compute/utils.py", line 270, in notify_usage_exists
    ignore_missing_network_data)
  File "/opt/stack/new/nova/nova/notifications.py", line 316, in bandwidth_usage
    audit_start)
  File "/opt/stack/new/nova/nova/objects/base.py", line 833, in wrapper
    return fn.__get__(None, obj)(*args, **kwargs)
  File "/opt/stack/new/nova/nova/objects/base.py", line 158, in wrapper
    args, kwargs)
  File "/opt/stack/new/nova/nova/conductor/rpcapi.py", line 261, in object_class_action
    objver=objver, args=args, kwargs=kwargs)
  File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/client.py", line 156, in call
    retry=self.retry)
  File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/transport.py", line 90, in _send
    timeout=timeout, retry=retry)
  File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py", line 361, in send
    retry=retry)
  File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py", line 352, in _send
    raise result
AttributeError: 'BandwidthUsage' object has no attribute 'instance_uuid'
Traceback (most recent call last):
  File "/opt/stack/new/nova/nova/conductor/manager.py", line 436, in _object_dispatch
    return getattr(target, method)(*args, **kwargs)
  File "/opt/stack/new/nova/nova/objects/base.py", line 833, in wrapper
    return fn.__get__(None, obj)(*args, **kwargs)
  File "/opt/stack/new/nova/nova/objects/base.py", line 160, in wrapper
    result = fn(cls, context, *args, **kwargs)
  File "/opt/stack/new/nova/nova/objects/bandwidth_usage.py", line 88, in get_by_uuids
    return base.obj_make_list(context, cls(), BandwidthUsage, db_bw_usages)
  File "/opt/stack/new/nova/nova/objects/base.py", line 811, in obj_make_list
    **extra_args)
  File "/opt/stack/new/nova/nova/objects/bandwidth_usage.py", line 40, in _from_db_object
    bw_usage[field] = db_bw_usage[field]
  File "/usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/models.py", line 54, in __getitem__
    return getattr(self, key)
AttributeError: 'BandwidthUsage' object has no attribute 'instance_uuid'

Also seen in the periodic task:
2015-06-05 15:26:32.219 ERROR nova.openstack.common.periodic_task [req-a13743a2-7ca0-4865-a237-6aba08e704fb None None] Error during ComputeManager._poll_bandwidth_usage: 'NoneType' object has no attribute '__getitem__'
Traceback (most recent call last):
  File "/opt/stack/new/nova/nova/conductor/manager.py", line 436, in _object_dispatch
    return getattr(target, method)(*args, **kwargs)
  File "/opt/stack/new/nova/nova/objects/base.py", line 831, in wrapper
    return fn(obj, *args, **kwargs)
  File "/opt/stack/new/nova/nova/objects/base.py", line 205, in wrapper
    return fn(self, *args, **kwargs)
  File "/opt/stack/new/nova/nova/objects/bandwidth_usage.py", line 65, in create
    self._from_db_object(self._context, self, db_bw_usage)
  File "/opt/stack/new/nova/nova/objects/bandwidth_usage.py", line 40, in _from_db_object
    bw_usage[field] = db_bw_usage[field]
TypeError: 'NoneType' object has no attribute '__getitem__'

Bob Ball (bob-ball)
affects: bagpipe-l2 → nova
tags: added: xenserver
Bob Ball (bob-ball)
description: updated
Revision history for this message
Bob Ball (bob-ball) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/189397

Changed in nova:
assignee: nobody → Andrew Laski (alaski)
status: New → In Progress
Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → High
tags: added: kilo-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit f99af38cade764445fe7a40b4763293a0f91b514
Author: Andrew Laski <email address hidden>
Date: Mon Jun 8 13:23:36 2015 -0400

    Map uuid db field to instance_uuid in BandwidthUsage object

    The BandwidthUsage database model stores the instance relation as 'uuid'
    but the BandwidthUsage Nova Object stores it as instance_uuid. The
    _from_db_object needs to handle this discrepancy.

    This wasn't caught before because unit tests were passing back a
    simulated db return which didn't match reality.

    Change-Id: I9aeac709cbbf0f9ddfa6cf724d55af8fa3a962ee
    Closes-Bug: 1463039

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-1 → 12.0.0
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.