Bug 1272125 - Error: xmlParseDoc() failed - while creating new VM in virt-manager
Error: xmlParseDoc() failed - while creating new VM in virt-manager
Status: CLOSED DUPLICATE of bug 1272121
Product: Virtualization Tools
Classification: Community
Component: virt-manager (Show other bugs)
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Cole Robinson
Depends On:
  Show dependency treegraph
Reported: 2015-10-15 10:26 EDT by James Boyle
Modified: 2015-10-23 08:35 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-10-15 16:39:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
virt-manager.log (3.10 KB, text/plain)
2015-10-15 10:28 EDT, James Boyle
no flags Details
Screenshot of virt-manager failure (23.88 KB, image/png)
2015-10-15 10:30 EDT, James Boyle
no flags Details

  None (edit)
Description James Boyle 2015-10-15 10:26:27 EDT
Description of problem:
Virt-manager is unable to handle a USB KVM (keyboard/video/mouse) with UTF/Chinese characters.  When the dongle is plugged in, virt-manager fails to create a new VM.  It is possible that other functions will fail.

The error message "Error: xmlParseDoc() failed" is shown in the GUI.

Version-Release number of selected component (if applicable):

How reproducible:
100% / All the time

Steps to Reproduce:
1.  Plug in USB KVM dongle with ID: 3032:1b1c (probably other USB devices with UTF/odd characters in the product description)
2.  Run virt-manager
3.  Click on the button to create a new VM

Actual results:
Virt-manager fails to launch the create new VM dialog (see screenshot).

Expected results:
New VM dialog should launch.

Additional info:
The host system is a current CentOS 7 installation.

From the virt-manager log:
[Thu, 15 Oct 2015 07:22:39 virt-manager 17261] DEBUG (create:165) Showing new vm wizard
[Thu, 15 Oct 2015 07:22:39 virt-manager 17261] DEBUG (create:892) Guest type set to os_type=hvm, arch=x86_64, dom_type=kvm
[Thu, 15 Oct 2015 07:22:46 virt-manager 17261] DEBUG (xmlbuilder:693) Error parsing xml=
  <capability type='usb_device'>
    <product id='0x1b1c'>*** I deleted the info here so bugzilla won't crash!!!! ***</product>
    <vendor id='0x3032'>䙸〄䜀                             </vendor>

[Thu, 15 Oct 2015 07:22:46 virt-manager 17261] ERROR (create:346) Error setting create wizard conn state.
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 344, in reset_state
    self.set_conn(activeconn, force_validate=True)
  File "/usr/share/virt-manager/virtManager/create.py", line 225, in set_conn
  File "/usr/share/virt-manager/virtManager/create.py", line 626, in set_conn_state
  File "/usr/share/virt-manager/virtManager/netlist.py", line 405, in reset_state
  File "/usr/share/virt-manager/virtManager/netlist.py", line 253, in _populate_network_list
  File "/usr/share/virt-manager/virtManager/netlist.py", line 185, in _find_physical_devices
    for nodedev in self.conn.get_nodedevs("net"):
  File "/usr/share/virt-manager/virtManager/connection.py", line 644, in get_nodedevs
    xmlobj = dev.get_xmlobj()
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 160, in get_xmlobj
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 225, in _reparse_xml
    self._xmlobj = self._build_xmlobj(self._get_raw_xml())
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 228, in _build_xmlobj
    return self._parseclass(self.conn.get_backend(), parsexml=xml)
  File "/usr/share/virt-manager/virtManager/nodedev.py", line 27, in _parse_convert
    return NodeDevice.parse(conn, parsexml)
  File "/usr/share/virt-manager/virtinst/nodedev.py", line 89, in parse
    tmpdev = NodeDevice(conn, parsexml=xml, allow_node_instantiate=True)
  File "/usr/share/virt-manager/virtinst/nodedev.py", line 100, in __init__
    XMLBuilder.__init__(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtinst/xmlbuilder.py", line 776, in __init__
    parent_xpath, relative_object_xpath)
  File "/usr/share/virt-manager/virtinst/xmlbuilder.py", line 678, in __init__
    self._parse(parsexml, parsexmlnode)
  File "/usr/share/virt-manager/virtinst/xmlbuilder.py", line 691, in _parse
    doc = libxml2.parseDoc(xml)
  File "/usr/lib64/python2.7/site-packages/libxml2.py", line 1325, in parseDoc
    if ret is None:raise parserError('xmlParseDoc() failed')
parserError: xmlParseDoc() failed
[Thu, 15 Oct 2015 07:23:01 virt-manager 17261] DEBUG (create:175) Closing new vm wizard
Comment 1 James Boyle 2015-10-15 10:28 EDT
Created attachment 1083281 [details]

this contains the offending UTF input in the virt-manager.log - bugzilla was unable to process it in the description field, so I'm attaching it.
Comment 2 James Boyle 2015-10-15 10:30 EDT
Created attachment 1083283 [details]
Screenshot of virt-manager failure

It didn't look like this attachment made it from the original submission - I think bugzilla is having trouble with the malformed UTF from our USB device product description.  Sorry if this shows up twice.
Comment 3 Cole Robinson 2015-10-15 16:39:02 EDT
Thanks for the report, but this is already fixed upstream:

commit e125aa69d8024fddb72dde9371f172061f388160
Author: Cole Robinson <crobinso@redhat.com>
Date:   Thu Mar 26 18:04:23 2015 -0400

    nodedev: Handle busted 'system' XML
    Libvirt can generated invalid XML for the system nodedev device:
    This hits at least two people, so catch this specific case, but the
    real fix is libvirt not outputing busted XML.

It looks like you're on RHEL/Centos, and RHEL7.2 should have that patch when it's finally out. You can try running virt-manager git until then:

git clone git://github.com/virt-manager/virt-manager
cd virt-manager
./virt-manager --debug
Comment 4 James Boyle 2015-10-23 08:35:39 EDT

*** This bug has been marked as a duplicate of bug 1272121 ***

Note You need to log in before you can comment on or make changes to this bug.