[Openstack] nova error migrating with floating ips: 'FixedIP' object has no attribute '_sa_instance_state'

Noel Burton-Krahn noel at pistoncloud.com
Tue Jun 24 22:24:44 UTC 2014


This error happens in Icehouse migrating a vm with floating ips.  nova
tries to call save() on a floating_ip object, but the sqlalchemy context
appears broken:

In nova/nova/network/floating_ips.py, FloatingIP.migrate_instance_start()

floating_ip = floating_ip_obj.FloatingIP.get_by_address(context,
                                         address)
...
floating_ip.save()
Exception during message handling: 'FixedIP' object has no attribute
'_sa_instance_state'


The floating_ip object's context did appears to be a RequestContext object,
not a SQLAlchemy object

floating_ip.__dict__={'_address': IPAddress('10.35.4.6'), '_interface':
u'public', '_updated_at': datetime.datetime(2014, 6, 24, 20, 38, 28,
tzinfo=<iso8601.iso8601.Utc object at 0x7f97cad18e10>), '_context':
<nova.context.RequestContext object at 0x7f97cac4acd0>, '_auto_assigned':
False, '_pool': u'nova', '_deleted_at': None, '_deleted': False,
'_created_at': datetime.datetime(2014, 6, 24, 16, 14, 50,
tzinfo=<iso8601.iso8601.Utc object at 0x7f97cad18dd0>), '_fixed_ip_id': 10,
'_host': u'10.35.0.15', '_changed_fields': set([]), '_id': 6,
'_project_id': '96164da78025487daf0b7a20cb338939'}


I'm still working through why floating_ip_obj.FloatingIP.get_by_address()
may return an object that doesn't work.

Dan, does this ring any bells?


git show 5987c93b
commit 5987c93be4f10ce791c083219cc4b3dd5e4827b4
Author: Dan Smith <dansmith at redhat.com>
Date:   Fri Jan 17 13:15:23 2014 -0800

    Make floating_ips module use FloatingIP for updates

    This makes the network.floating_ips module use the FloatingIP
    object for saving updates instead of direct database calls.

    Related to blueprint nova-network-objects

    Change-Id: Ib34f4d5f24bcbd7aacd2fda3d793555fcc047dbc

diff --git a/nova/network/floating_ips.py b/nova/network/floating_ips.py
index e967536..0f3edc4 100644
--- a/nova/network/floating_ips.py
+++ b/nova/network/floating_ips.py
@@ -566,9 +566,8 @@ class FloatingIP(object):

             # NOTE(wenjianhn): Make this address will not be bound to
public
             # interface when restarts nova-network on dest compute node
-            self.db.floating_ip_update(context,
-                                       floating_ip.address,
-                                       {'host': None})
+            floating_ip.host = None
+            floating_ip.save()

     def migrate_instance_finish(self, context, instance_uuid,
                                 floating_addresses, host=None,
@@ -595,9 +594,8 @@ class FloatingIP(object):
                          {'address': address, 'instance_uuid':
instance_uuid})
                 continue

-            self.db.floating_ip_update(context,
-                                       floating_ip.address,
-                                       {'host': dest})
+            floating_ip.host = dest
+            floating_ip.save()

             interface = CONF.public_interface or floating_ip.interface
             fixed_ip = floating_ip.fixed_ip



Full traceback:

Jun 24 20:59:35 10.35.0.14 rabbitmq.log: accepting AMQP connection
<0.10363.5> (10.35.0.15:42504 -> 10.35.0.3:5672)
Jun 24 20:59:35 10.35.0.15 nova-network 2014-06-24 20:59:35.936 27982 INFO
oslo.messaging._drivers.impl_rabbit [-] Connected to AMQP server on
10.35.0.3:5672
Jun 24 20:59:35 10.35.0.15 nova-network.log:
/usr/lib64/python2.7/site-packages/amqp/channel.py:616:
VDeprecationWarning: The auto_delete flag for exchanges has been deprecated
and will be removed
Jun 24 20:59:35 10.35.0.15 nova-network.log: from py-amqp v1.5.0.
Jun 24 20:59:35 10.35.0.15 nova-network 2014-06-24 20:59:35.955 27982 INFO
nova.network.floating_ips [req-f320a425-522b-4122-a3fb-78d66a8e95f0
19c77ffc89f84c97a62f6ece6dcf0085 96164da78025487daf0b7a20cb338939] Starting
migration network for instance 538d6e98-a96b-4c77-bb7a-24f88e67b368
Jun 24 20:59:35 10.35.0.15 nova-network 2014-06-24 20:59:35.956 27982 INFO
nova.network.floating_ips [req-f320a425-522b-4122-a3fb-78d66a8e95f0
19c77ffc89f84c97a62f6ece6dcf0085 96164da78025487daf0b7a20cb338939]
floating_addresses=[u'10.35.4.6']
Jun 24 20:59:36 10.35.0.15 nova-network 2014-06-24 20:59:36.008 27982 INFO
nova.network.floating_ips [req-f320a425-522b-4122-a3fb-78d66a8e95f0
19c77ffc89f84c97a62f6ece6dcf0085 96164da78025487daf0b7a20cb338939]
floating_ip=<nova.objects.floating_ip.FloatingIP object at 0x7f97caceaad0>
Jun 24 20:59:36 10.35.0.15 nova-network 2014-06-24 20:59:36.008 27982 INFO
nova.network.floating_ips [req-f320a425-522b-4122-a3fb-78d66a8e95f0
19c77ffc89f84c97a62f6ece6dcf0085 96164da78025487daf0b7a20cb338939]
floating_ip.__dict__={'_address': IPAddress('10.35.4.6'), '_interface':
u'public', '_updated_at': datetime.datetime(2014, 6, 24, 20, 38, 28,
tzinfo=<iso8601.iso8601.Utc object at 0x7f97cad18e10>), '_context':
<nova.context.RequestContext object at 0x7f97cac4acd0>, '_auto_assigned':
False, '_pool': u'nova', '_deleted_at': None, '_deleted': False,
'_created_at': datetime.datetime(2014, 6, 24, 16, 14, 50,
tzinfo=<iso8601.iso8601.Utc object at 0x7f97cad18dd0>), '_fixed_ip_id': 10,
'_host': u'10.35.0.15', '_changed_fields': set([]), '_id': 6,
'_project_id': '96164da78025487daf0b7a20cb338939'}
Jun 24 20:59:36 10.35.0.15 sudo:     nova : TTY=unknown ; PWD=/ ; USER=root
; COMMAND=/usr/bin/nova-rootwrap /etc/nova/rootwrap.conf ip addr del
10.35.4.6/26 dev public
Jun 24 20:59:36 10.35.0.15 sudo:     nova : TTY=unknown ; PWD=/ ; USER=root
; COMMAND=/usr/bin/nova-rootwrap /etc/nova/rootwrap.conf iptables-save -c
Jun 24 20:59:36 10.35.0.15 sudo:     nova : TTY=unknown ; PWD=/ ; USER=root
; COMMAND=/usr/bin/nova-rootwrap /etc/nova/rootwrap.conf iptables-restore -c
Jun 24 20:59:36 10.35.0.15 sudo:     nova : TTY=unknown ; PWD=/ ; USER=root
; COMMAND=/usr/bin/nova-rootwrap /etc/nova/rootwrap.conf ebtables -t nat -D
PREROUTING --logical-in cloud -p ipv4 --ip-src 10.35.3.9 ! --ip-dst
10.35.3.0/24 -j redirect --redirect-target ACCEPT
Jun 24 20:59:36 10.35.0.15 sudo:     nova : TTY=unknown ; PWD=/ ; USER=root
; COMMAND=/usr/bin/nova-rootwrap /etc/nova/rootwrap.conf conntrack -D -r
10.35.3.9
Jun 24 20:59:36 10.35.0.15 nova-network 2014-06-24 20:59:36.415 27982 ERROR
oslo.messaging.rpc.dispatcher [-] Exception during message handling:
'FixedIP' object has no attribute '_sa_instance_state'
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher Traceback
(most recent call last):
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher   File
"/usr/lib64/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line
133, in _dispatch_and_reply
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher   File
"/usr/lib64/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line
176, in _dispatch
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher   File
"/usr/lib64/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line
122, in _do_dispatch
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher   File
"/usr/lib64/python2.7/site-packages/nova/network/floating_ips.py", line
586, in migrate_instance_start
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher
floating_ip.save()
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher   File
"/usr/lib64/python2.7/site-packages/nova/objects/base.py", line 151, in
wrapper
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher
return fn(self, ctxt, *args, **kwargs)
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher   File
"/usr/lib64/python2.7/site-packages/nova/objects/floating_ip.py", line 128,
in save
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher
updates)
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher   File
"/usr/lib64/python2.7/site-packages/nova/db/api.py", line 386, in
floating_ip_update
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher
return IMPL.floating_ip_update(context, address, values)
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher   File
"/usr/lib64/python2.7/site-packages/nova/db/sqlalchemy/api.py", line 164,
in wrapper
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher
return f(*args, **kwargs)
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher   File
"/usr/lib64/python2.7/site-packages/nova/db/sqlalchemy/api.py", line 1024,
in floating_ip_update
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher
float_ip_ref.update(values)
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher   File
"/usr/lib64/python2.7/site-packages/nova/openstack/common/db/sqlalchemy/models.py",
line 88, in update
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher
setattr(self, k, v)
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher   File
"/usr/lib64/python2.7/site-packages/sqlalchemy/orm/attributes.py", line
220, in __set__
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher   File
"/usr/lib64/python2.7/site-packages/sqlalchemy/orm/attributes.py", line
780, in set
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher   File
"/usr/lib64/python2.7/site-packages/sqlalchemy/orm/attributes.py", line
801, in fire_replace_event
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher   File
"/usr/lib64/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 83,
in set_
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher
AttributeError: 'FixedIP' object has no attribute '_sa_instance_state'
2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher
Jun 24 20:59:36 10.35.0.14 rabbitmq.log: =INFO REPORT====
24-Jun-2014::20:59:36 ===
Jun 24 20:59:36 10.35.0.14 rabbitmq.log: accepting AMQP connection
<0.10378.5> (10.35.0.15:42505 -> 10.35.0.3:5672)
Jun 24 20:59:36 10.35.0.15 nova-network 2014-06-24 20:59:36.439 27982 INFO
oslo.messaging._drivers.impl_rabbit [-] Connected to AMQP server on
10.35.0.3:5672
Jun 24 20:59:36 10.35.0.15 nova-network 2014-06-24 20:59:36.439 27982 ERROR
oslo.messaging._drivers.common [-] Returning exception 'FixedIP' object has
no attribute '_sa_instance_state' to caller
Jun 24 20:59:36 10.35.0.15 nova-network 2014-06-24 20:59:36.439 27982 ERROR
oslo.messaging._drivers.common [-] ['Traceback (most recent call last):\n',
'  File
"/usr/lib64/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line
133, in _dispatch_and_reply\n', '  File
"/usr/lib64/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line
176, in _dispatch\n', '  File
"/usr/lib64/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line
122, in _do_dispatch\n', '  File
"/usr/lib64/python2.7/site-packages/nova/network/floating_ips.py", line
586, in migrate_instance_start\n    floating_ip.save()\n', '  File
"/usr/lib64/python2.7/site-packages/nova/objects/base.py", line 151, in
wrapper\n    return fn(self, ctxt, *args, **kwargs)\n', '  File
"/usr/lib64/python2.7/site-packages/nova/objects/floating_ip.py", line 128,
in save\n    updates)\n', '  File
"/usr/lib64/python2.7/site-packages/nova/db/api.py", line 386, in
floating_ip_update\n    return IMPL.floating_ip_update(context, address,
values)\n', '  File
"/usr/lib64/python2.7/site-packages/nova/db/sqlalchemy/api.py", line 164,
in wrapper\n    return f(*args, **kwargs)\n', '  File
"/usr/lib64/python2.7/site-packages/nova/db/sqlalchemy/api.py", line 1024,
in floating_ip_update\n    float_ip_ref.update(values)\n', '  File
"/usr/lib64/python2.7/site-packages/nova/openstack/common/db/sqlalchemy/models.py",
line 88, in update\n    setattr(self, k, v)\n', '  File
"/usr/lib64/python2.7/site-packages/sqlalchemy/orm/attributes.py", line
220, in __set__\n', '  File
"/usr/lib64/python2.7/site-packages/sqlalchemy/orm/attributes.py", line
780, in set\n', '  File
"/usr/lib64/python2.7/site-packages/sqlalchemy/orm/attributes.py", line
801, in fire_replace_event\n', '  File
"/usr/lib64/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 83,
in set_\n', "AttributeError: 'FixedIP' object has no attribute
'_sa_instance_state'\n"]
Jun 24 20:59:36 10.35.0.15 nova-network.log:
/usr/lib64/python2.7/site-packages/amqp/channel.py:616:
VDeprecationWarning: The auto_delete flag for exchanges has been deprecated
and will be removed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20140624/202f510c/attachment.html>


More information about the Openstack mailing list