layout lost after snapd refresh with long running content plugging snap

Bug #1888305 reported by Jamie Strandboge
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zygmunt Krynicki

Bug Description

I have a (private, since it is not ready for consumption) snap that I use personally:

It uses a layout:

      bind: $SNAP/usr/share/hamster-applet

and plugs gtk2 content:

      interface: content
      target: $SNAP/lib/gtk-2.0
      default-provider: gtk2-common-themes
      interface: content
      target: $SNAP/data-dir/themes
      default-provider: gtk2-common-themes
      interface: content
      target: $SNAP/data-dir/icons
      default-provider: gtk-common-themes
      interface: content
      target: $SNAP/data-dir/icons
      default-provider: gtk-common-themes

(note, I've since adjusted the snap to not use a layout to avoid this bug, but the snap in the wget uses the layout).

If I install the snap and run its 'indicator' (ie, a long running process) and then perform a snap refresh of the snapd snap, then the layout is lost. Steps to reproduce:

In a focal desktop VM:

$ snap info snapd # verify using stable
tracking: latest/stable
refresh-date: today at 09:29 CDT
  latest/stable: 2.45.2 2020-07-15 (8542) 31MB -

$ snap version
snap 2.45.2
snapd 2.45.2
series 16
ubuntu 20.04
kernel 5.4.0-37-generic

$ sudo apt-get install gconf2 # required for the snap to run

$ wget

$ sudo snap install --devmode --dangerous ./hamster-jdstrand*snap

$ hamster-jdstrand.indicator
<indicator should now be running with this not returning>
<use indicator to 'Show Overview'. It should work>

In another terminal:

$ sudo snap refresh snapd --edge
$ snap version
snap 2.45.2+git2048.gb2fd998
snapd 2.45.2+git2048.gb2fd998
series 16
ubuntu 20.04
kernel 5.4.0-37-generic

Now go to indicator and do 'Show Overview' and it will fail with with (as seen in the first terminal):

/snap/hamster-jdstrand/x1/usr/lib/python2.7/dist-packages/hamster/ GtkWarning: IA__gtk_accel_label_set_accel_closure: assertion 'gtk_accel_group_from_accel_closure (accel_closure) != NULL' failed
  ui.add_from_file(os.path.join(runtime.data_dir, name))
Traceback (most recent call last):
  File "/snap/hamster-jdstrand/x1/bin/hamster-indicator", line 212, in on_overview_show_activated
  File "/snap/hamster-jdstrand/x1/usr/lib/python2.7/dist-packages/hamster/", line 106, in show
    dialog = self.get_dialog_class()(parent, **kwargs)
  File "/snap/hamster-jdstrand/x1/usr/lib/python2.7/dist-packages/hamster/", line 50, in __init__
    self._gui = load_ui_file("overview.ui")
  File "/snap/hamster-jdstrand/x1/usr/lib/python2.7/dist-packages/hamster/", line 156, in load_ui_file
    ui.add_from_file(os.path.join(runtime.data_dir, name))
glib.GError: Failed to open file '/usr/share/hamster-applet/overview.ui': No such file or directory

Note, /usr/share/hamster-applet/overview.ui is from the layout as specified in the snap.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Tentatively assigning to zyga since we discussed this on IRC. Please adjust as necessary.

Changed in snapd:
assignee: nobody → Zygmunt Krynicki (zyga)
description: updated
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I tried reproducing but was unsuccessful.

I have some more ideas to try today.

Changed in snapd:
status: New → Triaged
importance: Undecided → High
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.