AttributeError: 'BlockDeviceMapping' object has no attribute 'uuid'

Bug #1726871 reported by Vladislav Belogrudov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Matt Riedemann
Pike
Fix Committed
High
Matt Riedemann

Bug Description

running Pike, Cinder is configured with disabled NAS security and enabled snapshots in NFS driver.

While trying to make a snapshot nova-api reports:

2017-10-24 13:36:16.558 39 INFO nova.osapi_compute.wsgi.server [req-e6c3dec2-40ea-4858-af91-3d77395d6978 6f4347f3c1b34d69946b17592aaf5b7f aeb3218c5fdc4d58b1094a4d360a2a96 - default default] 10.196.245.222,10.196.245.203 "GET /v2.1/ HTTP/1.1" status: 200 len: 763 time: 0.0097859
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions [req-cb2a54c0-6103-41ca-a5dc-587e301bfbb1 6f4347f3c1b34d69946b17592aaf5b7f aeb3218c5fdc4d58b1094a4d360a2a96 - default default] Unexpected exception in API method: AttributeError: 'BlockDeviceMapping' object has no attribute 'uuid'
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions Traceback (most recent call last):
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions File "/var/lib/kolla/venv/lib/python2.7/site-packages/nova/api/openstack/extensions.py", line 336, in wrapped
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions return f(*args, **kwargs)
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions File "/var/lib/kolla/venv/lib/python2.7/site-packages/nova/api/validation/__init__.py", line 108, in wrapper
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions return func(*args, **kwargs)
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions File "/var/lib/kolla/venv/lib/python2.7/site-packages/nova/api/openstack/compute/assisted_volume_snapshots.py", line 52, in create
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions create_info)
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions File "/var/lib/kolla/venv/lib/python2.7/site-packages/nova/compute/api.py", line 4165, in volume_snapshot_create
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions return do_volume_snapshot_create(self, context, bdm.instance)
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions File "/var/lib/kolla/venv/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 67, in getter
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions self.obj_load_attr(name)
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions File "/var/lib/kolla/venv/lib/python2.7/site-packages/nova/objects/block_device.py", line 288, in obj_load_attr
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions 'uuid': self.uuid,
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions AttributeError: 'BlockDeviceMapping' object has no attribute 'uuid'
2017-10-24 13:36:17.315 39 ERROR nova.api.openstack.extensions
2017-10-24 13:36:17.317 39 INFO nova.api.openstack.wsgi [req-cb2a54c0-6103-41ca-a5dc-587e301bfbb1 6f4347f3c1b34d69946b17592aaf5b7f aeb3218c5fdc4d58b1094a4d360a2a96 - default default] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<type 'exceptions.AttributeError'>

Tags: api
Revision history for this message
Matt Riedemann (mriedem) wrote :

Yup the problem is right here, and it's been around since 2014:

https://github.com/openstack/nova/blob/16.0.0/nova/objects/block_device.py#L291

The regression that hits it is this:

https://review.openstack.org/#/c/429476/

Before that, that code didn't lazy-load bdm.instance and hit that code. And it would only fail if you're running nova-api with debug logging enabled (which isn't uncommon really).

Apparently we aren't hitting this in CI - probably because we don't gate on the NFS job.

tags: added: api
Changed in nova:
status: New → Triaged
assignee: nobody → Matt Riedemann (mriedem)
importance: Undecided → High
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/514825

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

Reviewed: https://review.openstack.org/514825
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=1ca191fcc4d809c991c23dedc951bbe7206edf1d
Submitter: Zuul
Branch: master

commit 1ca191fcc4d809c991c23dedc951bbe7206edf1d
Author: Matt Riedemann <email address hidden>
Date: Tue Oct 24 16:45:57 2017 -0400

    Fix AttributeError in BlockDeviceMapping.obj_load_attr

    The BDM has no uuid attribute so the debug message in here
    would result in an AttributeError. This has been around since
    the creation of this object, and the debug log message was
    probably copied from the Instance object.

    This was only exposed in Pike when this code started
    lazy-loading the instance field:

      I1dc54a38f02bb48921bcbc4c2fdcc2c946e783c1

    So this change fixes that bug and adds tests for obj_load_attr.

    Change-Id: I8b55227b1530a76c2f396c035384abd89237d936
    Closes-Bug: #1726871

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/515404

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

Reviewed: https://review.openstack.org/515404
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=4e93523fbce953228be276aca0f70a53fcaaad14
Submitter: Zuul
Branch: stable/pike

commit 4e93523fbce953228be276aca0f70a53fcaaad14
Author: Matt Riedemann <email address hidden>
Date: Tue Oct 24 16:45:57 2017 -0400

    Fix AttributeError in BlockDeviceMapping.obj_load_attr

    The BDM has no uuid attribute so the debug message in here
    would result in an AttributeError. This has been around since
    the creation of this object, and the debug log message was
    probably copied from the Instance object.

    This was only exposed in Pike when this code started
    lazy-loading the instance field:

      I1dc54a38f02bb48921bcbc4c2fdcc2c946e783c1

    So this change fixes that bug and adds tests for obj_load_attr.

    Change-Id: I8b55227b1530a76c2f396c035384abd89237d936
    Closes-Bug: #1726871
    (cherry picked from commit 1ca191fcc4d809c991c23dedc951bbe7206edf1d)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 16.0.3

This issue was fixed in the openstack/nova 16.0.3 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 17.0.0.0b2

This issue was fixed in the openstack/nova 17.0.0.0b2 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.