Re-installing from hard disk a snap makes some bindings fail

Bug #1983589 reported by Sergio Costas
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
New
Undecided
Unassigned

Bug Description

When a snap is re-installed from hard disk, some bindings from the LAYOUT statements aren't binded. Specifically those that point to a file/folder that is inside a binded folder.

I attach a simple example that allows to reproduce this bug. This snap uses the "gnome" extension (gnome-42-2204) and core22, so it requires the latest version of snapcraft. Just create the snap as usual with "snapcraft". Then install it in your system with:

  - sudo snap install --dangerous test-core-snap_0.1_amd64.snap

The layout is this one:

layout:
  /usr/lib/test1:
    bind: $SNAP/gnome-platform/lib/udev
  /usr/lib/test2:
    bind: $SNAP/usr/share/test

where $SNAP/gnome-platform is a folder that is automagically binded to /snap/gnome-42-2204/current by the extensions system.

Now run it with

  - snap run test-core-snap

It will print the contents of the following folders: "$SNAP/gnome-platform/lib/udev", "/usr/lib/test1", "$SNAP/usr/share/test", "/usr/lib/test2" and "/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0". This first time everything will look fine: the first two folders will have the same content, the second two folders also will have the same content, and the last one will have four files.

Now, reinstall the snap without uninstalling it and launch it; this is, run again:

  - sudo snap install --dangerous test-core-snap_0.1_amd64.snap
  - snap run test-core-snap

Now the first, third and fourth folders will show the expected content, but the second and the fifth (the ones binded to a folder that is inside an already binded folder) are empty.

Uninstalling the snap and installing it again "fixes" this, until, of course, you reinstall the snap again without uninstalling it previously; this is: executing this:

  - sudo snap remove test-core-snap
  - sudo snap install --dangerous test-core-snap_0.1_amd64.snap
  - snap run test-core-snap

will make it work fine again.

Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :
Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

More data: the previous behavior seems to be with the official Gnome-42-2204 snaps. But with a locally-generated Gnome-42-2204 snap, it seems that the bind to a folder inside a bind never works, although symlinks do work fine.

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.