← Back to team overview

canonical-ubuntu-qa team mailing list archive

[Bug 1989603] Re: Can't purge snapd in LXD: rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/...': Function not implemented

 

Hi, had a first look at this,

THE LINE OF CODE THAT CAUSES THE FAILURE:
-----------------------------------------
$ ls /var/lib/dpkg/info/snapd.*
> snapd.prerm snapd.postrm ...

See:
https://github.com/canonical/snapd/blob/master/packaging/ubuntu-16.04/snapd.postrm


As per log: "Removing snap lxd and revision 23541" =>
https://github.com/canonical/snapd/blob/master/packaging/ubuntu-16.04/snapd.postrm#L74 

which is within the "purge" condition
https://github.com/canonical/snapd/blob/master/packaging/ubuntu-16.04/snapd.postrm#L30

This is the line that fails: 
rm -rf --one-file-system "/var/snap/$snap/common"

https://github.com/canonical/snapd/blob/master/packaging/ubuntu-16.04/snapd.postrm#L90


LOOKING AT THE WORLD WITH LXD INSTALLED
----------------------------------------

After installing lxd, and running lxd init, a link
/var/snap/lxd/common/var/lib/lxcfs -> /var/snap/lxd/common/shmounts/lxcfs
but /var/snap/lxd/common/shmounts/lxcfs does not exist.

See: https://paste.ubuntu.com/p/Jg4Z2dbfgd/

So its seems the issue is, that the postrm script tries to remove
something that it did not add.

QUESTIONS
---------

1) @Paride: for your test, does the symlink actaully pointing to
anything, otherwise is not representative of the issue.

2) @LXD team: What is lxd is responsible for populating
"/var/snap/lxd/common/shmounts/lxcfs"?

3) @LXD team: Does lxd snap use a remove hook? 
   https://snapcraft.io/docs/supported-snap-hooks#heading--remove

-- 
You received this bug notification because you are a member of
Canonical's Ubuntu QA, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1989603

Title:
  Can't purge snapd in LXD: rm: cannot remove
  '/var/snap/lxd/common/var/lib/lxcfs/...': Function not implemented

Status in lxd:
  Fix Released
Status in snapd package in Ubuntu:
  Confirmed

Bug description:
  In LXD containers snapd can't be purge-removed. One tool affected by
  this bug is autopkgtest-build-lxd, which attempts to purge several
  packages (including snapd) to create a base image to run autopkgtests
  on.

  Steps to reproduce:

    lxc launch ubuntu:jammy paride-j
    lxc exec paride-j -- apt-get -y remove --purge snapd

  Kinetic is also affected, I didn't test older releases. To see how
  this affects autopkgtest-build-lxd just install autopkgtest and run:

    autopkgtest-build-lxd ubuntu:jammy

  This reminds me of LP: #1903967, but it's likely a different issue.

  --- relevant log excerpt ---

  [...]
  Purging configuration files for snapd (2.56.2+22.04ubuntu1) ...
  Stopping snap.lxd.activate.service
  Stopping unit snap.lxd.activate.service
  Waiting until unit snap.lxd.activate.service is stopped [attempt 1]
  snap.lxd.activate.service is stopped.
  Removing snap.lxd.activate.service
  Stopping snap.lxd.daemon.service
  Stopping unit snap.lxd.daemon.service
  Waiting until unit snap.lxd.daemon.service is stopped [attempt 1]
  snap.lxd.daemon.service is stopped.
  Removing snap.lxd.daemon.service
  Stopping snap.lxd.user-daemon.service
  Stopping unit snap.lxd.user-daemon.service
  Waiting until unit snap.lxd.user-daemon.service is stopped [attempt 1]
  snap.lxd.user-daemon.service is stopped.
  Removing snap.lxd.user-daemon.service
  Stopping snap-core20-1611.mount
  Stopping unit snap-core20-1611.mount
  Waiting until unit snap-core20-1611.mount is stopped [attempt 1]
  snap-core20-1611.mount is stopped.
  Removing snap core20 and revision 1611
  Removing snap-core20-1611.mount
  Stopping snap-lxd-23541.mount
  Stopping unit snap-lxd-23541.mount
  Waiting until unit snap-lxd-23541.mount is stopped [attempt 1]
  snap-lxd-23541.mount is stopped.
  Removing snap lxd and revision 23541
  rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/proc/cpuinfo': Function not implemented
  rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/proc/meminfo': Function not implemented
  rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/proc/stat': Function not implemented
  rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/proc/uptime': Function not implemented
  rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/proc/diskstats': Function not implemented
  rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/proc/swaps': Function not implemented
  rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/proc/loadavg': Function not implemented
  rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/proc/slabinfo': Function not implemented
  rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/sys/devices/system/cpu/cpu0/cpuidle/state5/disable': Function not implemented
  rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/sys/devices/system/cpu/cpu0/cpuidle/state5/above': Function not implemented
  rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/sys/devices/system/cpu/cpu0/cpuidle/state5/time': Function not implemented
  rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/sys/devices/system/cpu/cpu0/cpuidle/state5/rejected': Function not implemented
  rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/sys/devices/system/cpu/cpu0/cpuidle/state5/power': Function not implemented
  rm: cannot remove '/var/snap/lxd/common/var/lib/lxcfs/sys/devices/system/cpu/cpu0/cpuidle/state5/residency': Function not implemented
  [...]

To manage notifications about this bug go to:
https://bugs.launchpad.net/lxd/+bug/1989603/+subscriptions