lxd deb to snap preinst fails: "rm: skipping '/var/lib/lxd/storage-pools/lxd/containers/…', since it's on a different device"

Bug #1800442 reported by Iain Lane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxd (Ubuntu)
New
Undecided
Unassigned

Bug Description

I've had this for a while, but only just got around to reporting the bug - sorry.

lxd's preinst fails for me:

[…]
==> Cleaning up leftovers
Failed to stop lxd.socket: Unit lxd.socket not loaded.
Failed to stop lxd.service: Unit lxd.service not loaded.
Failed to stop lxd-containers.service: Unit lxd-containers.service not loaded.
Failed to disable unit: Unit file lxd.socket does not exist.
rm: skipping '/var/lib/lxd/storage-pools/lxd/containers/consumer', since it's on a different device
rm: skipping '/var/lib/lxd/storage-pools/lxd/containers/accurate-possum', since it's on a different device
rm: skipping '/var/lib/lxd/storage-pools/lxd/containers/asgen', since it's on a different device
dpkg: error processing archive /var/cache/apt/archives/lxd_1%3a0.4_all.deb (--unpack):
 new lxd package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/lxd_1%3a0.4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
laney@nightingale> apt policy lxd
lxd:
  Installed: 1:0.3
  Candidate: 1:0.4
  Version table:
     1:0.4 500
        500 http://archive.ubuntu.com/ubuntu cosmic/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu cosmic/main i386 Packages
 *** 1:0.3 100
        100 /var/lib/dpkg/status

I added `set -x' to it, and ran it manually:

laney@nightingale> sudo /var/lib/dpkg/info/lxd.preinst upgrade
+ . /usr/share/debconf/confmodule
+ [ ! ]
+ PERL_DL_NONLAZY=1
+ export PERL_DL_NONLAZY
+ [ ]
+ exec /usr/share/debconf/frontend /var/lib/dpkg/info/lxd.preinst upgrade
+ . /usr/share/debconf/confmodule
+ [ ! 1 ]
+ [ -z ]
+ exec
+ [ ]
+ exec
+ DEBCONF_REDIR=1
+ export DEBCONF_REDIR
+ echo => Installing the LXD snap
=> Installing the LXD snap
+ [ -e /var/lib/lxd/server.crt ]
+ echo ==> Checking connectivity with the snap store
==> Checking connectivity with the snap store
+ COUNT=0
+ :
+ snap info lxd
+ break
+ db_get lxd/snap-track
+ _db_cmd GET lxd/snap-track
+ _db_internal_IFS=

+ IFS=
+ printf %s\n GET lxd/snap-track
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=latest
+ return 0
+ [ -z latest ]
+ db_input high lxd/snap-track
+ _db_cmd INPUT high lxd/snap-track
+ _db_internal_IFS=

+ IFS=
+ printf %s\n INPUT high lxd/snap-track
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=30 question skipped
+ return 30
+ true
+ db_go
+ _db_cmd GO
+ _db_internal_IFS=

+ IFS=
+ printf %s\n GO
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=ok
+ return 0
+ db_get lxd/snap-track
+ _db_cmd GET lxd/snap-track
+ _db_internal_IFS=

+ IFS=
+ printf %s\n GET lxd/snap-track
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=latest
+ return 0
+ track=latest
+ mkdir -p /lib/modules
+ RELEASE=18.10
+ [ -e /etc/os-release ]
+ . /etc/os-release
+ NAME=Ubuntu
+ VERSION=18.10 (Cosmic Cuttlefish)
+ ID=ubuntu
+ ID_LIKE=debian
+ PRETTY_NAME=Ubuntu 18.10
+ VERSION_ID=18.10
+ HOME_URL=https://www.ubuntu.com/
+ SUPPORT_URL=https://help.ubuntu.com/
+ BUG_REPORT_URL=https://bugs.launchpad.net/ubuntu/
+ PRIVACY_POLICY_URL=https://www.ubuntu.com/legal/terms-and-policies/privacy-policy
+ VERSION_CODENAME=cosmic
+ UBUNTU_CODENAME=cosmic
+ echo 18.10
+ RELEASE=18.10
+ echo ==> Installing the LXD snap from the latest track for ubuntu-18.10
==> Installing the LXD snap from the latest track for ubuntu-18.10
+ [ latest = latest ]
+ snap install lxd --channel=stable/ubuntu-18.10
snap "lxd" is already installed, see 'snap help refresh'
+ [ -e /var/lib/lxd/server.crt ]
+ echo ==> Cleaning up leftovers
==> Cleaning up leftovers
+ deb-systemd-invoke stop lxd.socket lxd.service lxd-containers.service
Failed to stop lxd.socket: Unit lxd.socket not loaded.
Failed to stop lxd.service: Unit lxd.service not loaded.
Failed to stop lxd-containers.service: Unit lxd-containers.service not loaded.
+ true
+ deb-systemd-invoke disable lxd.socket lxd.service lxd-containers.service
Failed to disable unit: Unit file lxd.socket does not exist.
+ true
+ rm -rf --one-file-system /etc/dnsmasq.d-available/lxd
+ rm -rf --one-file-system /etc/init.d/lxd
+ rm -rf --one-file-system /etc/logrotate.d/lxd
+ rm -rf --one-file-system /etc/sysctl.d/10-lxd-inotify.conf
+ rm -rf --one-file-system /var/lib/lxd
rm: skipping '/var/lib/lxd/storage-pools/lxd/containers/consumer', since it's on a different device
rm: skipping '/var/lib/lxd/storage-pools/lxd/containers/accurate-possum', since it's on a different device
rm: skipping '/var/lib/lxd/storage-pools/lxd/containers/asgen', since it's on a different device

It's true that they are on a different device:

laney@nightingale> mount -l | grep lxd/containers
lxd/containers/accurate-possum on /var/lib/lxd/storage-pools/lxd/containers/accurate-possum type zfs (rw,xattr,noacl)
lxd/containers/asgen on /var/lib/lxd/storage-pools/lxd/containers/asgen type zfs (rw,xattr,noacl)
lxd/containers/consumer on /var/lib/lxd/storage-pools/lxd/containers/consumer type zfs (rw,xattr,noacl)
laney@nightingale> zpool list
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
lxd 91.5G 6.73G 84.8G - 13% 7% 1.00x ONLINE -

I think it was even lxd that set this up for me.

Revision history for this message
Stéphane Graber (stgraber) wrote :

Hmm, unfortunately the initial run would have been different I suspect.
It looks like the cleanup partly run once and now it's just getting stuck on some leftover mounts.

I suspect we won't be getting to the bottom of what happened here anymore, but we should at least be able to clean things up, move the containers over and get you back online.

Can you show (probably all as root):
 - snap info lxd
 - find /var/lib/lxd -mount
 - find /var/snap/lxd -mount
 - /usr/bin/lxc list
 - /snap/bin/lxc list
 - zfs list -t all
 - zpool status -v

That should give me a good idea of the state of things and how to move forward from there.

Changed in lxd (Ubuntu):
status: New → Incomplete
Revision history for this message
Iain Lane (laney) wrote :

Hey Stéphane, thanks for replying! Sorry that this is producing a different result from the first time I did the upgrade. I had a look, and I found the output from that apt run in /var/log/apt which contains:

  ERROR: Unable to access the '/var/snap/lxd/common/lxd/disks/lxd.img' ZPOOL at this time: Failed to run: zfs list -H -t all -o name,mountpoint -r /var/snap/lxd/common/lxd/disks/lxd.img: '/var/snap/lxd/common/lxd/disks/lxd.img': not a ZFS filesystem^M
       Container mountpoints will need to be manually corrected.^M

maybe that's the original error? Full file attached, and another one with the result of the commands you asked me to run, as that's quite long.

Revision history for this message
Iain Lane (laney) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for lxd (Ubuntu) because there has been no activity for 60 days.]

Changed in lxd (Ubuntu):
status: Incomplete → Expired
Iain Lane (laney)
Changed in lxd (Ubuntu):
status: Expired → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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