cannot update preserved namespace of snap

Bug #1977615 reported by Stephen Buergler
32
This bug affects 7 people
Affects Status Importance Assigned to Milestone
snapd
New
Undecided
Unassigned

Bug Description

I installed discord a while back, then let it update to rev 132 recently. That didn't work. The app kept saying "ERROR: not connected to the gnome-3-28-1804 content interface."
When I try to revert this happens:
$ sudo snap refresh discord --revision=131
error: cannot perform the following tasks:
- Setup snap "discord" (131) security profiles (cannot update mount namespace of snap "discord": cannot update preserved namespace of snap "discord": cannot update snap namespace: remove /usr/bin/gjs: read-only file system)

The bug I'm reporting here is that I can't revert this snap for some reason.

description: updated
Revision history for this message
Miguel Pires (miguelpires1) wrote :

Hi, thank you for reporting this. You mentioned you couldn't revert the snap, but the command you pasted is for a refresh. Does `snap revert --revision=131 discord` work? Could you paste the output of `snap version` please? Could you also run `snap changes`, take the ID of the failed refresh, run `snap change <ID>` with it and paste the output here? Thank you for your help.

Revision history for this message
Stephen Buergler (sixcorners) wrote (last edit ):

I don't think I can reproduce this anymore. I removed/purged and reinstalled it. I also can't seem to install arbitrary revisions.
It works fine now. : \
Sorry and thanks for trying to help.
Feel free to close this.

Revision history for this message
Adam Barton (abarton5) wrote :

I have encountered today. Discord did an auto refresh then refused to load because of a missing gnome connection. I tried to refresh it again and got this message. If reinstalling fixes it I will do that.

$ snap connections discord
Interface Plug Slot Notes
audio-playback discord:audio-playback :audio-playback -
audio-record discord:audio-record :audio-record -
camera discord:camera :camera manual
content discord:gnome-3-38-2004 - -
content[gtk-3-themes] discord:gtk-3-themes gtk-common-themes:gtk-3-themes -
content[icon-themes] discord:icon-themes gtk-common-themes:icon-themes -
content[sound-themes] discord:sound-themes gtk-common-themes:sound-themes -
desktop discord:desktop :desktop -
desktop-legacy discord:desktop-legacy :desktop-legacy -
gsettings discord:gsettings :gsettings -
home discord:home :home -
mount-observe discord:mount-observe - -
network discord:network :network -
network-observe discord:network-observe - -
opengl discord:opengl :opengl -
process-control discord:process-control :process-control manual
removable-media discord:removable-media - -
screen-inhibit-control discord:screen-inhibit-control :screen-inhibit-control -
shared-memory discord:shmem - -
system-observe discord:system-observe :system-observe manual
wayland discord:wayland :wayland -
x11 discord:x11 :x11 -

$ sudo snap refresh discord
error: cannot perform the following tasks:
- Setup snap "discord" (137) security profiles (cannot update mount namespace of snap "discord": cannot update preserved namespace of snap "discord": cannot update snap namespace: remove /usr/bin/gjs: read-only file system)
$ snap version
snap 2.56
snapd 2.56
series 16
ubuntu 22.04
kernel 5.15.0-37-generic

Revision history for this message
James Gaehring (gaehj457) wrote :

Not sure I totally understand how the namespace is effecting this, but I had the same error when trying to run `snap refresh`, which initially failed but was fixed by running `snap-discard-ns`:

$ sudo snap refresh
error: cannot perform the following tasks:
- Setup snap "discord" (137) security profiles (cannot update mount namespace of snap "discord": cannot update preserved namespace of snap "discord": cannot update snap namespace: remove /usr/bin/gjs: read-only file system)
$ sudo /usr/lib/snapd/snap-discard-ns discord
$ sudo snap refresh
discord 0.0.18 from Snapcrafters refreshed

This was based on similar advice for the GIMP snap, mentioned here:
https://forum.snapcraft.io/t/gimp-broken/17958/4

I encountered all this after getting a notification in GNOME top bar that read in part:

> pending update of snap "discord" close the app to avoid disruption

Let me know if I can provide any other info that can help.

Revision history for this message
Denis Donadel (selesnia) wrote :

I had the same problem and I solved it using the commands provided by gaehj457. Thanks!

Revision history for this message
Kees Bakker (keestux) wrote :

Same with mattermost-desktop.

$ sudo snap refresh
error: cannot perform the following tasks:
- Setup snap "mattermost-desktop" (514) security profiles (cannot update mount namespace of snap "mattermost-desktop": cannot update preserved namespace of snap "mattermost-desktop": cannot update snap namespace: remove /usr/bin/gjs: read-only file system)

$ sudo /usr/lib/snapd/snap-discard-ns mattermost-desktop

$ sudo snap refresh
mattermost-desktop 5.1.0 from Snapcrafters refreshed

Revision history for this message
Per Johansson (per.j) wrote :

I encountered this with spotify today.

```
sudo /usr/lib/snapd/snap-discard-ns spotify
```

fixed it.

Revision history for this message
PabloRQ (pablo-romeroquinteros) wrote :

Same behaviour with spotify

$ snap list spotify
Name Version Rev Tracking Publisher Notes
spotify 1.1.84.716.gc5f8b819 60 latest/stable spotify✓ -

$ snap refresh spotify
error: cannot perform the following tasks:
- Setup snap "spotify" (63) security profiles (cannot update mount namespace of snap "spotify": cannot update preserved namespace of snap "spotify": cannot update snap namespace: remove /usr/bin/gjs: read-only file system)

$ ps -elf | grep bin/gjs
0 S user 7331 6555 0 80 0 - 733443 do_pol mar28 ? 00:00:04 /usr/bin/gjs /usr/share/gnome-shell/org.gnome.Shell.Notifications
0 S user 9425 6555 0 80 0 - 716553 do_pol mar28 ? 00:00:00 /usr/bin/gjs /usr/share/gnome-shell/org.gnome.ScreenSaver

$ sudo /usr/lib/snapd/snap-discard-ns spotify
[sudo] password for user:

$ snap refresh spotify
spotify 1.2.8.923.g4f94bf0d from Spotify✓ refreshed

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.