<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"><div>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:</div>
<div><br></div><div>In nova/nova/network/floating_ips.py, FloatingIP.migrate_instance_start()</div><div><br></div></div><blockquote style="font-family:arial,sans-serif;font-size:13.333333969116211px;margin:0px 0px 0px 40px;border:none;padding:0px">
<div>floating_ip = floating_ip_obj.FloatingIP.get_by_address(context, address)</div><div>...</div><div>floating_ip.save()</div><div>Exception during message handling: 'FixedIP' object has no attribute '_sa_instance_state'</div>
</blockquote><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"><div><br></div><div>The floating_ip object's context did appears to be a RequestContext object, not a SQLAlchemy object</div><div><br>
</div></div><blockquote style="font-family:arial,sans-serif;font-size:13.333333969116211px;margin:0px 0px 0px 40px;border:none;padding:0px">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'}</blockquote>
<div style><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">I'm still working through why floating_ip_obj.FloatingIP.get_by_address() may return an object that doesn't work.</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">Dan, does this ring any bells?<br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">
<br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">git show 5987c93b</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">
commit 5987c93be4f10ce791c083219cc4b3dd5e4827b4</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">Author: Dan Smith <<a href="mailto:dansmith@redhat.com" target="_blank">dansmith@redhat.com</a>></div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px">Date: Fri Jan 17 13:15:23 2014 -0800</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">
Make floating_ips module use FloatingIP for updates</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> </div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> This makes the network.floating_ips module use the FloatingIP</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> object for saving updates instead of direct database calls.</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> </div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> Related to blueprint nova-network-objects</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> </div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">
Change-Id: Ib34f4d5f24bcbd7aacd2fda3d793555fcc047dbc</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">diff --git a/nova/network/floating_ips.py b/nova/network/floating_ips.py</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px">index e967536..0f3edc4 100644</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">--- a/nova/network/floating_ips.py</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px">+++ b/nova/network/floating_ips.py</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">@@ -566,9 +566,8 @@ class FloatingIP(object):</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> </div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> # NOTE(wenjianhn): Make this address will not be bound to public</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> # interface when restarts nova-network on dest compute node</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">
- self.db.floating_ip_update(context,</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">- floating_ip.address,</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">
- {'host': None})</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">+ floating_ip.host = None</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">
+ floating_ip.save()</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> </div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> def migrate_instance_finish(self, context, instance_uuid,</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> floating_addresses, host=None,</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">@@ -595,9 +594,8 @@ class FloatingIP(object):</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> {'address': address, 'instance_uuid': instance_uuid})</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">
continue</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> </div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">- self.db.floating_ip_update(context,</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px">- floating_ip.address,</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">- {'host': dest})</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px">+ floating_ip.host = dest</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">+ floating_ip.save()</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> </div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> interface = CONF.public_interface or floating_ip.interface</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px"> fixed_ip = floating_ip.fixed_ip</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">
<br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">Full traceback:</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">
<br></div><div style><div style><font face="arial, sans-serif">Jun 24 20:59:35 10.35.0.14 rabbitmq.log: accepting AMQP connection <0.10363.5> (<a href="http://10.35.0.15:42504">10.35.0.15:42504</a> -> <a href="http://10.35.0.3:5672">10.35.0.3:5672</a>)</font></div>
<div style><font face="arial, sans-serif">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 <a href="http://10.35.0.3:5672">10.35.0.3:5672</a></font></div>
<div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">Jun 24 20:59:35 10.35.0.15 nova-network.log: from py-amqp v1.5.0.</font></div><div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">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']</font></div>
<div style><font face="arial, sans-serif">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></font></div>
<div style><font face="arial, sans-serif">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'}</font></div>
<div style><font face="arial, sans-serif">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 <a href="http://10.35.4.6/26">10.35.4.6/26</a> dev public</font></div>
<div style><font face="arial, sans-serif">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</font></div><div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">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 <a href="http://10.35.3.0/24">10.35.3.0/24</a> -j redirect --redirect-target ACCEPT</font></div>
<div style><font face="arial, sans-serif">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</font></div><div style>
<font face="arial, sans-serif">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'</font></div>
<div style><font face="arial, sans-serif">2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher Traceback (most recent call last):</font></div><div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher floating_ip.save()</font></div><div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher return fn(self, ctxt, *args, **kwargs)</font></div><div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher updates)</font></div><div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher return IMPL.floating_ip_update(context, address, values)</font></div><div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher return f(*args, **kwargs)</font></div><div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher float_ip_ref.update(values)</font></div><div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher setattr(self, k, v)</font></div><div style><font face="arial, sans-serif">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__</font></div>
<div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">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_</font></div>
<div style><font face="arial, sans-serif">2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher AttributeError: 'FixedIP' object has no attribute '_sa_instance_state'</font></div><div style><font face="arial, sans-serif">2014-06-24 20:59:36.415 27982 TRACE oslo.messaging.rpc.dispatcher </font></div>
<div style><font face="arial, sans-serif">Jun 24 20:59:36 10.35.0.14 rabbitmq.log: =INFO REPORT==== 24-Jun-2014::20:59:36 ===</font></div><div style><font face="arial, sans-serif">Jun 24 20:59:36 10.35.0.14 rabbitmq.log: accepting AMQP connection <0.10378.5> (<a href="http://10.35.0.15:42505">10.35.0.15:42505</a> -> <a href="http://10.35.0.3:5672">10.35.0.3:5672</a>)</font></div>
<div style><font face="arial, sans-serif">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 <a href="http://10.35.0.3:5672">10.35.0.3:5672</a></font></div>
<div style><font face="arial, sans-serif">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</font></div>
<div style><font face="arial, sans-serif">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"]</font></div>
<div style><font face="arial, sans-serif">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</font></div>
</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></div></div></div>