Regression? snapd (or maybe the store) isn't connecting icon-themes plugs on new installs

I installed utm-no from @sil to experiment as this snap is tiny and uses the gnome extension. The gnome extension adds plugs for gnome-3-34-1804, gtk-3-themes, icon-themes, and sound-themes. The last three there should all be automatically connected to their relevant slots in the gtk-common-themes snap, but it seems only gtk-3-themes and sound-themes are leaving icon-themes dangling until manually connected.

The non-connected state by default causes, for example, discord to completely crash when calling the add attachment to chat button:

(Discord:1182341): Gtk-WARNING **: 08:29:57.586: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /org/gtk/libgtk/icons/16x16/status/image-missing.png: Unable to load image-loading module: /snap/discord/133/gnome-platform/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so: /snap/discord/133/gnome-platform/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so: cannot open shared object file: No such file or directory (gdk-pixbuf-error-quark, 5)
1 Like

By any chance, do you have theme snaps besides gtk-common-themes installed? If so, which ones?

I think this is a problem with the snap declaration for gtk-common-themes. In particular, there is no slots-per-plug attribute for icon-themes and sound-themes:

$ snap known --remote snap-declaration series=16 snap-id=jZLfBRzf1cYlYysIjD2bwSzNtngY0qit
type: snap-declaration
format: 2
authority-id: canonical
revision: 5
series: 16
snap-id: jZLfBRzf1cYlYysIjD2bwSzNtngY0qit
publisher-id: canonical
slots:
  content:
    allow-auto-connection:
      -
        plug-attributes:
          content: $SLOT(content)
        slot-attributes:
          content: gtk-3-themes
        slots-per-plug: *
      -
        plug-attributes:
          content: $SLOT(content)
        slot-attributes:
          content: icon-themes
      -
        plug-attributes:
          content: $SLOT(content)
        slot-attributes:
          content: sound-themes
      -
        plug-attributes:
          content: $SLOT(content)
        slot-attributes:
          content: gtk-2-themes
        slots-per-plug: *
snap-name: gtk-common-themes
timestamp: 2020-09-08T21:59:33.182794Z
sign-key-sha3-384: BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul
...

I’d missed that this had only been applied to the gtk-2-themes and gtk-3-themes slots. As I understand it, things should connect correctly if gtk-common-themes is the only snap providing an icon-themes content interface slot, but is going to cause problems when a second snap with the slot is installed unless all slot snaps have slots-per-plug: * set.

1 Like

Interesting. That does sound about right then, because I’m on Ubuntu Mate so I have gtk-theme-yaru-mate included by default out of the box from installation time. (this sentence brought to you by the redundant department of redundancy department)

It’s probably the icon-theme-yaru-mate snap that’s causing the problems (assuming it’s installed). If you remove that snap, I suspect the icon-themes plug should connect correctly when installing snaps.

And to be clear: the problem is in gtk-common-themes rather than the other snaps, and should resolve itself once the snap declaration is updated. I’ve put in a request to update this here:

1 Like

It looks like I’ve got the new gtk-common-themes assertion after an auto-refresh occurred. You should be able to tell the same on your system by running the following (note no use of --remote):

$ snap known snap-declaration series=16 snap-id=jZLfBRzf1cYlYysIjD2bwSzNtngY0qit

If that shows revision 6 of the assertion, then I would expect auto-connection of icon-themes plugs for newly installed or refreshed snaps to auto-connect correctly. When you’ve got a chance, could you verify if that’s the case for you too?

1 Like

Can confirm that the new declaration, once downloaded, correctly allows for new installs/refreshes to connect the icon-themes plugs:

$ snap install utm-no
utm-no 0+git.b9f523f from Stuart Langridge (sil) installed

$ snap connections utm-no
Interface                 Plug                    Slot                              Notes
content[gnome-3-34-1804]  utm-no:gnome-3-34-1804  gnome-3-34-1804:gnome-3-34-1804   -
content[gtk-3-themes]     utm-no:gtk-3-themes     gtk-common-themes:gtk-3-themes    -
content[gtk-3-themes]     utm-no:gtk-3-themes     gtk-theme-yaru-mate:gtk-3-themes  -
content[icon-themes]      utm-no:icon-themes      gtk-common-themes:icon-themes     -
content[icon-themes]      utm-no:icon-themes      icon-theme-yaru-mate:icon-themes  -
content[sound-themes]     utm-no:sound-themes     gtk-common-themes:sound-themes    -
desktop                   utm-no:desktop          :desktop                          -
desktop-legacy            utm-no:desktop-legacy   :desktop-legacy                   -
gsettings                 utm-no:gsettings        :gsettings                        -
network                   utm-no:network          :network                          -
opengl                    utm-no:opengl           :opengl                           -
wayland                   utm-no:wayland          :wayland                          -
x11                       utm-no:x11              :x11                              -
1 Like

I got the same error when trying to download a file:

(ferdium:976667): Gtk-WARNING **: 08:54:55.008: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /snap/ferdium/278/data-dir/icons/Yaru/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)

Snap connections yields following:

Interface                 Plug                     Slot                              Notes
audio-playback            ferdium:audio-playback   :audio-playback                   -
audio-record              ferdium:audio-record     -                                 -
browser-support           ferdium:browser-support  :browser-support                  -
camera                    ferdium:camera           -                                 -
content[gnome-3-28-1804]  ferdium:gnome-3-28-1804  gnome-3-28-1804:gnome-3-28-1804   -
content[gtk-3-themes]     ferdium:gtk-3-themes     gtk-common-themes:gtk-3-themes    -
content[icon-themes]      ferdium:icon-themes      gtk-common-themes:icon-themes     -
content[icon-themes]      ferdium:icon-themes      icon-theme-yaru-mate:icon-themes  -
content[sound-themes]     ferdium:sound-themes     gtk-common-themes:sound-themes    -
desktop                   ferdium:desktop          :desktop                          -
desktop-legacy            ferdium:desktop-legacy   :desktop-legacy                   -
gsettings                 ferdium:gsettings        :gsettings                        -
home                      ferdium:home             :home                             -
network                   ferdium:network          :network                          -
opengl                    ferdium:opengl           :opengl                           -
pulseaudio                ferdium:pulseaudio       -                                 -
removable-media           ferdium:removable-media  -                                 -
unity7                    ferdium:unity7           :unity7                           -
wayland                   ferdium:wayland          :wayland                          -
x11                       ferdium:x11              :x11                              -

And the revision is 6

Is this the same problem, a new problem, still an issue? Do you have any ideas on how to solve that?