libvirt: UnicodeDecodeError in qemu guest agent error message handling

Bug #1727643 reported by Chen Hanxiao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Chen Hanxiao
Ocata
Confirmed
Undecided
Unassigned
Pike
Fix Committed
Medium
Matt Riedemann

Bug Description

Description
===========

Some of error messages from qemu-guest-agent is
    localized encoding.
    We may get GB2312(Chinese charactors) from qga's error message
    from a Chinese version of Windows.

    nova didn't cover this senario, we may get errors like:
        UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6
        in position 138: ordinal not in range(128)

Steps to reproduce
==================
1) upload a non-English Windows image, such as Chinese version.
2) don't set os_type metadata of image
3) nova set-password XXXX
4) check log of nova-compute, see 'Logs & Configs'

Expected result
===============
error message from qemu guest agent should be logged properly in nova-compute.log

Actual result
=============
UnicodeDecodeError

Logs & Configs
==============
ERROR oslo_messaging.rpc.dispatcher Traceback (most recent call last):
ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 138, in _dispatch_and_reply
ERROR oslo_messaging.rpc.dispatcher incoming.message))
ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 185, in _dispatch
ERROR oslo_messaging.rpc.dispatcher return self._do_dispatch(endpoint, method, ctxt, args)
ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 127, in _do_dispatch
ERROR oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/exception.py", line 110, in wrapped
ERROR oslo_messaging.rpc.dispatcher payload)
ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
ERROR oslo_messaging.rpc.dispatcher self.force_reraise()
ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
ERROR oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/exception.py", line 89, in wrapped
ERROR oslo_messaging.rpc.dispatcher return f(self, context, *args, **kw)
ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 7294, in quiesced_instance_and_create_volume_snap
ERROR oslo_messaging.rpc.dispatcher instance, snapshot_info)
ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 7980, in set_quiesced_and_create_volume_snap
ERROR oslo_messaging.rpc.dispatcher self._set_quiesced(context, instance, instance.image_meta, True)
ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 1860, in _set_quiesced
ERROR oslo_messaging.rpc.dispatcher 'error_code': error_code, 'ex': ex})
ERROR oslo_messaging.rpc.dispatcher UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 138: ordinal not in range(128)
2017-09-30 16:02:00.613 12980 ERROR oslo_messaging.rpc.dispatcher

Tags: libvirt
Revision history for this message
Chen Hanxiao (chenhanxiao) wrote :
Changed in nova:
assignee: nobody → Chen Hanxiao (chenhanxiao)
Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

Set the status to In-progress because this report has an assignee and there is a patch for it.

Changed in nova:
status: New → In Progress
Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → Medium
melanie witt (melwitt)
tags: added: libvirt
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/511459
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=13418faa17e1034db551c8d193a7b08e8b59ef9d
Submitter: Zuul
Branch: master

commit 13418faa17e1034db551c8d193a7b08e8b59ef9d
Author: Chen Hanxiao <email address hidden>
Date: Thu Oct 12 18:52:42 2017 +0800

    libvirt: properly decode error message from qemu guest agent

    Some of error messages from qemu-guest-agent is
    localized encoding.
    We may get GB2312(Chinese charactors) from qga's error message
    from a Chinese version of Windows.

    nova didn't cover this senario, we may get errors like:
        UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6
        in position 138: ordinal not in range(128)

    This patch will fix this issue by exception_to_unicode

    Closes-bug: #1727643

    Change-Id: I3b8bfaec8af0e9b4859dcfe7e35fc5bb26c208dc
    Signed-off-by: Chen Hanxiao <email address hidden>

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/517727

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 17.0.0.0b2

This issue was fixed in the openstack/nova 17.0.0.0b2 development milestone.

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

Reviewed: https://review.openstack.org/517727
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=7687dadccff52c9354033137e4f5ebdeb79b2424
Submitter: Zuul
Branch: stable/pike

commit 7687dadccff52c9354033137e4f5ebdeb79b2424
Author: Chen Hanxiao <email address hidden>
Date: Thu Oct 12 18:52:42 2017 +0800

    libvirt: properly decode error message from qemu guest agent

    Some of error messages from qemu-guest-agent is
    localized encoding.
    We may get GB2312(Chinese charactors) from qga's error message
    from a Chinese version of Windows.

    nova didn't cover this senario, we may get errors like:
        UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6
        in position 138: ordinal not in range(128)

    This patch will fix this issue by exception_to_unicode

    Closes-bug: #1727643

    Change-Id: I3b8bfaec8af0e9b4859dcfe7e35fc5bb26c208dc
    Signed-off-by: Chen Hanxiao <email address hidden>
    (cherry picked from commit 13418faa17e1034db551c8d193a7b08e8b59ef9d)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 16.1.0

This issue was fixed in the openstack/nova 16.1.0 release.

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.