cells AttributeError with compute api methods using new object access style

Bug #1290975 reported by Andrew Laski
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Andrew Laski
Kilo
Fix Released
High
Andrew Laski

Bug Description

The nova-cells service looks up instances locally before passing them to the local compute api, and only converts them to objects if the compute api method is explicitly listed in the run_compute_api method. There is in fact a FIXME around this process, but it appears to not have been addressed yet :)

2014-03-10 17:27:59.881 30193 ERROR nova.cells.messaging [req-3e27c8c0-6b3c-482d-bb9b-d638933ec949 10226892 5915610] Error processing message locally: 'dict' object has no attribute 'metadata'
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging Traceback (most recent call last):
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging File "/opt/rackstack/615.0/nova/lib/python2.6/site-packages/nova/cells/messaging.py", line 211, in _process_locally
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging resp_value = self.msg_runner._process_message_locally(self)
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging File "/opt/rackstack/615.0/nova/lib/python2.6/site-packages/nova/cells/messaging.py", line 1290, in _process_message_locally
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging return fn(message, **message.method_kwargs)
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging File "/opt/rackstack/615.0/nova/lib/python2.6/site-packages/nova/cells/messaging.py", line 706, in run_compute_api_method
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging return fn(message.ctxt, *args, **method_info['method_kwargs'])
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging File "/opt/rackstack/615.0/nova/lib/python2.6/site-packages/nova/compute/api.py", line 199, in wrapped
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging return func(self, context, target, *args, **kwargs)
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging File "/opt/rackstack/615.0/nova/lib/python2.6/site-packages/nova/compute/api.py", line 189, in inner
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging return function(self, context, instance, *args, **kwargs)
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging File "/opt/rackstack/615.0/nova/lib/python2.6/site-packages/nova/compute/api.py", line 170, in inner
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging return f(self, context, instance, *args, **kw)
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging File "/opt/rackstack/615.0/nova/lib/python2.6/site-packages/nova/compute/api.py", line 2988, in update_instance_metadata
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging orig = dict(instance.metadata)
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging AttributeError: 'dict' object has no attribute 'metadata'
2014-03-10 17:27:59.881 30193 TRACE nova.cells.messaging

Andrew Laski (alaski)
Changed in nova:
assignee: nobody → Andrew Laski (alaski)
status: New → Triaged
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/79741

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

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

Revision history for this message
Andrew Laski (alaski) wrote :

This bug does not keep metadata from being set for an instance, but it prevents it from getting sent to the virt driver for proper handling. In the case of xenserver it means the metadata isn't set in xenstore for the guest to read.

Changed in nova:
importance: Undecided → Medium
Andrew Laski (alaski)
tags: added: cells icehouse-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit dd3f7cddd380205c26e5e2b9e2002d773eab9047
Author: Andrew Laski <email address hidden>
Date: Wed Mar 12 13:24:25 2014 -0400

    Cells: Pass instance objects to update/delete_instance_metadata

    When nova-cells processes a 'run_compute_api_method' message it pulls
    the instance from the local db and calls the appropriate compute api
    method with a sqlalchemy model. Since the update_instance_metadata and
    delete_instance_metadata methods in the compute api require objects
    these methods are added to the list of methods that will receive an
    object.

    Change-Id: Iaa5ba6878f0162e2fab8dd3e4b87ea8dd3d527f6
    Closes-bug: #1290975

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-rc1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-rc1 → 2014.1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Andrew Laski (<email address hidden>) on branch: master
Review: https://review.openstack.org/79741

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

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

commit ca908166dbfc311715e9e10449eb5e93add66a30
Author: Andrew Laski <email address hidden>
Date: Tue Mar 11 15:28:57 2014 -0400

    Cells: Call compute api methods with instance objects

    When nova-cells processes a 'run_compute_api_method' message it pulls
    the instance from the local db and calls the appropriate compute api
    method with a sqlalchemy model. Instead it should populate an instance
    object and pass that in.

    Change-Id: Ib4fb46310c2a2c1edf378ed3a3fd42421ff4cb47
    Closes-bug: #1290975

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Change abandoned by Matt Riedemann (<email address hidden>) on branch: stable/kilo
Review: https://review.openstack.org/286773
Reason: alaski beat me to it:

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

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

Reviewed: https://review.openstack.org/286772
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=1f7a2dd54157bfde6bf0f4135f4c9fe2c93f0e9b
Submitter: Jenkins
Branch: stable/kilo

commit 1f7a2dd54157bfde6bf0f4135f4c9fe2c93f0e9b
Author: Andrew Laski <email address hidden>
Date: Tue Mar 11 15:28:57 2014 -0400

    Cells: Call compute api methods with instance objects

    When nova-cells processes a 'run_compute_api_method' message it pulls
    the instance from the local db and calls the appropriate compute api
    method with a sqlalchemy model. Instead it should populate an instance
    object and pass that in.

    Change-Id: Ib4fb46310c2a2c1edf378ed3a3fd42421ff4cb47
    Closes-bug: #1290975
    (cherry picked from commit ca908166dbfc311715e9e10449eb5e93add66a30)

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/nova 2015.1.4

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.