API returns UnknownError: An unknown error has occurred. Please try your request again. when describing instances

Bug #716732 reported by Kevin Bringard
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Vish Ishaya

Bug Description

When describing instances the following stack occurs:

2011-02-10 22:04:07,814 ERROR nova.api [OSE5QAE9DVBA9BDUDBPY user user] Unexpected error raised: Parent instance <FixedIp at 0x2ec4510> is not bound to a Session; lazy load operation of attribute 'network' cannot proceed
(nova.api): TRACE: Traceback (most recent call last):
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova-2011.1-py2.6.egg/nova/api/ec2/__init__.py", line 317, in __call__
(nova.api): TRACE: result = api_request.invoke(context)
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova-2011.1-py2.6.egg/nova/api/ec2/apirequest.py", line 128, in invoke(nova.api): TRACE: result = method(context, **args)(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova-2011.1-py2.6.egg/nova/api/ec2/cloud.py", line 642, in describe_instances(nova.api): TRACE: return self._format_describe_instances(context, **kwargs)(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova-2011.1-py2.6.egg/nova/api/ec2/cloud.py", line 649, in _format_describe_instances
(nova.api): TRACE: return {'reservationSet': self._format_instances(context, **kwargs)}
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova-2011.1-py2.6.egg/nova/api/ec2/cloud.py", line 690, in _format_instances
(nova.api): TRACE: floating_addr = fixed['floating_ips'][0]['address']
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova-2011.1-py2.6.egg/nova/db/sqlalchemy/models.py", line 74, in __getitem__
(nova.api): TRACE: return getattr(self, key)
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/SQLAlchemy-0.6.6-py2.6.egg/sqlalchemy/orm/attributes.py", line 168, in __get__
(nova.api): TRACE: instance_dict(instance))
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/SQLAlchemy-0.6.6-py2.6.egg/sqlalchemy/orm/attributes.py", line 388, in get
(nova.api): TRACE: value = callable_(passive=passive)
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/SQLAlchemy-0.6.6-py2.6.egg/sqlalchemy/orm/strategies.py", line 599, in __call__
(nova.api): TRACE: (mapperutil.state_str(state), self.key)
(nova.api): TRACE: DetachedInstanceError: Parent instance <FixedIp at 0x2ec4510> is not bound to a Session; lazy load operation of attribute 'network' cannot proceed
(nova.api): TRACE:
2011-02-10 22:04:07,816 ERROR nova.api [OSE5QAE9DVBA9BDUDBPY user user] Environment: {"HTTP_ACCEPT": "*/*", "CONTENT_TYPE": "application/x-www-form-urlencoded", "SCRIPT_NAME": "/services/Cloud", "REQUEST_METHOD": "POST", "HTTP_HOST": "10.1.170.32:8773", "PATH_INFO": "", "SERVER_PROTOCOL": "HTTP/1.0", "CONTENT_LENGTH": "-1", "HTTP_CONNECTION": "close", "SERVER_NAME": "10.1.170.32", "REMOTE_ADDR": "10.46.200.84", "wsgi.url_scheme": "http", "SERVER_PORT": "8773", "GATEWAY_INTERFACE": "CGI/1.1"}
2011-02-10 22:04:07,816 ERROR nova.api [OSE5QAE9DVBA9BDUDBPY user user] Environment: {"HTTP_ACCEPT": "*/*", "CONTENT_TYPE": "application/x-www-form-urlencoded", "SCRIPT_NAME": "/services/Cloud", "REQUEST_METHOD": "POST", "HTTP_HOST": "10.1.170.32:8773", "PATH_INFO": "", "SERVER_PROTOCOL": "HTTP/1.0", "CONTENT_LENGTH": "-1", "HTTP_CONNECTION": "close", "SERVER_NAME": "10.1.170.32", "REMOTE_ADDR": "10.46.200.84", "wsgi.url_scheme": "http", "SERVER_PORT": "8773", "GATEWAY_INTERFACE": "CGI/1.1"}
2011-02-10 22:04:07,817 ERROR nova.api [OSE5QAE9DVBA9BDUDBPY user user] UnknownError: An unknown error has occurred. Please try your request again.
2011-02-10 22:04:07,817 ERROR nova.api [OSE5QAE9DVBA9BDUDBPY user user] UnknownError: An unknown error has occurred. Please try your request again.
2011-02-10 22:04:07,817 INFO nova.api [OSE5QAE9DVBA9BDUDBPY user user] 0.220182s 10.46.200.84 POST None:None 400 [None] application/x-www-form-urlencoded text/xml
2011-02-10 22:04:07,817 INFO nova.api [OSE5QAE9DVBA9BDUDBPY user user] 0.220182s 10.46.200.84 POST None:None 400 [None] application/x-www-form-urlencoded text/xml

It only seems to happen with around 7 or more instances running per project, and happens much more frequently with users who do not have is_admin = 1.

Vishy provided the following patch, which appears to fix the issue:

http://pastie.org/1550608

Related branches

Changed in nova:
importance: Undecided → High
status: New → In Progress
assignee: nobody → Vish Ishaya (vishvananda)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.2
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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