Exception isn't handled in virt/libvirt/driver.py

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

Bug Description

when a ConsoleTypeUnavailable exception is raised in nova/virt/libvirt/driver.py, it isn't well handled.

I found this bug by running this command:

nova --debug --os-compute-api-version 3 get-spice-console inst1 spice-html5

I got the error message in compute log.

2014-01-18 02:59:24.419 ERROR nova.openstack.common.rpc.amqp [req-14ec1e04-1980-4893-8023-ec9f6c75c973 demo demo] Exception during message handling
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp Traceback (most recent call last):
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/rpc/amqp.py", line 461, in _process_data
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp **args)
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/rpc/dispatcher.py", line 172, in dispatch
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp result = getattr(proxyobj, method)(ctxt, **kwargs)
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/rpc/common.py", line 439, in inner
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp return catch_client_exception(exceptions, func, *args, **kwargs)
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/rpc/common.py", line 420, in catch_client_exception
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp return func(*args, **kwargs)
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/exception.py", line 90, in wrapped
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp payload)
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/excutils.py", line 68, in __exit__
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp six.reraise(self.type_, self.value, self.tb)
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/exception.py", line 73, in wrapped
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp return f(self, context, *args, **kw)
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/compute/manager.py", line 271, in decorated_function
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp e, sys.exc_info())
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/openstack/common/excutils.py", line 68, in __exit__
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp six.reraise(self.type_, self.value, self.tb)
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/compute/manager.py", line 258, in decorated_function
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp return function(self, context, *args, **kwargs)
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/compute/manager.py", line 356, in decorated_function
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp return function(self, context, *args, **kwargs)
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/compute/manager.py", line 3676, in get_spice_console
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp connect_info = self.driver.get_spice_console(context, instance)
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 2305, in get_spice_console
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp ports = get_spice_ports_for_instance(instance['name'])
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 2303, in get_spice_ports_for_instance
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp raise exception.ConsoleTypeUnavailable(console_type='spice')
2014-01-18 02:59:24.419 TRACE nova.openstack.common.rpc.amqp ConsoleTypeUnavailable: Unavailable console type spice.

Haiwei Xu (xu-haiwei)
Changed in nova:
assignee: nobody → Haiwei Xu (xu-haiwei)
Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit b31bf55a17e4caf724bc7997ad0f3146ee9f0114
Author: Haiwei Xu <email address hidden>
Date: Sat Jan 18 03:11:29 2014 +0900

    Fix exception handling miss in remote_consoles.

    The ConsoleTypeUnavailable exception raised in
    nova/virt/libvirt/driver.py is not handled, and will make
    nova api and compute fail.
    This patch fixes this bug.

    Closes-bug: #1270076

    Change-Id: I6ff7a40bf26dbef4bd5512a9c3c4a8664a664244

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