[virt-tools-list] [PATCH] fix: do cleanupLocation only at last time for cached fetcher

Chun Yan Liu cyliu at suse.com
Fri Sep 11 05:12:09 UTC 2015



>>> On 9/9/2015 at 08:07 PM, in message <55F020E4.40206 at redhat.com>, Cole Robinson
<crobinso at redhat.com> wrote: 
> On 09/09/2015 01:56 AM, Chunyan Liu wrote: 
> > Regression introduced after commit d8d6af5. Failed to install guests 
> > through ftp network source, see below: 
> >  
> > /usr/bin/virt-install   --name sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a 
> >  -p --location ftp://xen100.virt.lab.novell.com/install/sled12/x86_64 
> >  --extra-args "autoyast=http://192.168.123.1/install/autoyast/ 
> > sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a"   --disk path=/var/lib/ 
> > libvirt/images/sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a.qcow2,size=10, 
> > format=qcow2   --network=bridge=br0   --ram=1024   --vcpu=2   --vnc 
> >  --serial pty   --noautoconsole   --video cirrus 
> >  
> > ERROR    'NoneType' object has no attribute 'sendall' 
> > Domain installation does not appear to have been successful. 
> > If it was, you can restart your domain by running: 
> >   virsh --connect xen:/// start sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a 
> > otherwise, please restart your installation. 
> >  
> > Root cause is: now we use cached fetcher, but still do cleanupLocation 
> > each time, it will cause problem when using the fetcher next time. 
> > We should only do cleanupLocation at last time. 
> >  
> > Signed-off-by: Chunyan Liu <cyliu at suse.com> 
> > --- 
> >  virtinst/distroinstaller.py | 7 +++++-- 
> >  1 file changed, 5 insertions(+), 2 deletions(-) 
> >  
>  
> I can't reproduce the issue, and in fact there isn't any call to 'sendall'  

'sendall' is a function in FTPLib. It's called from ftp.quit in FTPImageFetcher.
This problem is only happens with 'ftp'. No problem if using 'http'.

> in 
> upstream virt-manager code so not sure what that error is about. Can you 
> attach the full virt-install --debug output? 


virt-install   --name sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a   --location ftp://xen100.virt.lab.novell.com/install/sled12/x86_64    --extra-args "autoyast=http://192.168.123.1/install/autoyast/sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a"   --disk path=/root/images/sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a.qcow2,size=7,format=qcow2   --network=bridge=br0  --ram=1024   --vcpu=2   --vnc   --serial pty   --noautoconsole   --video cirrus --debug
[Fri, 11 Sep 2015 13:08:57 virt-install 1943] DEBUG (cli:246) Launched with command line: /usr/share/virt-manager/virt-install --name sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a --location ftp://xen100.virt.lab.novell.com/install/sled12/x86_64 --extra-args autoyast=http://192.168.123.1/install/autoyast/sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a --disk path=/root/images/sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a.qcow2,size=7,format=qcow2 --network=bridge=br0 --ram=1024 --vcpu=2 --vnc --serial pty --noautoconsole --video cirrus --debug
[Fri, 11 Sep 2015 13:08:57 virt-install 1943] DEBUG (cli:256) Requesting libvirt URI default
[Fri, 11 Sep 2015 13:08:57 virt-install 1943] DEBUG (cli:260) Received libvirt URI xen:///
[Fri, 11 Sep 2015 13:08:57 virt-install 1943] DEBUG (virt-install:354) Requesting virt method 'default', hv type 'default'.
[Fri, 11 Sep 2015 13:08:57 virt-install 1943] DEBUG (virt-install:588) Received virt method 'xen'
[Fri, 11 Sep 2015 13:08:57 virt-install 1943] DEBUG (virt-install:589) Hypervisor name is 'xen'
[Fri, 11 Sep 2015 13:08:57 virt-install 1943] DEBUG (virt-install:266) Distilled --network options: ['bridge=br0']
[Fri, 11 Sep 2015 13:08:57 virt-install 1943] DEBUG (virt-install:312) --graphics compat generated: vnc
[Fri, 11 Sep 2015 13:08:57 virt-install 1943] DEBUG (virt-install:182) Distilled --disk options: ['path=/root/images/sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a.qcow2,size=7,format=qcow2']
[Fri, 11 Sep 2015 13:08:57 virt-install 1943] DEBUG (devicedisk:427) Creating volume 'sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a.qcow2' on pool 'images'
[Fri, 11 Sep 2015 13:08:57 virt-install 1943] DEBUG (devicedisk:548) disk.set_vol_install: name=sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a.qcow2 poolxml=
<pool type='dir'>
  <name>images</name>
  <uuid>ac5392dd-c739-40b9-a4b1-7fbbcbd64cbe</uuid>
  <capacity unit='bytes'>13594787840</capacity>
  <allocation unit='bytes'>5774356480</allocation>
  <available unit='bytes'>7820431360</available>
  <source>
  </source>
  <target>
    <path>/root/images</path>
    <permissions>
      <mode>0755</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool>

[Fri, 11 Sep 2015 13:08:57 virt-install 1943] DEBUG (hostkeymap:117) Found keymap=us in /etc/vconsole.conf
[Fri, 11 Sep 2015 13:08:57 virt-install 1943] DEBUG (distroinstaller:417) DistroInstaller location is a network source.
[Fri, 11 Sep 2015 13:08:57 virt-install 1943] DEBUG (urlfetcher:54) Using scratchdir=/var/lib/xen
[Fri, 11 Sep 2015 13:08:59 virt-install 1943] DEBUG (urlfetcher:158) no error in prepareLocation
[Fri, 11 Sep 2015 13:08:59 virt-install 1943] DEBUG (urlfetcher:432) Finding distro store for location=ftp://xen100.virt.lab.novell.com/install/sled12/x86_64
[Fri, 11 Sep 2015 13:08:59 virt-install 1943] DEBUG (urlfetcher:186) FTP hasFile: couldn't access ftp://xen100.virt.lab.novell.com/install/sled12/x86_64/.treeinfo: 550 Can't change directory to /install/sled12/x86_64/.treeinfo: No such file or directory
[Fri, 11 Sep 2015 13:09:00 virt-install 1943] DEBUG (urlfetcher:102) Fetching URI: ftp://xen100.virt.lab.novell.com/install/sled12/x86_64/content
[Fri, 11 Sep 2015 13:09:04 virt-install 1943] DEBUG (urlfetcher:113) Saved file to /var/lib/xen/virtinst-content.Eap2hR
[Fri, 11 Sep 2015 13:09:04 virt-install 1943] DEBUG (urlfetcher:170) Error quitting ftp connection
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 168, in cleanupLocation
    self.ftp.quit()
  File "/usr/lib64/python2.7/ftplib.py", line 591, in quit
    resp = self.voidcmd('QUIT')
  File "/usr/lib64/python2.7/ftplib.py", line 253, in voidcmd
    self.putcmd(cmd)
  File "/usr/lib64/python2.7/ftplib.py", line 181, in putcmd
    self.putline(line)
  File "/usr/lib64/python2.7/ftplib.py", line 176, in putline
    self.sock.sendall(line)
AttributeError: 'NoneType' object has no attribute 'sendall'
[Fri, 11 Sep 2015 13:09:04 virt-install 1943] DEBUG (distroinstaller:520) installer.detect_distro returned=sled12
[Fri, 11 Sep 2015 13:09:04 virt-install 1943] DEBUG (guest:241) Setting Guest.os_variant to 'sled12'
[Fri, 11 Sep 2015 13:09:04 virt-install 1943] DEBUG (virt-install:743) Guest.has_install_phase: True

Starting install...
[Fri, 11 Sep 2015 13:09:04 virt-install 1943] DEBUG (urlfetcher:170) Error quitting ftp connection
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 168, in cleanupLocation
    self.ftp.quit()
  File "/usr/lib64/python2.7/ftplib.py", line 591, in quit
    resp = self.voidcmd('QUIT')
  File "/usr/lib64/python2.7/ftplib.py", line 253, in voidcmd
    self.putcmd(cmd)
  File "/usr/lib64/python2.7/ftplib.py", line 181, in putcmd
    self.putline(line)
  File "/usr/lib64/python2.7/ftplib.py", line 176, in putline
    self.sock.sendall(line)
AttributeError: 'NoneType' object has no attribute 'sendall'
[Fri, 11 Sep 2015 13:09:04 virt-install 1943] DEBUG (cli:295)   File "/usr/share/virt-manager/virt-install", line 1081, in <module>
    sys.exit(main())
  File "/usr/share/virt-manager/virt-install", line 1075, in main
    start_install(guest, continue_inst, options)
  File "/usr/share/virt-manager/virt-install", line 781, in start_install
    fail(e, do_exit=False)
  File "/usr/share/virt-manager/virtinst/cli.py", line 295, in fail
    logging.debug("".join(traceback.format_stack()))

[Fri, 11 Sep 2015 13:09:04 virt-install 1943] ERROR (cli:296) 'NoneType' object has no attribute 'sendall'
[Fri, 11 Sep 2015 13:09:04 virt-install 1943] DEBUG (cli:298) 
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-install", line 752, in start_install
    dom = guest.start_install(meter=meter, noboot=options.noreboot)
  File "/usr/share/virt-manager/virtinst/guest.py", line 422, in start_install
    self._prepare_install(meter, dry)
  File "/usr/share/virt-manager/virtinst/guest.py", line 302, in _prepare_install
    self.installer.prepare(self, meter)
  File "/usr/share/virt-manager/virtinst/installer.py", line 200, in prepare
    self._prepare(guest, meter)
  File "/usr/share/virt-manager/virtinst/distroinstaller.py", line 457, in _prepare
    self._prepare_kernel_url(guest, fetcher)
  File "/usr/share/virt-manager/virtinst/distroinstaller.py", line 366, in _prepare_kernel_url
    kernel, initrd, args = store.acquireKernel(guest)
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 545, in acquireKernel
    if self.fetcher.hasFile(kpath) and self.fetcher.hasFile(ipath):
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 180, in hasFile
    self.ftp.size(url[2])
  File "/usr/lib64/python2.7/ftplib.py", line 567, in size
    resp = self.sendcmd('SIZE ' + filename)
  File "/usr/lib64/python2.7/ftplib.py", line 248, in sendcmd
    self.putcmd(cmd)
  File "/usr/lib64/python2.7/ftplib.py", line 181, in putcmd
    self.putline(line)
  File "/usr/lib64/python2.7/ftplib.py", line 176, in putline
    self.sock.sendall(line)
AttributeError: 'NoneType' object has no attribute 'sendall'
[Fri, 11 Sep 2015 13:09:04 virt-install 1943] DEBUG (cli:309) Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect xen:/// start sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a
otherwise, please restart your installation.
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect xen:/// start sled-12-fcs-64-pv-nnm-nete5250fdfecc94f922b5a21a
otherwise, please restart your installation.



>  
> >From what I can see, the code is fine: every cleanupLocation call is  
> preceded 
> by a setupLocation call, so things should work as expected. Your patch  
> against 
> the current code means that cleanupLocation may never be called depending on 
> when things error, which could leave stranded mount points depending on the 
> passed media. 
>  
> - Cole 
>  
> _______________________________________________ 
> virt-tools-list mailing list 
> virt-tools-list at redhat.com 
> https://www.redhat.com/mailman/listinfo/virt-tools-list 
>  
>  





More information about the virt-tools-list mailing list