Running with current trunk, starting an Ubuntu image, when cloud-init queries the metadata service requests sometime fail (about 2/3 of the time), with the following error:
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/eventlet/wsgi.py", line 336, in handle_one_response
result = self.application(self.environ, start_response)
File "/usr/lib/pymodules/python2.6/paste/urlmap.py", line 203, in __call__
return app(environ, start_response)
File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
return self.func(req, *args, **kwargs)
File "/usr/lib/pymodules/python2.6/nova/api/ec2/__init__.py", line 59, in __call__
rv = req.get_response(self.application)
File "/usr/lib/pymodules/python2.6/webob/request.py", line 919, in get_response
application, catch_exc_info=False)
File "/usr/lib/pymodules/python2.6/webob/request.py", line 887, in call_application
app_iter = application(self.environ, start_response)
File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
return self.func(req, *args, **kwargs)
File "/usr/lib/pymodules/python2.6/nova/api/ec2/metadatarequesthandler.py", line 74, in __call__
meta_data = cc.get_metadata(remote_address)
File "/usr/lib/pymodules/python2.6/nova/api/ec2/cloud.py", line 173, in get_metadata
'instance-type': instance_ref['instance_type'],
File "/usr/lib/pymodules/python2.6/nova/db/sqlalchemy/models.py", line 74, in __getitem__
return getattr(self, key)
File "/usr/lib/python2.6/dist-packages/sqlalchemy/orm/attributes.py", line 163, in __get__
instance_dict(instance))
File "/usr/lib/python2.6/dist-packages/sqlalchemy/orm/attributes.py", line 382, in get
value = callable_(passive=passive)
File "/usr/lib/python2.6/dist-packages/sqlalchemy/orm/strategies.py", line 578, in __call__
(mapperutil.state_str(state), self.key)
DetachedInstanceError: Parent instance <Instance at 0x41039d0> is not bound to a Session; lazy load operation of attribute 'instance_type' cannot proceed
Trace with sane linewrapping at http:// pastebin. com/R0LRQSxe