Ubuntu update disconnected all snaps

Bug #1943853 reported by Marcos Chirinos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Committed
High
Paweł Stołowski
snapd (Ubuntu)
Incomplete
Undecided
Unassigned

Bug Description

Computer installed some updates on shutdown yesterday and this morning. Update appears to have deleted all snap packages. Icons remain but (most) programs will not load.

Would really like to restore lost programs and files. Especially Authy authentication app.

Typing snap list in terminal shows programs still installed. Folders in snap folder retain paths but folders are empty.

Using Ubuntu 21.04
[Edit: snap is not snapd, See comment #3 for snapd results] ________________

apt-cache policy snap
snap:
  Installed: (none)
  Candidate: 2013-11-29-11
  Version table:
     2013-11-29-11 500
        500 http://us.archive.ubuntu.com/ubuntu hirsute/universe amd64 Packages
________________________________

Shows snap as not installed but WAS installed, whichever version comes packaged with latest Ubuntu.

Results of Snap List:
________________________________

marcos@marcos-Latitude-6430U:~$ snap list
Name Version Rev Tracking Publisher Notes
atom 1.57.0 282 latest/stable snapcrafters classic
authy 1.8.4 6 latest/stable twilio-authy -
brackets 1.14.1 138 latest/stable snapcrafters classic
chartgeany 6.2.8-1snap 12 latest/stable lucast70 -
chromium 93.0.4577.82 1753 latest/stable canonical✓ -
core 16-2.51.4 11606 latest/stable canonical✓ core
core18 20210722 2128 latest/stable canonical✓ base
core20 20210702 1081 latest/stable canonical✓ base
gimp 2.10.24 372 latest/stable snapcrafters -
gnome-3-28-1804 3.28.0-19-g98f9e67.98f9e67 161 latest/stable canonical✓ -
gnome-3-34-1804 0+git.3556cb3 72 latest/stable/… canonical✓ -
gnome-3-38-2004 0+git.6ba6040 70 latest/stable canonical✓ -
gtk-common-themes 0.1-52-gb92ac40 1515 latest/stable/… canonical✓ -
hugo v0.88.1 11017 latest/stable hugo-authors -
kde-frameworks-5-core18 5.61.0 32 latest/stable kde✓ -
onlyoffice-desktopeditors 6.3.1 81 latest/stable onlyoffice✓ -
pocket-browser 1.6.2 10 latest/stable pocketinc -
snap-store 3.38.0-64-g23c4c77 547 latest/stable/… canonical✓ -
snapd 2.51.4 12883 latest/stable canonical✓ snapd
__________________________________

please help

ProblemType: Bug
DistroRelease: Ubuntu 21.04
Package: snap (not installed)
ProcVersionSignature: Ubuntu 5.11.0-34.36-generic 5.11.22
Uname: Linux 5.11.0-34-generic x86_64
ApportVersion: 2.20.11-0ubuntu65.3
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Thu Sep 16 12:44:09 2021
InstallationDate: Installed on 2021-01-13 (246 days ago)
InstallationMedia: Ubuntu 20.10 "Groovy Gorilla" - Release amd64 (20201022)
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: snap
UpgradeStatus: Upgraded to hirsute on 2021-06-10 (97 days ago)

Revision history for this message
Marcos Chirinos (chisau999) wrote :
Revision history for this message
Marcos Chirinos (chisau999) wrote :

Trying to open snapshots folder or a few others gives the error message in the image.

Dylan Aïssi (daissi)
affects: snap (Ubuntu) → snapd (Ubuntu)
Revision history for this message
Marcos Chirinos (chisau999) wrote (last edit ):

Oh so snap and snapd are different things. In that case here is the ~$ apt-cache policy snapd
____________________
snapd:
  Installed: 2.51.1+21.04
  Candidate: 2.51.1+21.04
  Version table:
 *** 2.51.1+21.04 500
        500 http://us.archive.ubuntu.com/ubuntu hirsute-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.49.2+21.04ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu hirsute/main amd64 Packages
_______________________

When I run the bug reporter on snapd it does say I have 2 versions installed.

 - snapd 2.51.4 {latest/stable} snap
 - snapd 2.51.1+21.04 deb package

The first doesn't allow a bug report but gives link to snapcraft forum

The second, I will post screen shots rather than mess someting up typing it out.

Revision history for this message
Marcos Chirinos (chisau999) wrote :
Revision history for this message
Marcos Chirinos (chisau999) wrote :

the dependencies listed takes up 3 images, if they are need will post upon request

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

For a snap that does not work can you run `snap run authy` in a terminal window and show us the output?

Changed in snapd:
status: New → Incomplete
Changed in snapd (Ubuntu):
status: New → Incomplete
Revision history for this message
Marcos Chirinos (chisau999) wrote (last edit ):
Download full text (4.0 KiB)

Here is the output from multiple programs... of the ones tried Atom and Brackets WORK.. the rest all give differing errors. Of course right now I am most concerned about Authy as losing it has locked me out of many of my accounts.

marcos@marcos-Latitude-6430U:~$ snap run authy
/snap/authy/6/authy: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory
marcos@marcos-Latitude-6430U:~$ snap run chromium
/snap/chromium/1753/snap/command-chain/desktop-launch: line 50: /home/marcos/.config/user-dirs.dirs: Permission denied
ERROR: not connected to the gnome-3-28-1804 content interface.
marcos@marcos-Latitude-6430U:~$ snap run openoffice
error: cannot find current revision for snap openoffice: readlink /snap/openoffice/current: no such file or directory
marcos@marcos-Latitude-6430U:~$ snap run atom
marcos@marcos-Latitude-6430U:~$ snap run brackets
[0916/192033:ERROR:browser_main_loop.cc(261)] Gtk: Locale not supported by C library.
 Using the fallback 'C' locale.
Gtk-Message: 19:20:34.052: Failed to load module "atk-bridge"
[0916/192034:ERROR:browser_main_loop.cc(261)] Gtk: /snap/core/current/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/engines/libmurrine.so)
[0916/192034:ERROR:browser_main_loop.cc(261)] Gtk: /snap/core/current/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/engines/libmurrine.so)
Gtk-Message: 19:20:34.120: Failed to load module "canberra-gtk-module"
[0916/192034:ERROR:gconf_listener.cc(117)] Error with gconf key '/apps/metacity/general': Failed to activate configuration server: The name org.gnome.GConf was not provided by any .service files

LoadWindowState(): Could not read /home/marcos/.config/Brackets/window.ini. Error Description:No such file or directory.
/snap/core/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so)
Failed to load module: /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so
marcos@marcos-Latitude-6430U:~$ snap run gimp
/snap/gimp/372/snap/command-chain/desktop-launch: line 50: /home/marcos/.config/user-dirs.dirs: Permission denied
sed: can't read /home/marcos/.config/user-dirs.dirs: Permission denied
/snap/gimp/372/snap/command-chain/desktop-launch: line 242: /home/marcos/.config/user-dirs.dirs: Permission denied
cp: cannot open '/home/marcos/.config/user-dirs.locale' for reading: Permission denied
/snap/gimp/372/snap/command-chain/desktop-launch: line 247: /home/marcos/.config/user-dirs.locale: Permission denied
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
cp: cannot stat '/snap/gimp/372/data-dir/gnome-platform/usr/share/mime': No such file or directory
Directory '/home/marcos/snap/gimp/372/.local/share/mime/packages' does not exist!
/snap/gimp/372/snap/command-...

Read more...

Revision history for this message
Marcos Chirinos (chisau999) wrote :

Don't know if this will help but attached snapd journal, also don't know if the correct variables are used.

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

Can you try rebooting your system to see if the snaps are remounted? it seems like some of the snaps are not properly mounted and the easiest way usually to fix that is to just reboot

Revision history for this message
Marcos Chirinos (chisau999) wrote (last edit ):

Nothing changes on after reboot. Shutting down seems to take longer than usual.

Everything was working find until i ok'd a regular Ubuntu software update last night while shutting down.

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

Can you attach the output of `snap connections` and `snap list` commands?

Revision history for this message
Marcos Chirinos (chisau999) wrote :

marcos@marcos-Latitude-6430U:~$ snap connections
Interface Plug Slot Notes
cups-control gimp:cups-control :cups-control manual
cups-control onlyoffice-desktopeditors:cups-control :cups-control manual

marcos@marcos-Latitude-6430U:~$ snap list
Name Version Rev Tracking Publisher Notes
atom 1.57.0 282 latest/stable snapcrafters classic
authy 1.8.4 6 latest/stable twilio-authy -
brackets 1.14.1 138 latest/stable snapcrafters classic
chartgeany 6.2.8-1snap 12 latest/stable lucast70 -
chromium 93.0.4577.82 1753 latest/stable canonical✓ -
core 16-2.51.4 11606 latest/stable canonical✓ core
core18 20210722 2128 latest/stable canonical✓ base
core20 20210702 1081 latest/stable canonical✓ base
gimp 2.10.24 372 latest/stable snapcrafters -
gnome-3-28-1804 3.28.0-19-g98f9e67.98f9e67 161 latest/stable canonical✓ -
gnome-3-34-1804 0+git.3556cb3 72 latest/stable/… canonical✓ -
gnome-3-38-2004 0+git.6ba6040 70 latest/stable canonical✓ -
gtk-common-themes 0.1-52-gb92ac40 1515 latest/stable/… canonical✓ -
hugo v0.88.1 11017 latest/stable hugo-authors -
kde-frameworks-5-core18 5.61.0 32 latest/stable kde✓ -
onlyoffice-desktopeditors 6.3.1 81 latest/stable onlyoffice✓ -
pocket-browser 1.6.2 10 latest/stable pocketinc -
snap-store 3.38.0-64-g23c4c77 547 latest/stable/… canonical✓ -
snapd 2.51.4 12883 latest/stable canonical✓ snapd

description: updated
Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

This doesn't look right. Can you attach the output of `snap changes`. If there is a change that has an error status, can you also attach the output `snap change <id>` for each one? IDs are in the leftmost column in snap changes output.

Revision history for this message
Marcos Chirinos (chisau999) wrote :

marcos@marcos-Latitude-6430U:~$ snap changes
ID Status Spawn Ready Summary
83 Done yesterday at 13:18 EDT yesterday at 13:18 EDT Snapshot all snaps

the above is everything that shows up. Yesterday I did a snap save command when trying to figure out the snap saved command; snap saved command only lists the snapshot from yesterday, nothing else. See comment #2 for error message of opening snapshot folder in Nautilus.

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

Can you show the output of `snap connections authy`?

Revision history for this message
Marcos Chirinos (chisau999) wrote :

marcos@marcos-Latitude-6430U:~$ snap connections authy
Interface Plug Slot Notes
browser-support authy:browser-support - -
content authy:gnome-3-28-1804 - -
content authy:gtk-3-themes - -
content authy:icon-themes - -
content authy:sound-themes - -
desktop authy:desktop - -
desktop-legacy authy:desktop-legacy - -
gsettings authy:gsettings - -
home authy:home - -
network authy:network - -
opengl authy:opengl - -
pulseaudio authy:pulseaudio - -
unity7 authy:unity7 - -
wayland authy:wayland - -
x11 authy:x11 - -

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

At least to get authy back you can try running the following commands:

for iface in browser-support desktop desktop-legacy gsettings home network opengl unity7 wayland x11; do sudo snap connect authy:$iface system; done
sudo snap connect authy:gnome-3-28-1804 gnome-3-28-1804
sudo snap connect authy:gtk-3-themes gtk-common-themes:gtk-3-themes
sudo snap connect authy:icon-themes gtk-common-themes:icon-themes
sudo snap connect authy:sound-themes gtk-common-themes:sound-themes

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

Also, could you try:
$ snap refresh --beta snapd

(afterwards you can do snap refresh --stable snapd)

and see if it helped restore the connections?

Revision history for this message
Marcos Chirinos (chisau999) wrote :

Comment #17 has allowed me to open Authy, Thanks! Will do was comment #18 says next.

Here is the output from 'snap run authy' perhaps someone can tell me if I have some kind of setting making me vulnerable to whatever the problem was.

marcos@marcos-Latitude-6430U:~$ snap run authy

(authy:5726): Gtk-WARNING **: 12:35:21.424: Theme parsing error: gtk.css:1555:23: 'font-feature-settings' is not a valid property name

(authy:5726): Gtk-WARNING **: 12:35:21.429: Theme parsing error: gtk.css:3593:25: 'font-feature-settings' is not a valid property name

(authy:5726): Gtk-WARNING **: 12:35:21.431: Theme parsing error: gtk.css:4055:23: 'font-feature-settings' is not a valid property name

(authy:5726): dbind-WARNING **: 12:35:27.023: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-4AOVpqBEyv: No such file or directory
TypeError: Cannot read property 'then' of undefined
    at Function.AutoUpdater.init (/snap/authy/6/resources/app.asar/js/background.js:63438:22)
    at Object.create (/snap/authy/6/resources/app.asar/js/background.js:56861:34)
    at App.WindowHelper.create (/snap/authy/6/resources/app.asar/js/background.js:13670:32)
    at App.emit (events.js:208:15)
[5801:0917/123529.642775:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
(node:5822) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:5822) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:5726) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:5726) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Revision history for this message
Marcos Chirinos (chisau999) wrote :

Pawels suggestion has only partially worked, Onlyoffice is now loading but Gimp, Chromium is not loading.

marcos@marcos-Latitude-6430U:~$ snap run gimp
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
/snap/gimp/372/usr/bin/gimp: error while loading shared libraries: libpangocairo-1.0.so.0: cannot open shared object file: No such file or directory

marcos@marcos-Latitude-6430U:~$ snap run chromium
ERROR: not connected to the gnome-3-28-1804 content interface.

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

I suspect that for gimp and chromium you need to run those again, but swap authy for either "gimp" or "chromium":

sudo snap connect authy:gnome-3-28-1804 gnome-3-28-1804
sudo snap connect authy:gtk-3-themes gtk-common-themes:gtk-3-themes
sudo snap connect authy:icon-themes gtk-common-themes:icon-themes
sudo snap connect authy:sound-themes gtk-common-themes:sound-themes

Revision history for this message
Marcos Chirinos (chisau999) wrote :

Yes, Maciej's action worked. Thanks, I will need to figure out some solutions to my personal security to not lose access to my accounts via authy again. But at least now out of immediate danger.

I will keep watching this report for any clue as to the cause and prevention of this same situation. Happy to provide any more data per requests. I am not fluent in terminal but can get around.

Probably not relevant, but the programs Chartgeany and Hugo never worked after initial installation, I though I would still try the same connect command on them but no luck.

arcos@marcos-Latitude-6430U:~$ sudo snap connect chartgeany:gnome-3-28-1804 gnome-3-28-1804
[sudo] password for marcos:
error: snap "chartgeany" has no plug named "gnome-3-28-1804"

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

Ah, what I suggested in comment #18 would only re-create "system" connections (such as desktop, audio-playback etc) provided by snapd, but the other problem is with gnome-3-28-1804 and gtk-common-themes content provider slots. For those, removing and installing them back should re-create their auto-connections, so try this:

$ snap remove gnome-3-28-1804
$ snap remove gtk-common-themes
$ snap install gnome-3-28-1804
$ snap install gtk-common-themes

As for the actual root cause, I fear it will be very hard to understand what went wrong without "snap changes", which unfortunately got pruned already.

summary: - Recent update DELETED SNAP PROGRAMS
+ Ubuntu update disconnected all snaps
Changed in snapd:
status: Incomplete → Confirmed
importance: Undecided → High
assignee: nobody → Paweł Stołowski (stolowski)
Changed in snapd:
status: Confirmed → In Progress
Revision history for this message
Marcos Chirinos (chisau999) wrote :

Thanks for all your hard work, friends. Really makes Ubuntu a great OS.

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

To summarize, there are two issues:
1. snaps were not mounted on restart for some reason
2. this lead to loosing all auto-connected interfaces on snapd start (because snap.yaml files couldn't be read from disk)

The cause of problem #1 is unknown and we had a couple of reports about this in the past. Snaps are automatically mounted by systemd mount units on boot, so why this didn't work is unclear.

For problem #2 I've proposed a fix here: https://github.com/snapcore/snapd/pull/10814 and with it connections should be preserved on such failures.

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

Any chance you could collect the journal logs from 2021-09-16. I think this command should provide the output: `journalctl --since 2021-09-16 --until 2021-09-17`.

I'm switching this bug to Fix Committed, as we landed a fix to not loose connections if the snaps happen to be unavailable and it was also cherry-picked for 2.52.

Changed in snapd:
status: In Progress → Fix Committed
Revision history for this message
Marcos Chirinos (chisau999) wrote :

Almost missed this request. Hope its not too late... If you can give me a quick way to get that data into a txt file before I figure it out that would help. Its over 30,000 lines without any specific unit named.

working on it...

Revision history for this message
Marcos Chirinos (chisau999) wrote :

Ok have it into a txt. I also included Sept 15 as to not miss any important event.

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.