ubuntu-emulator create fails for devel-proposed: Failed to unmount temp dir where system image was created

Bug #1423459 reported by Martin Pitt
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Released
High
Unassigned

Bug Description

In current vivid at least, I can't build an emulator for devel-proposed any more:

$ sudo ubuntu-emulator create --channel=ubuntu-touch/devel-proposed dprop
Creating "dprop" from ubuntu-touch/devel-proposed revision 107
Downloading...
2.24 MB / 2.24 MB [========================================================================================] 100.00 % 823.05 KB/s
349.67 MB / 349.67 MB [======================================================================================] 100.00 % 2.45 MB/s
Setting up...
Setting up a default password for phablet to: '0000'
Failed to unmount temp dir where system image was created

I don't actually have any leftover mounts, just this directory in /tmp/:

drwx------ 23 root martin 600 Feb 19 07:37 ubuntu-system039784550

Creating an emulator from the "devel" channel still works. (But I guess not for long any more, once devel-proposed gets promoted).

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: ubuntu-emulator 0.16-0ubuntu1
ProcVersionSignature: Ubuntu 3.18.0-13.14-generic 3.18.5
Uname: Linux 3.18.0-13-generic x86_64
ApportVersion: 2.16.1-0ubuntu2
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Feb 19 07:44:55 2015
EcryptfsInUse: Yes
InstallationDate: Installed on 2014-11-20 (90 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Alpha amd64 (20141119)
SourcePackage: goget-ubuntu-touch
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Martin Pitt (pitti) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in goget-ubuntu-touch (Ubuntu):
status: New → Confirmed
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

For me, the creation failed with:
---
351.43 MB / 351.43 MB [========================================================================================] 100.00 % 1.41 MB/s
Setting up...
Setting up a default password for phablet to: '0000'
open /tmp/ubuntu-system872087212/build.prop: permission denied
---
And I had only empty /tmp/ubuntu-system902863095/ (different number).

The emulator is "created", but running it gives:
open /home/timo/.local/share/ubuntu-emulator/test/.device: no such file or directory

Changed in goget-ubuntu-touch (Ubuntu):
importance: Undecided → High
Changed in goget-ubuntu-touch (Ubuntu):
importance: High → Critical
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

This actually smells something with systemd, as I just noticed that the original issue is that the mount point gets unmounted right after it gets mounted by ubuntu-emulator.

rsalveti@evasys:/tmp/sergio$ sudo ubuntu-emulator create --channel=ubuntu-touch/vivid-proposed test_x86 --use-raw-disk
Creating "test_x86" from ubuntu-touch/vivid-proposed revision 138
Downloading...
Setting up...
Mount: calling: mount /home/rsalveti/.local/share/ubuntu-emulator/test_x86/ubuntu-system.img /tmp/ubuntu-system364514705

And from syslog:
Mar 16 19:17:06 evasys systemd[2918]: Unit tmp-ubuntu\x2dsystem364514705.mount is bound to inactive unit. Stopping, too.
Mar 16 19:17:06 evasys systemd[1]: Unit tmp-ubuntu\x2dsystem364514705.mount is bound to inactive unit. Stopping, too.
Mar 16 19:17:06 evasys systemd[1]: Unmounting /tmp/ubuntu-system364514705...
Mar 16 19:17:06 evasys systemd[2918]: Unmounting /tmp/ubuntu-system364514705...
Mar 16 19:17:06 evasys kernel: [55815.378380] EXT4-fs (loop0): mounted filesystem with ordered data mode. Opts: (null)
Mar 16 19:17:06 evasys systemd[1]: Requested transaction contradicts existing jobs: Resource deadlock avoided
Mar 16 19:17:06 evasys umount[27719]: umount: /tmp/ubuntu-system364514705: not mounted
Mar 16 19:17:06 evasys systemd[2918]: tmp-ubuntu\x2dsystem364514705.mount mount process exited, code=exited status=1
Mar 16 19:17:06 evasys systemd[2918]: Unmounted /tmp/ubuntu-system364514705.
Mar 16 19:17:06 evasys systemd[2918]: Unit tmp-ubuntu\x2dsystem364514705.mount entered failed state.
Mar 16 19:17:06 evasys systemd[1]: Unmounted /tmp/ubuntu-system364514705.

Same happens when I try to manually mount the system image. And which is interesting because mount actually works fine, not giving any error, but then systemd just unmount it right away.

Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Same issue also described at https://bugs.gentoo.org/show_bug.cgi?id=541402

It is indeed a different behavior with systemd, where it tries to control the calls to 'mount'.

Revision history for this message
Ricardo Salveti (rsalveti) wrote :

A small workaround that allows creating the emulator image again (as systemd will ignore the mount point if you mount a tmpfs at the same spot first).

$ bzr diff
=== modified file 'diskimage/image.go'
--- diskimage/image.go 2015-01-21 23:22:53 +0000
+++ diskimage/image.go 2015-03-16 23:28:01 +0000
@@ -107,6 +107,9 @@
   }
  }()

+ if out, err := exec.Command("mount", "-t", "tmpfs", "none", img.Mountpoint).CombinedOutput(); err != nil {
+ return fmt.Errorf("unable to mount temp dir to create system image: %s", out)
+ }
  if out, err := exec.Command("mount", img.path, img.Mountpoint).CombinedOutput(); err != nil {
   return fmt.Errorf("unable to mount temp dir to create system image: %s", out)
  }
@@ -126,6 +129,9 @@
  if err := exec.Command("umount", img.Mountpoint).Run(); err != nil {
   return errors.New("Failed to unmount temp dir where system image was created")
  }
+ if err := exec.Command("umount", img.Mountpoint).Run(); err != nil {
+ return errors.New("Failed to unmount temp dir where system image was created")
+ }
  return nil
 }

Changed in goget-ubuntu-touch (Ubuntu):
importance: Critical → High
Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 1423459] Re: ubuntu-emulator create fails for devel-proposed: Failed to unmount temp dir where system image was created

Hey Ricardo,

the "unmounted due to inactive unit" was fixed upstream recently. I can backport these after my holidays.
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

Revision history for this message
dinamic (dinamic6661) wrote :

same here on Ubuntu 15.04 http://i.imgur.com/O5kwPZd.png

Revision history for this message
dinamic (dinamic6661) wrote :

Creating "test" from devel-proposed revision 145
Downloading...
...
Setting up...

Setting up a default password for phablet to: '0000'

Failed to unmount temp dir where system image was created

Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Fixed with systemd 219-4ubuntu10

affects: goget-ubuntu-touch (Ubuntu) → systemd (Ubuntu)
Changed in systemd (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.