Bug 1416112

Summary: virt-v2v: Import from VMware, Xen and KVM failed with "OSError: [Errno 9] Bad file descriptor" (workaround: upgrade python-cpopen)
Product: [oVirt] vdsm Reporter: Nisim Simsolo <nsimsolo>
Component: CoreAssignee: Tomáš Golembiovský <tgolembi>
Status: CLOSED CURRENTRELEASE QA Contact: Nisim Simsolo <nsimsolo>
Severity: urgent Docs Contact:
Priority: high    
Version: ---CC: bugs, danken, eedri, gklein, mgoldboi, michal.skrivanek, nsimsolo, tgolembi, tjelinek
Target Milestone: ovirt-4.1.0-betaKeywords: Regression
Target Release: 4.19.4Flags: rule-engine: ovirt-4.1+
gklein: blocker+
mgoldboi: planning_ack+
tjelinek: devel_ack+
gklein: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-15 15:02:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1357593    
Bug Blocks: 1350465, 1356767, 1375563, 1378340, 1388596, 1404400    
Attachments:
Description Flags
vdsm.log
none
engine.log none

Description Nisim Simsolo 2017-01-24 15:48:33 UTC
Description of problem:
Trying to import from any external provider (VMware, Xen or KVM) failed with the next vdsm.log Traceback: 
2017-01-24 16:52:37,494 ERROR (v2v/11134c77) [root] Job u'11134c77-fc08-4b64-85db-70d822e87850' failed (v2v:795)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 790, in _run
    self._import()
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 807, in _import
    with self._command.execute() as self._proc:
  File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 637, in execute
    yield self._start_helper()
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 407, in _start_helper
    stderr=subprocess.STDOUT)
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 1304, in _simple_exec_cmd
    stdin=stdin, stdout=stdout, stderr=stderr)
  File "/usr/lib64/python2.7/site-packages/cpopen/__init__.py", line 63, in __init__
    **kw)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/site-packages/cpopen/__init__.py", line 82, in _execute_child_v276
    restore_sigpipe=restore_sigpipe
  File "/usr/lib64/python2.7/site-packages/cpopen/__init__.py", line 137, in _execute_child_v275
    os.close(fd)
OSError: [Errno 9] Bad file descriptor

Version-Release number of selected component (if applicable):
ovirt-engine-4.1.0.2-0.1.el7
libvirt-client-2.0.0-10.el7_3.4.x86_64
qemu-kvm-rhev-2.6.0-28.el7_3.3.x86_64
sanlock-3.4.0-1.el7.x86_64
vdsm-4.19.1-1.el7ev.x86_64

How reproducible:
Consistently

Steps to Reproduce:
1. Browse webadmin > VMs tab > import
2. Enter VMware details and start import
3. Try to import also from Xen and KVM providers.

Actual results:
Import failed.

Expected results:
Import should not fail

Additional info:
engine.log and vdsm.log attached.

Comment 1 Nisim Simsolo 2017-01-24 15:52:16 UTC
Created attachment 1243958 [details]
vdsm.log

Comment 2 Nisim Simsolo 2017-01-24 15:52:41 UTC
Created attachment 1243959 [details]
engine.log

Comment 3 Nisim Simsolo 2017-01-25 09:09:59 UTC
Issue is relevant also for vdsm-4.19.2-2.el7ev.x86_64

Comment 4 Tomas Jelinek 2017-01-25 09:54:26 UTC
python-cpopen dependency needs to be bumped.

In ovirt the workaround is to manually yum/dnf update the python-cpopen

Comment 5 Yaniv Kaul 2017-01-25 11:12:02 UTC
(In reply to Tomas Jelinek from comment #4)
> python-cpopen dependency needs to be bumped.
> 
> In ovirt the workaround is to manually yum/dnf update the python-cpopen

Nisim, can you confirm it works?

Comment 6 Nisim Simsolo 2017-01-25 12:30:08 UTC
Yes, latest python-cpopen (python-cpopen-1.5-3.el7.x86_64) is solving the issue.

Comment 7 Eyal Edri 2017-01-29 12:06:52 UTC
How is this an engine bug if the attached patches are from VDSM?
This would make us build engine instead of VDSM.

Comment 9 Eyal Edri 2017-01-29 16:21:00 UTC
How can this has TR 4.19.3 is the current VDSM tag with 4.19.3 doesn't have the attached patches?

Comment 10 Dan Kenigsberg 2017-01-30 07:35:25 UTC
it cannot, my bad.

Comment 11 Nisim Simsolo 2017-02-02 08:46:45 UTC
Verification build:
ovirt-engine-4.1.0.3-0.1.el7
libvirt-client-2.0.0-10.el7_3.4.x86_64
vdsm-4.19.4-1.el7ev.x86_64
qemu-kvm-rhev-2.6.0-28.el7_3.3.x86_64
sanlock-3.4.0-1.el7.x86_64
python-cpopen-1.5-1.el7ev.x86_64
rhevm-qe-infra-glance

Verified import from KVM (qemu+ssh and qemu+tcp), Xen and VMware.