All snaps showing as 'broken'

Been doing some testing in a 14.04 VM and none of my snaps launch, and all show as ‘broken’. Previously @Ads20000 reported a similar problem, @niemeyer suggested a new post when/if it happens again, so here we are :slight_smile:

alan@alan-VirtualBox:~$ snap list
Name               Version                  Rev   Developer      Notes
brave                                       8     brave          broken
core                                        3517  canonical      broken
discord-test                                5     flexiondotorg  broken
gedit                                       34    canonical      broken
gnome-3-26-1604                             27    canonical      broken
gnome-characters   3.26.2                   38    canonical      -
gnome-sudoku                                22    canonical      broken
heroku                                      1513  dickeyxxx      broken
mailspring                                  73    foundry376     broken
nextcloud          11.0.5snap2              3680  nextcloud      -
node-red                                    56    dcj            broken
ohmygiraffe                                 3     popey          broken
pycharm-community                           39    jetbrains      broken
shellcheck                                  x2                   broken
skype                                       x1                   broken
snapcraft                                   876   canonical      broken
teleconsole                                 3     popey          broken

The snap files themselves exist on disk.

alan@alan-VirtualBox:~$ ls -l /var/lib/snapd/snaps
total 3298368
-rw-r--r-- 1 root root 162717696 Nov 10 12:56 brave_8.snap
-rw-r--r-- 1 root root  87875584 Nov 10 12:15 core_3396.snap
-rw-r--r-- 1 root root  87793664 Nov 24 10:38 core_3440.snap
-rw-r--r-- 1 root root  87859200 Nov 30 17:03 core_3517.snap
-rw-r--r-- 1 root root 116383744 Mar  7  2017 discord-test_3.snap
-rw-r--r-- 1 root root 116383744 Mar 15  2017 discord-test_5.snap
-rw------- 1 root root 160444416 Nov 30 17:12 firefox_x1.snap
-rw-r--r-- 1 root root   4222976 Oct 27 15:21 gedit_30.snap
-rw-r--r-- 1 root root   4247552 Nov 10 12:15 gedit_31.snap
-rw-r--r-- 1 root root   4247552 Nov 30 17:03 gedit_34.snap
-rw-r--r-- 1 root root 134303744 Oct 27 15:21 gnome-3-26-1604_21.snap
-rw-r--r-- 1 root root 135131136 Nov 10 12:15 gnome-3-26-1604_25.snap
-rw-r--r-- 2 root root 135569408 Nov 24 10:39 gnome-3-26-1604_27.snap
-rw-r--r-- 1 root root  12787712 Nov 10 12:15 gnome-characters_23.snap
-rw-r--r-- 1 root root  12791808 Nov 24 10:38 gnome-characters_26.snap
-rw-r--r-- 1 root root  12791808 Nov 30 17:03 gnome-characters_38.snap
-rw-r--r-- 1 root root   2949120 Oct 27 15:21 gnome-sudoku_17.snap
-rw-r--r-- 1 root root   2949120 Nov 10 12:15 gnome-sudoku_19.snap
-rw-r--r-- 1 root root   2945024 Nov 30 17:03 gnome-sudoku_22.snap
-rw-r--r-- 2 root root  38203392 Nov 24 10:43 heroku_1513.snap
-rw-r--r-- 1 root root 161517568 Nov 10 13:07 mailspring_67.snap
-rw-r--r-- 2 root root 161484800 Nov 24 10:39 mailspring_70.snap
-rw-r--r-- 2 root root 161468416 Nov 30 17:05 mailspring_73.snap
-rw-r--r-- 1 root root 191303680 Nov 10 12:17 nextcloud_3680.snap
-rw-r--r-- 1 root root  66555904 Nov 10 13:00 node-red_52.snap
-rw-r--r-- 1 root root  66113536 Nov 10 13:07 node-red_56.snap
-rw-r--r-- 1 root root  28651520 Feb  7  2017 ohmygiraffe_3.snap
drwxr-xr-x 2 root root      4096 Jan 17  2017 partial
-rw-r--r-- 1 root root 194240512 Nov 10 12:24 pycharm-community_33.snap
-rw-r--r-- 1 root root 268070912 Nov 30 17:04 pycharm-community_39.snap
-rw------- 1 root root   3072000 Feb  3  2017 shellcheck_x1.snap
-rw------- 1 root root   6750208 Feb  3  2017 shellcheck_x2.snap
-rw------- 1 root root 240185344 Dec  1 08:32 skype_x1.snap
-rw-r--r-- 1 root root  53592064 Nov 24 10:38 snapcraft_837.snap
-rw-r--r-- 2 root root  53690368 Nov 30 17:04 snapcraft_871.snap
-rw-r--r-- 1 root root  53612544 Dec  1 00:12 snapcraft_876.snap
-rw-r--r-- 1 root root 169832448 Aug 18 12:20 spotify_1.snap
-rw------- 1 root root 167456768 Nov 30 17:15 spotify_x1.snap
-rw-r--r-- 1 root root   3616768 Feb  3  2017 teleconsole_1.snap
-rw-r--r-- 1 root root   3661824 Oct  6 15:27 teleconsole_3.snap

This is the version of snapd…

alan@alan-VirtualBox:~$ snap version
snap    2.28.5~14.04
snapd   2.28.5~14.04
series  16
ubuntu  14.04
kernel  4.4.0-101-generic
alan@alan-VirtualBox:~$ snap info core
name:      core
summary:   snapd runtime environment
publisher: canonical
contact:   snappy-canonical-storeaccount@canonical.com
description: |
  The core runtime environment for snapd
snap-id:     99T7MUlRhtI3U0QFgl5mXXESAiSwt776
tracking:    candidate
installed:     (3517) 0B broken
refreshed:   2017-11-30 17:03:52.19701 +0000 UTC
channels:                                      
  stable:    16-2.29.3                  (3440) 87MB -
  candidate: 16-2.29.4                  (3517) 87MB -
  beta:      16-2.29.4.2                (3604) 87MB -
  edge:      16-2.30~rc1+git467.c2f9631 (3615) 87MB -

Nothing particularly odd in snap changes

alan@alan-VirtualBox:~$ snap changes
ID   Status  Spawn                 Ready                 Summary
44   Done    2017-11-30T17:03:29Z  2017-11-30T17:05:17Z  Auto-refresh 7 snaps
45   Done    2017-11-30T17:07:08Z  2017-11-30T17:07:13Z  Install "sss" snap from file "sss_4.snap"
46   Done    2017-11-30T17:12:29Z  2017-11-30T17:12:32Z  Install "fff" snap from file "fff-58.0b7.snap"
47   Done    2017-11-30T17:15:59Z  2017-11-30T17:16:02Z  Install "rrr" snap from file "rrr_2.snap"
48   Done    2017-11-30T18:16:45Z  2017-11-30T18:16:47Z  Remove "sss" snap
49   Error   2017-11-30T18:17:56Z  2017-11-30T18:17:57Z  Install "sss" snap from file "sss_4.snap"
50   Done    2017-11-30T18:18:05Z  2017-11-30T18:18:06Z  Install "sss" snap from file "sss_4.snap"
51   Done    2017-12-01T00:12:52Z  2017-12-01T00:12:57Z  Auto-refresh snap "snapcraft"
52   Done    2017-12-01T08:31:43Z  2017-12-01T08:31:43Z  Remove "sss" snap
53   Done    2017-12-01T08:32:02Z  2017-12-01T08:32:03Z  Install "sss" snap from file "sss_4.snap"

What other logs do you need from this system? I have frozen the VM.

I thought this is related to snapd starting before the snaps are mounted and thinking there is nothing there. I thought we had a fix or tried to fix it at least. cc @zyga-snapd

Thanks for your post about this problem! We looked at this some days ago and the fix went into https://github.com/snapcore/snapd/pull/4081 - the fix is part of the 2.29 stable release.

One complication is that we currently do not rewrite existing mount units, so all the new mount units for new snaps will be fine, but the old one may still show up in the broken state.

2 Likes

I still have the ‘broken’ issue with core 4110.

mount | grep snap

probably reveals, that some of the ‘broken’ images are not mounted.

cd /etc/systemd/system
ls *.mount | sudo xargs systemctl start

mounts these images and a following

snap list

should show at least these before broken snaps as fine

snap 2.49
snapd 2.48.3+20.04
series 16
linuxmint 20
kernel 5.4.0-66-generic

Name                     Version        Rev    Tracking       Publisher              Notes
android-studio                          101    latest/stable  snapcrafters           broken
chromium-ffmpeg                         17     latest/stable  canonical✓             broken
code-insiders            469e4f6e       661    latest/stable  vscode✓                classic
core                     16-2.49        10859  latest/stable  canonical✓             core
core18                   20210128       1988   latest/stable  canonical✓             base
core20                   20201210       904    latest/stable  canonical✓             base
flutter                  0+git.e2e65ac  62     latest/stable  flutter-team✓          classic
freemind                 1.1.0-Beta-2   4      latest/stable  jibel                  -
gnome-3-28-1804                         145    latest/stable  canonical✓             broken
gnome-3-34-1804                         66     latest/stable  canonical✓             broken
gtk-common-themes                       1514   latest/stable  canonical✓             broken
intellij-idea-community                 289    latest/stable  jetbrains✓             broken
netbeans                 12.3           45     latest/stable  apache-netbeans✓       classic
ngrok                    2.3.35         29     latest/stable  khiemdoan              -
notekit                  0.1            9      latest/edge    noasakurajin           -
opera                    72.0.3815.320  100    latest/stable  opera-software✓        -
postman                  7.36.5         133    latest/stable  postman-inc✓           disabled
powershell               7.1.3          160    latest/stable  microsoft-powershell✓  classic
pycharm-educational                     36     latest/stable  jetbrains✓             broken
rider                    2020.3.4       176    latest/stable  jetbrains✓             classic
speedy-duplicate-finder                 30     latest/stable  qiplex✓                broken

Detail:

>ls -l /var/lib/snapd/
total 244
drwxr-xr-x 4 root root   4096 set 23 19:02 apparmor
drwxr-xr-x 4 root root   4096 set 23 18:56 assertions
drwxr-xr-x 2 root root   4096 set  4  2020 auto-import
lrwxrwxrwx 1 root root     18 ago 11  2020 cache -> /dados/.snap/cache
drwx------ 2 root root   4096 mar 20 23:59 cookie
drwxr-xr-x 4 root root   4096 set 23 18:56 dbus-1
drwxr-xr-x 4 root root   4096 set 23 19:02 desktop
drwxr-xr-x 3 root root   4096 set 23 18:56 device
drwxr-xr-x 2 root root   4096 set  4  2020 environment
-rw------- 1 root root  65536 mar 22 14:47 errtracker.db
drwxr-xr-x 2 root root   4096 dez  7 11:41 features
drwxr-xr-x 2 root root   4096 set  4  2020 firstboot
drwxr-xr-x 2 root root   4096 set 23 22:47 hostfs
drwxr-xr-x 2 root root   4096 mar 20 23:37 inhibit
drwxr-xr-x 6 root root   4096 set 23 18:56 lib
drwxr-xr-x 2 root root   4096 mar 22 14:47 mount
drwxr-xr-x 3 root root   4096 set 23 18:56 seccomp
drwxr-xr-x 2 root root   4096 mar 22 14:47 sequence
lrwxrwxrwx 1 root root     18 set 23 18:55 snaps -> /dados/.snap/snaps
drwx------ 2 root root   4096 mar 21 01:37 snapshots
drwxr-xr-x 3 root root   4096 set 23 18:56 ssl
-rw------- 1 root root 136435 mar 22 20:52 state.json
d--x--x--x 2 root root   4096 set  4  2020 void