Cannot remove snap package ubuntu 20.10

Bug #1901578 reported by Adams Jensen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Committed
Medium
Paweł Stołowski
snapd (Ubuntu)
Incomplete
Undecided
Unassigned

Bug Description

Hi
after upgrading to ubuntu 20.10 snap packages are no longer removed.
bug reported from snapcraft.io
https://forum.snapcraft.io/t/cant-remove-uninstall-snap-packages/12810/4

snap 2.47.1+20.10.1
snapd 2.47.1+20.10.1
series 16
ubuntu 20.10
kernel 5.8.0-25-generic

andrei@X570-GAMING-X:~$ sudo snap remove opera
[sudo] пароль для andrei:
ошибка: cannot perform the following tasks:
- Save data of snap "opera" in automatic snapshot set #34 (user: lookup userid 1001: no such file or directory)

Revision history for this message
Ian Johnson (anonymouse67) wrote :

Hi, what does:

```
id 1001
```

return on this system?

Changed in snapd (Ubuntu):
status: New → Incomplete
Changed in snapd:
status: New → Incomplete
Revision history for this message
Luis Alberto Pabón (copong) wrote :

I'm seeing the same problem after a clean install of 20.10 over a pre-existing home folder.

~ sudo snap remove slack
error: cannot perform the following tasks:
- Save data of snap "slack" in automatic snapshot set #4 (user: lookup userid 1001: no such file or directory)

~ id 1001
id: ‘1001’: no such user: No such file or directory

There used to be a user 1001 in my system before I reinstalled (just not mine, some other I use to try out other desktop environments).

Revision history for this message
Luis Alberto Pabón (copong) wrote :

After adding a second user...

~ sudo snap remove slack
error: cannot perform the following tasks:
- Save data of snap "slack" in automatic snapshot set #5 (user: lookup userid 1002: no such file or directory)

I did have a third user for testing out other things.

Revision history for this message
Luis Alberto Pabón (copong) wrote :

After adding some random third user, snap removal works again.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This is caused by a bug in the snapshot code, which enumerates users by their HOME entries. We should handle this case better.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I was curious where we do this so I went looking and this is the start of the problem:

https://github.com/snapcore/snapd/blob/7ff96a40a7a7a7779db250b087cec9b183540130/overlord/snapshotstate/backend/helpers.go#L145

In absence of other information, we snapshot the state for all the users this way.

Changed in snapd:
status: Incomplete → Confirmed
importance: Undecided → Medium
Changed in snapd:
assignee: nobody → Paweł Stołowski (stolowski)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

I'll work on a fix; as workaround it is also possible to use 'snap remove --purge <snap>' (which of course skips snapshot creation).

Revision history for this message
Paweł Stołowski (stolowski) wrote :

I investigated and reproduced this with:

$ snap install hello-world
$ mkdir /home/fakeuser/snap
$ chown -R 1090:1088 /home/fakeuser (use uid:gid that are not used on the system).
$ snap remove hello-world

The problem is only affecting groovy and it appears to be fixed with https://github.com/snapcore/snapd/pull/9041/ (which landed on Sep 28th but hasn't been released in stable yet; the fix is included in snapd from edge).

Changed in snapd:
status: Confirmed → Fix Committed
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.