Need to log the orignial libvirtError when InterfaceDetachFailed

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

Bug Description

This is not really useful:

http://logs.openstack.org/17/123917/2/check/check-tempest-dsvm-neutron/4bc2052/logs/screen-n-cpu.txt.gz?level=TRACE#_2014-09-25_17_35_11_635

2014-09-25 17:35:11.635 ERROR nova.virt.libvirt.driver [req-50afcbfb-203e-454d-a7eb-1549691caf77 TestNetworkBasicOps-985093118 TestNetworkBasicOps-1055683132] [instance: 960ee0b1-9c96-4d5b-b5f5-be76ae19a536] detaching network adapter failed.
2014-09-25 17:35:11.635 27689 ERROR oslo.messaging.rpc.dispatcher [-] Exception during message handling: <nova.objects.instance.Instance object at 0x422fe90>
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher Traceback (most recent call last):
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 133, in _dispatch_and_reply
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher incoming.message))
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 176, in _dispatch
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher return self._do_dispatch(endpoint, method, ctxt, args)
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 122, in _do_dispatch
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher result = getattr(endpoint, method)(ctxt, **new_args)
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/new/nova/nova/compute/manager.py", line 393, in decorated_function
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher return function(self, context, *args, **kwargs)
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/new/nova/nova/compute/manager.py", line 4411, in detach_interface
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher self.driver.detach_interface(instance, condemned)
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/new/nova/nova/virt/libvirt/driver.py", line 1448, in detach_interface
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher raise exception.InterfaceDetachFailed(instance)
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher InterfaceDetachFailed: <nova.objects.instance.Instance object at 0x422fe90>
2014-09-25 17:35:11.635 27689 TRACE oslo.messaging.rpc.dispatcher

The code is logging that there was an error, but not the error itself:

        try:
            self.vif_driver.unplug(instance, vif)
            flags = libvirt.VIR_DOMAIN_AFFECT_CONFIG
            state = LIBVIRT_POWER_STATE[virt_dom.info()[0]]
            if state == power_state.RUNNING or state == power_state.PAUSED:
                flags |= libvirt.VIR_DOMAIN_AFFECT_LIVE
            virt_dom.detachDeviceFlags(cfg.to_xml(), flags)
        except libvirt.libvirtError as ex:
            error_code = ex.get_error_code()
            if error_code == libvirt.VIR_ERR_NO_DOMAIN:
                LOG.warn(_LW("During detach_interface, "
                             "instance disappeared."),
                         instance=instance)
            else:
                LOG.error(_LE('detaching network adapter failed.'),
                         instance=instance)
                raise exception.InterfaceDetachFailed(
                        instance_uuid=instance['uuid'])

We should log the original libvirt error.

Matt Riedemann (mriedem)
tags: added: libvirt
Changed in nova:
status: New → Triaged
assignee: nobody → Matt Riedemann (mriedem)
importance: Undecided → Medium
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/124178

Changed in nova:
status: Triaged → In Progress
Revision history for this message
Matt Riedemann (mriedem) wrote :

Tagging for Icehouse as well since I hit this in an Icehouse Jenkins run.

tags: added: icehouse-backport-potential
Revision history for this message
Matt Riedemann (mriedem) wrote :

This is the actual libvirt error:

http://logs.openstack.org/17/123917/2/check/check-tempest-dsvm-neutron/4bc2052/logs/libvirtd.txt.gz#_2014-09-25_17_35_10_340

2014-09-25 17:35:10.340+0000: 15824: error : qemuMonitorIORead:513 : Unable to read from monitor: Connection reset by peer

Which is bug 1349617 I think.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 1af3ca69c250f8cd2f8e60ed596ad2df30353713
Author: Matt Riedemann <email address hidden>
Date: Thu Sep 25 13:44:46 2014 -0700

    libvirt: log exception info when interface detach failed

    The detach_interface method is catching a libvirtError and logging an
    error message but it doesn't include the contents of the root
    libvirtError, so log that information as well for debugging.

    Closes-Bug: #1374140

    Change-Id: I042c2956c7393a2ee1ccd026421c8df537aa1a87

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