XenServer resize broken: 'TypeError', 'execv() argument 1 must be (encoded string without NULL bytes),

Bug #955064 reported by Dan Prince on 2012-03-14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Dan Prince

Bug Description

Using the latest Nova Essex builds it appears resize's when using XenServer are broken:

2012-03-14 08:57:30 DEBUG nova.virt.xenapi_conn [-] Got exception: ['XENAPI_PLUGIN_EXCEPTION', 'transfer_vhd', 'TypeError', 'execv() argument 1 must be (encoded string without NULL bytes), not str'] from (pid=8531) _unwrap_plugin_exceptions /usr/lib/python2.7/dist-packages/nova/virt/xenapi_conn.py:611
2012-03-14 08:57:30 DEBUG nova.virt.xenapi.vmops [-] Destroying VDIs for Instance 426a8458-e417-466e-bc86-d258ae32e6f7 from (pid=8531) _destroy_vdis /usr/lib/python2.7/dist-packages/nova/virt/xenapi/vmops.py:1089
2012-03-14 08:57:30 DEBUG nova.virt.xenapi.vm_utils [-] VDI f67fb7c7-e548-426a-98af-051d1ed196a1 is still available from (pid=8531) lookup_vm_vdis /usr/lib/python2.7/dist-packages/nova/virt/xenapi/vm_utils.py:1002
2012-03-14 08:57:30 DEBUG nova.virt.xenapi.vmops [-] Instance 426a8458-e417-466e-bc86-d258ae32e6f7 VM destroyed from (pid=8531) _destroy_vm /usr/lib/python2.7/dist-packages/nova/virt/xenapi/vmops.py:1167
2012-03-14 08:57:30 ERROR nova.compute.manager [-] Migration error: Failed to transfer vhd to new host. Setting instance vm_state to ERROR
2012-03-14 08:57:30 ERROR nova.rpc.amqp [-] Exception during message handling
(nova.rpc.amqp): TRACE: Traceback (most recent call last):
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/dist-packages/nova/rpc/amqp.py", line 252, in _process_data
(nova.rpc.amqp): TRACE: rval = node_func(context=ctxt, **node_args)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/dist-packages/nova/exception.py", line 114, in wrapped
(nova.rpc.amqp): TRACE: return f(*args, **kw)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 153, in decorated_function
(nova.rpc.amqp): TRACE: function(self, context, instance_uuid, *args, **kwargs)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 177, in decorated_function
(nova.rpc.amqp): TRACE: sys.exc_info())
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
(nova.rpc.amqp): TRACE: self.gen.next()
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 171, in decorated_function
(nova.rpc.amqp): TRACE: return function(self, context, instance_uuid, *args, **kwargs)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1320, in resize_instance
(nova.rpc.amqp): TRACE: self._set_instance_error_state(context, instance_uuid)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
(nova.rpc.amqp): TRACE: self.gen.next()
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1315, in resize_instance
(nova.rpc.amqp): TRACE: instance_type_ref, self._legacy_nw_info(network_info))
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/dist-packages/nova/virt/xenapi_conn.py", line 238, in migrate_disk_and_power_off
(nova.rpc.amqp): TRACE: dest, instance_type)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/dist-packages/nova/virt/xenapi/vmops.py", line 813, in migrate_disk_and_power_off
(nova.rpc.amqp): TRACE: self._migrate_vhd(instance, base_copy_uuid, dest, sr_path)
(nova.rpc.amqp): TRACE: File "/usr/lib/python2.7/dist-packages/nova/virt/xenapi/vmops.py", line 710, in _migrate_vhd
(nova.rpc.amqp): TRACE: raise exception.MigrationError(reason=msg)
(nova.rpc.amqp): TRACE: MigrationError: Migration error: Failed to transfer vhd to new host
(nova.rpc.amqp): TRACE:


Looks like some sort of encoding issue:

perhaps this is the culprit? https://github.com/openstack/nova/commit/cf09a214c3007a8fa8dbe98f4cb6fcf732e09932

Dan Prince (dan-prince) on 2012-03-14
Changed in nova:
assignee: nobody → Dan Prince (dan-prince)
importance: Undecided → High
status: New → In Progress
Dan Prince (dan-prince) wrote :

Looking a bit closer.... it appears that python shlex may not handle unicode correctly. This gets used by the migrate plugins transfer_vhd function to create an rsync argument array.

So cf09a214c3007a8fa8dbe98f4cb6fcf732e09932 probably related to this issue here.

Ugh, I fear for other places where unicode strings will break things.

Reviewed: https://review.openstack.org/5335
Committed: http://github.com/openstack/nova/commit/a236fdd380bec0793b6198e5e8eb40aa30ab729d
Submitter: Jenkins
Branch: master

commit a236fdd380bec0793b6198e5e8eb40aa30ab729d
Author: Dan Prince <email address hidden>
Date: Wed Mar 14 10:53:36 2012 -0400

    Update transfer_vhd to handle unicode correctly.

    Python 2.4's shlex implementation doesn't seem to like unicode.
    This updates the XenServer migration plugin so it converts to
    ascii before shlex'ing the rsync args.

    Fixes OSAPI resizes when using XenServer.

    Fixes LP Bug #955064.

    Change-Id: I7f2681bfe64ccde449a87c68b9739866a381a213

Changed in nova:
status: In Progress → Fix Committed
Dan Prince (dan-prince) on 2012-03-14
Changed in nova:
milestone: none → essex-rc1
Thierry Carrez (ttx) on 2012-03-20
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-rc1 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers