get console failed because can't load attribute 'pool'

Bug #1223205 reported by Alex Xu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Alex Xu

Bug Description

Try get console as below:

curl -i http://cloudcontroller:8774/v3/servers/570a0058-3094-4201-b313-a337a984f773/consoles -X GET

Then get error in nova-api as below:

2013-09-10 14:59:46.107 ERROR nova.api.openstack.extensions [req-8f981cd0-96ef-4c95-b2b5-2d42a666deed admin admin] Unexpected exception in API method
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions Traceback (most recent call last):
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/extensions.py", line 469, in wrapped
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions return f(*args, **kwargs)
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/compute/plugins/v3/consoles.py", line 98, in index
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions for console in consoles])
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/compute/plugins/v3/consoles.py", line 30, in _translate_keys
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions pool = cons['pool']
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/openstack/common/db/sqlalchemy/models.py", line 59, in __getitem__
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions return getattr(self, key)
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py", line 168, in __get__
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions return self.impl.get(instance_state(instance),dict_)
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py", line 453, in get
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions value = self.callable_(state, passive)
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/strategies.py", line 481, in _load_for_state
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions (mapperutil.state_str(state), self.key)
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions DetachedInstanceError: Parent instance <Console at 0x635d5d0> is not bound to a Session; lazy load operation of attribute 'pool' cannot proceed
2013-09-10 14:59:46.107 TRACE nova.api.openstack.extensions

Tags: console
Alex Xu (xuhj)
Changed in nova:
assignee: nobody → Alex Xu (xuhj)
tags: added: console
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/45820

Alex Xu (xuhj)
Changed in nova:
status: New → In Progress
David Ripton (dripton)
Changed in nova:
milestone: none → havana-rc1
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/45820
Committed: http://github.com/openstack/nova/commit/18f417c14a9313d90918285b22263623ba0c7e22
Submitter: Jenkins
Branch: master

commit 18f417c14a9313d90918285b22263623ba0c7e22
Author: He Jie Xu <email address hidden>
Date: Tue Sep 10 14:59:08 2013 +0800

    Fix console db can't load attribute pool

    Lists consoles failed when populate console_type from console
    db's pool attribute. The reason was db api console_get_all_by_instance
    didn't join with pool. So add param 'columns_to_join' for db api, and
    join pool attribute when lists consoles.

    Change-Id: I18b44860270a401c55cf02b4334b973fbf357b03
    Closes-bug: #1223205

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-rc1 → 2013.2
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.