I'm seeing a bug that looks very similar in Ubuntu 14.04 (vmbuilder
0.12.4). In my case, umount is called from disk.py.

2017-02-09 04:15:57,625 INFO    : Unmounting target filesystem
2017-02-09 04:15:57,645 INFO    : umount: /tmp/tmpGsaKCo: device is busy.
2017-02-09 04:15:57,645 INFO    :         (In some cases useful info about 
processes that use
2017-02-09 04:15:57,645 INFO    :          the device is found by lsof(8) or 
fuser(1))
2017-02-09 04:15:57,645 INFO    : Cleaning up
2017-02-09 04:16:00,721 INFO    : device-mapper: remove ioctl on loop0p1 
failed: Device or resource busy
2017-02-09 04:16:03,732 INFO    : device-mapper: remove ioctl on loop0p1 
failed: Device or resource busy
2017-02-09 04:16:06,741 INFO    : device-mapper: remove ioctl on loop0p1 
failed: Device or resource busy
2017-02-09 04:16:09,745 INFO    : Could not unmap '/tmp/tmpTb5h7u' after '3' 
attempts. Final attempt
2017-02-09 04:16:09,798 ERROR   : Process (['umount', '/tmp/tmpGsaKCo/']) 
returned 1. stdout: , stderr: umount: /tmp/tmpGsaKCo: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

Traceback (most recent call last):
  File "/usr/bin/vmbuilder", line 24, in <module>
    cli.main()
  File "/usr/lib/python2.7/dist-packages/VMBuilder/contrib/cli.py", line 228, 
in main
    hypervisor.install_os()
  File "/usr/lib/python2.7/dist-packages/VMBuilder/hypervisor.py", line 72, in 
install_os
    self.call_hooks('unmount_partitions')
  File "/usr/lib/python2.7/dist-packages/VMBuilder/distro.py", line 67, in 
call_hooks
    call_hooks(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/util.py", line 170, in 
call_hooks
    getattr(context, func)(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/hypervisor.py", line 103, in 
unmount_partitions
    fs.umount()
  File "/usr/lib/python2.7/dist-packages/VMBuilder/disk.py", line 409, in umount
    run_cmd('umount', self.mntpath)
  File "/usr/lib/python2.7/dist-packages/VMBuilder/util.py", line 120, in 
run_cmd
    raise VMBuilderException, "Process (%s) returned %d. stdout: %s, stderr: 
%s" % (args.__repr__(), status, mystdout.buf, mystderr.buf)
VMBuilder.exception.VMBuilderException: Process (['umount', '/tmp/tmpGsaKCo/']) 
returned 1. stdout: , stderr: umount: /tmp/tmpGsaKCo: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

Even after this run got stuck, I noticed there were users of the dir
still left:

$ sudo lsof +D /tmp/tmpGsaKCo/
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/112/gvfs
      Output information may be incomplete.
COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF    NODE NAME
dirmngr 5223 usbmux  cwd    DIR    7,1     4096       2 /tmp/tmpGsaKCo
dirmngr 5223 usbmux  rtd    DIR    7,1     4096       2 /tmp/tmpGsaKCo
dirmngr 5223 usbmux  txt    REG    7,1   227608  658461 
/tmp/tmpGsaKCo/usr/bin/dirmngr
dirmngr 5223 usbmux  mem    REG    7,1  1840928  527857 
/tmp/tmpGsaKCo/lib/x86_64-linux-gnu/libc-2.19.so
dirmngr 5223 usbmux  mem    REG    7,1    76408  790007 
/tmp/tmpGsaKCo/usr/lib/x86_64-linux-gnu/libpth.so.20.0.27
dirmngr 5223 usbmux  mem    REG    7,1   224072  790005 
/tmp/tmpGsaKCo/usr/lib/x86_64-linux-gnu/libksba.so.8.11.1
dirmngr 5223 usbmux  mem    REG    7,1   524704  527872 
/tmp/tmpGsaKCo/lib/x86_64-linux-gnu/libgcrypt.so.11.8.2
dirmngr 5223 usbmux  mem    REG    7,1    18416  527874 
/tmp/tmpGsaKCo/lib/x86_64-linux-gnu/libgpg-error.so.0.10.0
dirmngr 5223 usbmux  mem    REG    7,1    68384  790003 
/tmp/tmpGsaKCo/usr/lib/x86_64-linux-gnu/libassuan.so.0.4.1
dirmngr 5223 usbmux  mem    REG    7,1   149120  527847 
/tmp/tmpGsaKCo/lib/x86_64-linux-gnu/ld-2.19.so
dirmngr 5223 usbmux    5w   REG    7,1      370 1309768 
/tmp/tmpGsaKCo/var/log/dirmngr/dirmngr.log

Probably a 'fuser -k' before umount would be useful.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/879710

Title:
  ubuntu-vm-builder crashes when trying to umount tmp directory.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/vm-builder/+bug/879710/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to