That is odd, in mysql, with_lockmode is supposed to row lock and the ip should not be returned on the next query. Perhaps there is some other race condition occurring? On Sep 2, 2011, at 11:46 AM, Brian Lamar wrote: > My suspicion here is that fixed_ip_associate_pool is failing when being > called in quick succession aka at the 'same time'. I believe this is > what "with_lockmode" is supposed to prevent...but the SQLAlchemy > documentation is very poor in this area. > > We're using InnoDB tables are being used. > > -- > You received this bug notification because you are a member of Nova Bug > Team, which is subscribed to OpenStack Compute (nova). > https://bugs.launchpad.net/bugs/838581 > > Title: > 'NoneType' object has no attribute '_keymap' on xenserver instance > build > > Status in OpenStack Compute (Nova): > New > > Bug description: > Running rev 1514, getting this on instance build in XenServer. > > 2011-09-01 02:38:04,374 ERROR nova.rpc [-] Exception during message handling > (nova.rpc): TRACE: Traceback (most recent call last): > (nova.rpc): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc/impl_kombu.py", line 620, in _process_data > (nova.rpc): TRACE: rval = node_func(context=ctxt, **node_args) > (nova.rpc): TRACE: File "/usr/lib/pymodules/python2.6/nova/exception.py", line 98, in wrapped > (nova.rpc): TRACE: return f(*args, **kw) > (nova.rpc): TRACE: File "/usr/lib/pymodules/python2.6/nova/compute/manager.py", line 453, in run_instance > (nova.rpc): TRACE: self._run_instance(context, instance_id, **kwargs) > (nova.rpc): TRACE: File "/usr/lib/pymodules/python2.6/nova/compute/manager.py", line 392, in _run_instance > (nova.rpc): TRACE: requested_networks=requested_networks) > (nova.rpc): TRACE: File "/usr/lib/pymodules/python2.6/nova/network/api.py", line 162, in allocate_for_instance > (nova.rpc): TRACE: 'args': args}) > (nova.rpc): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc/__init__.py", line 45, in call > (nova.rpc): TRACE: return get_impl().call(context, topic, msg) > (nova.rpc): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc/impl_kombu.py", line 739, in call > (nova.rpc): TRACE: rv = list(rv) > (nova.rpc): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc/impl_kombu.py", line 703, in __iter__ > (nova.rpc): TRACE: raise result > (nova.rpc): TRACE: RemoteError: AttributeError 'NoneType' object has no attribute '_keymap' > (nova.rpc): TRACE: [u'Traceback (most recent call last):\n', u' File "/usr/lib/pymodules/python2.6/nova/rpc/impl_kombu.py", line 620, in _process_data\n rval = node_func(context=ctxt, **node_args)\n', u' File "/usr/lib/pymodules/python2.6/nova/network/manager.py", line 462, in allocate_for_instance\n networks, vpn=vpn)\n', u' File "/usr/lib/pymodules/python2.6/nova/network/manager.py", line 971, in _allocate_fixed_ips_hack\n self.allocate_fixed_ip(context, instance_id, nw)\n', u' File "/usr/lib/pymodules/python2.6/nova/network/manager.py", line 653, in allocate_fixed_ip\n instance_id)\n', u' File "/usr/lib/pymodules/python2.6/nova/db/api.py", line 343, in fixed_ip_associate_pool\n instance_id, host)\n', u' File "/usr/lib/pymodules/python2.6/nova/db/sqlalchemy/api.py", line 100, in wrapper\n return f(*args, **kwargs)\n', u' File "/usr/lib/pymodules/python2.6/nova/db/sqlalchemy/api.py", line 714, in fixed_ip_associate_pool\n with_lockmode(\'update\').\\\n', u' File "/usr/lib/python2.6/dist-packages/sqlalchemy/orm/query.py", line 1496, in first\n ret = list(self[0:1])\n', u' File "/usr/lib/python2.6/dist-packages/sqlalchemy/orm/query.py", line 1405, in __getitem__\n return list(res)\n', u' File "/usr/lib/python2.6/dist-packages/sqlalchemy/orm/query.py", line 1669, in instances\n fetch = cursor.fetchall()\n', u' File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 2383, in fetchall\n l = self.process_rows(self._fetchall_impl())\n', u' File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 2366, in process_rows\n keymap = metadata._keymap\n', u"AttributeError: 'NoneType' object has no attribute '_keymap'\n"] > (nova.rpc): TRACE: > > To manage notifications about this bug go to: > https://bugs.launchpad.net/nova/+bug/838581/+subscriptions