← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1727643] Re: libvirt: UnicodeDecodeError in qemu guest agent error message handling

 

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 <chenhx@xxxxxxxxxxxxxxxx>
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 <chenhx@xxxxxxxxxxxxxxxx>


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1727643

Title:
  libvirt: UnicodeDecodeError in qemu guest agent error message handling

Status in OpenStack Compute (nova):
  Fix Released
Status in OpenStack Compute (nova) ocata series:
  Confirmed
Status in OpenStack Compute (nova) pike series:
  New

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1727643/+subscriptions


References