I've found some situations where snaps fail to get removed, always happening inside lxd containers.
To reproduce:
$ lxc launch ubuntu:xenial snap-test
$ lxc exec snap-test -- apt-get update
$ lxc exec snap-test -- apt-get -y upgrade
$ lxc exec snap-test -- apt-get -y install squashfuse
Inside the lxd:
ubuntu@snap-test:~$ sudo snap install prometheus-openstack-exporter # This one consistently reproduces the issue
ubuntu@snap-test:~$ sudo snap remove prometheus-openstack-exporter
2018-03-08T15:19:47Z ERROR cannot remove snap file "prometheus-openstack-exporter", will retry in 3
mins: [stop snap-prometheus\x2dopenstack\x2dexporter-24.mount] failed with exit status 1: Job for
snap-prometheus\x2dopenstack\x2dexporter-24.mount failed. See "systemctl status
"snap-prometheus\\x2dopenstack\\x2dexporter-24.mount"" and "journalctl -xe" for details.
Remove snap "prometheus-openstack-exporter" (24) from the system ^C
ubuntu@snap-test:~$ snap changes
ID Status Spawn Ready Summary
1 Done 2018-03-08T15:18:51Z 2018-03-08T15:18:51Z Initialize system state
2 Done 2018-03-08T15:19:31Z 2018-03-08T15:19:41Z Install "prometheus-openstack-exporter" snap
3 Done 2018-03-08T15:19:31Z 2018-03-08T15:19:31Z Initialize device
4 Doing 2018-03-08T15:19:46Z - Remove "prometheus-openstack-exporter" snap
ubuntu@snap-test:~$ snap tasks 4
Status Spawn Ready Summary
Done 2018-03-08T15:19:46Z 2018-03-08T15:19:46Z Stop snap "prometheus-openstack-exporter" services
Done 2018-03-08T15:19:46Z 2018-03-08T15:19:46Z Run remove hook of "prometheus-openstack-exporter" snap if present
Done 2018-03-08T15:19:46Z 2018-03-08T15:19:46Z Remove aliases for snap "prometheus-openstack-exporter"
Done 2018-03-08T15:19:46Z 2018-03-08T15:19:47Z Make snap "prometheus-openstack-exporter" unavailable to the system
Done 2018-03-08T15:19:46Z 2018-03-08T15:19:47Z Remove security profile for snap "prometheus-openstack-exporter" (24)
Done 2018-03-08T15:19:46Z 2018-03-08T15:19:47Z Remove data for snap "prometheus-openstack-exporter" (24)
Doing 2018-03-08T15:19:46Z - Remove snap "prometheus-openstack-exporter" (24) from the system
Do 2018-03-08T15:19:46Z - Discard interface connections for snap "prometheus-openstack-exporter" (24)
......................................................................
Remove snap "prometheus-openstack-exporter" (24) from the system
2018-03-08T15:19:47Z ERROR cannot remove snap file "prometheus-openstack-exporter", will retry in 3 mins: [stop snap-prometheus\x2dopenstack\x2dexporter-24.mount] failed with exit status 1: Job for snap-prometheus\x2dopenstack\x2dexporter-24.mount failed. See "systemctl status "snap-prometheus\\x2dopenstack\\x2dexporter-24.mount"" and "journalctl -xe" for details.
2018-03-08T15:22:47Z ERROR cannot remove snap file "prometheus-openstack-exporter", will retry in 3 mins: umount: /snap/prometheus-openstack-exporter/24: not mounted
2018-03-08T15:25:47Z ERROR cannot remove snap file "prometheus-openstack-exporter", will retry in 3 mins: umount: /snap/prometheus-openstack-exporter/24: not mounted
ubuntu@snap-test:~$ df -h /snap/prometheus-openstack-exporter/24
Filesystem Size Used Avail Use% Mounted on
squashfuse 20G 873M 19G 5% /snap/prometheus-openstack-exporter/24
ubuntu@snap-test:~$
The prometheus-openstack-exporter snap consistently reproduces, but I've also seen the case with the 'core' snap:
ubuntu@juju-a45617-3-lxd-1:~$ snap changes
ID Status Spawn Ready Summary
53 Undone 2018-02-28T16:46:09Z 2018-03-07T16:46:26Z
55 Doing 2018-03-07T16:46:27Z -
ubuntu@juju-a45617-3-lxd-1:~$ snap tasks 55
Status Spawn Ready Summary
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:27Z Ensure prerequisites for "core" are available
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:27Z Download snap "core" (4110) from channel "stable"
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:30Z Fetch and check assertions for snap "core" (4110)
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:31Z Mount snap "core" (4110)
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:31Z Stop snap "core" services
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:31Z Remove aliases for snap "core"
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:31Z Make current revision for snap "core" unavailable
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:31Z Copy snap "core" data
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:32Z Setup snap "core" (4110) security profiles
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:32Z Make snap "core" (4110) available to the system
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:37Z Setup snap "core" (4110) security profiles (phase 2)
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:37Z Set automatic aliases for snap "core"
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:37Z Setup snap "core" aliases
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:37Z Run post-refresh hook of "core" snap if present
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:38Z Start snap "core" (4110) services
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:38Z Remove data for snap "core" (2898)
Doing 2018-03-07T16:46:27Z - Remove snap "core" (2898) from the system
Do 2018-03-07T16:46:27Z - Clean up "core" (4110) install
Do 2018-03-07T16:46:27Z - Run configure hook of "core" snap if present
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:27Z Ensure prerequisites for "prometheus-openstack-exporter" are available
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:27Z Download snap "prometheus-openstack-exporter" (24) from channel "edge"
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:30Z Fetch and check assertions for snap "prometheus-openstack-exporter" (24)
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:31Z Mount snap "prometheus-openstack-exporter" (24)
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:31Z Stop snap "prometheus-openstack-exporter" services
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:31Z Remove aliases for snap "prometheus-openstack-exporter"
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:32Z Make current revision for snap "prometheus-openstack-exporter" unavailable
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:32Z Copy snap "prometheus-openstack-exporter" data
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:32Z Setup snap "prometheus-openstack-exporter" (24) security profiles
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:37Z Make snap "prometheus-openstack-exporter" (24) available to the system
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:37Z Set automatic aliases for snap "prometheus-openstack-exporter"
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:37Z Setup snap "prometheus-openstack-exporter" aliases
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:37Z Run post-refresh hook of "prometheus-openstack-exporter" snap if present
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:37Z Start snap "prometheus-openstack-exporter" (24) services
Done 2018-03-07T16:46:27Z 2018-03-07T16:46:37Z Remove data for snap "prometheus-openstack-exporter" (10)
Doing 2018-03-07T16:46:27Z - Remove snap "prometheus-openstack-exporter" (10) from the system
Do 2018-03-07T16:46:27Z - Clean up "prometheus-openstack-exporter" (24) install
Do 2018-03-07T16:46:27Z - Run configure hook of "prometheus-openstack-exporter" snap if present
......................................................................
Make snap "core" (4110) available to the system
2018-03-07T16:46:32Z INFO Requested daemon restart.
......................................................................
Remove snap "core" (2898) from the system
2018-03-08T10:01:53Z ERROR cannot remove snap file "core", will retry in 3 mins: umount: /snap/core/2898: not mounted
2018-03-08T10:04:53Z ERROR cannot remove snap file "core", will retry in 3 mins: umount: /snap/core/2898: not mounted
2018-03-08T10:07:53Z ERROR cannot remove snap file "core", will retry in 3 mins: umount: /snap/core/2898: not mounted
2018-03-08T10:10:53Z ERROR cannot remove snap file "core", will retry in 3 mins: umount: /snap/core/2898: not mounted
2018-03-08T10:13:53Z ERROR cannot remove snap file "core", will retry in 3 mins: umount: /snap/core/2898: not mounted
2018-03-08T10:16:53Z ERROR cannot remove snap file "core", will retry in 3 mins: umount: /snap/core/2898: not mounted
2018-03-08T10:19:53Z ERROR cannot remove snap file "core", will retry in 3 mins: umount: /snap/core/2898: not mounted
2018-03-08T10:22:53Z ERROR cannot remove snap file "core", will retry in 3 mins: umount: /snap/core/2898: not mounted
2018-03-08T10:25:53Z ERROR cannot remove snap file "core", will retry in 3 mins: umount: /snap/core/2898: not mounted
2018-03-08T10:28:53Z ERROR cannot remove snap file "core", will retry in 3 mins: umount: /snap/core/2898: not mounted
......................................................................
Remove snap "prometheus-openstack-exporter" (10) from the system
2018-03-08T10:01:51Z ERROR cannot remove snap file "prometheus-openstack-exporter", will retry in 3 mins: umount: /snap/prometheus-openstack-exporter/10: not mounted
2018-03-08T10:04:51Z ERROR cannot remove snap file "prometheus-openstack-exporter", will retry in 3 mins: umount: /snap/prometheus-openstack-exporter/10: not mounted
2018-03-08T10:07:51Z ERROR cannot remove snap file "prometheus-openstack-exporter", will retry in 3 mins: umount: /snap/prometheus-openstack-exporter/10: not mounted
2018-03-08T10:10:52Z ERROR cannot remove snap file "prometheus-openstack-exporter", will retry in 3 mins: umount: /snap/prometheus-openstack-exporter/10: not mounted
2018-03-08T10:13:52Z ERROR cannot remove snap file "prometheus-openstack-exporter", will retry in 3 mins: umount: /snap/prometheus-openstack-exporter/10: not mounted
2018-03-08T10:16:52Z ERROR cannot remove snap file "prometheus-openstack-exporter", will retry in 3 mins: umount: /snap/prometheus-openstack-exporter/10: not mounted
2018-03-08T10:19:52Z ERROR cannot remove snap file "prometheus-openstack-exporter", will retry in 3 mins: umount: /snap/prometheus-openstack-exporter/10: not mounted
2018-03-08T10:22:52Z ERROR cannot remove snap file "prometheus-openstack-exporter", will retry in 3 mins: umount: /snap/prometheus-openstack-exporter/10: not mounted
2018-03-08T10:25:52Z ERROR cannot remove snap file "prometheus-openstack-exporter", will retry in 3 mins: umount: /snap/prometheus-openstack-exporter/10: not mounted
2018-03-08T10:28:52Z ERROR cannot remove snap file "prometheus-openstack-exporter", will retry in 3 mins: umount: /snap/prometheus-openstack-exporter/10: not mounted
ubuntu@juju-a45617-3-lxd-1:/snap/core/2898$ df -h .
Filesystem Size Used Avail Use% Mounted on
squashfuse 235G 25G 199G 11% /snap/core/2898
ubuntu@juju-a45617-3-lxd-1:/snap/core/2898$
NB: snapd version is 2.29.4.2