"AttributeError: 'module' object has no attribute 'InstanceInfoCache'\n"

Bug #1337447 reported by Thang Pham
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Thang Pham

Bug Description

In the latest devstack (pulled on 7/3/14), you cannot access an instance's noVNC console on the horizon dashboard after you launched the instance. If you look at the logs, you will find:

INFO nova.console.websocketproxy [req-0851007a-adbb-4aff-b712-0108702efa58 None None] handler exception: 'module' object has no attribute 'InstanceInfoCache'#012Traceback (most recent call last):

  File "/opt/stack/oslo.messaging/oslo/messaging/rpc/dispatcher.py", line 134, in _dispatch_and_reply
    incoming.message))

  File "/opt/stack/oslo.messaging/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatch
    return self._do_dispatch(endpoint, method, ctxt, args)

  File "/opt/stack/oslo.messaging/oslo/messaging/rpc/dispatcher.py", line 123, in _do_dispatch
    result = getattr(endpoint, method)(ctxt, **new_args)

  File "/opt/stack/nova/nova/consoleauth/manager.py", line 128, in check_token
    if self._validate_token(context, token):

  File "/opt/stack/nova/nova/consoleauth/manager.py", line 114, in _validate_token
    instance = objects.Instance.get_by_uuid(context, instance_uuid)

  File "/opt/stack/nova/nova/objects/base.py", line 153, in wrapper
    result = fn(cls, context, *args, **kwargs)

  File "/opt/stack/nova/nova/objects/instance.py", line 312, in get_by_uuid
    return cls._from_db_object(context, cls(), db_inst,

  File "/opt/stack/nova/nova/objects/instance.py", line 288, in _from_db_object
    # passed to us by a backlevel service, things will break

AttributeError: 'module' object has no attribute 'InstanceInfoCache'

This was noted in the following forum post: https://ask.openstack.org/en/question/33966/vnc-in-the-dashbaord-says-failed-to-connect-to-server-code-1006-the-set-up-is-by-devstack-on-ubuntu-1204-with-kvm/

Thang Pham (thang-pham)
Changed in nova:
assignee: nobody → Thang Pham (thang-pham)
Revision history for this message
yong sheng gong (gongysh) wrote :

I am running into this bug too.

Changed in nova:
status: New → Confirmed
Revision history for this message
yong sheng gong (gongysh) wrote :
Revision history for this message
Thang Pham (thang-pham) wrote :

Hi Yong Sheng,

I believe your patch would work, but it leaves me wondering why this code was like this in the first place. I am surprised the unit tests and tempest tests did not pick up this import error. I think all nova/object/instance.py needs is "objects.register_all()" near the top.

Regards,
Thang

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/104952

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Thang Pham (thang-pham) wrote :

The solution is to just add "objects.register_all()" to nova/cmd/consoleauth.py, similar to other nova services.

description: updated
Changed in nova:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/104952
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a5dbda3f429d0a1e6cb4fc28b2a620dc2b40fd59
Submitter: Jenkins
Branch: master

commit a5dbda3f429d0a1e6cb4fc28b2a620dc2b40fd59
Author: Thang Pham <email address hidden>
Date: Fri Jul 4 14:53:10 2014 -0400

    Resolve import dependency in consoleauth service

    If you attempt to access an instance's noVNC console on the
    horizon dashboard, an AttributeError is thrown, complaining
    about 'module' object having no attribute 'InstanceInfoCache'.
    This is because the objects are not registered by the consoleauth
    service. This patch fixes this import dependency by registering
    all objects so it could be used by the consoleauth service.

    Change-Id: I4f9b922a077076b156833590762106d5cd2ad276
    Closes-Bug: #1337447

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-2 → 2014.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.