Comment 4 for bug 1808821

Revision history for this message
Lucy Llewellyn (lucyllewy) wrote :

This isn't specific to the arch triplet as I surmised in my original post. I've reproduced it with a layout of:

```
layout:
  /usr/share/alsa/alsa.conf:
    bind-file: $SNAP/usr/share/alsa/alsa.conf
```

My reproduction repoistory is at https://github.com/diddlesnaps/layout-fail

If you attempt to install the resultant snap three times, executing the `layout-fail` command between each, the third attempt will fail with:

```
- Setup snap "layout-fail" (unset) security profiles (cannot setup mount for snap "layout-fail": cannot update mount namespace of snap "layout-fail": cannot update preserved namespace of snap "layout-fail": cannot update snap namespace: cannot write to "/usr/share/alsa/alsa.conf" because it would affect the host in "/usr/share/alsa")
- Setup snap "layout-fail" (unset) security profiles (cannot update mount namespace of snap "layout-fail": cannot update preserved namespace of snap "layout-fail": cannot update snap namespace: cannot write to "/usr/share/alsa/alsa.conf" because it would affect the host in "/usr/share/alsa")
```

A subsequent attempt to install without discarding the namespace fails differently with:

```
error: cannot perform the following tasks:
- Setup snap "layout-fail" (unset) security profiles (cannot setup mount for snap "layout-fail": cannot update mount namespace of snap "layout-fail": cannot update preserved namespace of snap "layout-fail": cannot update snap namespace: no such file or directory)
- Setup snap "layout-fail" (unset) security profiles (cannot update mount namespace of snap "layout-fail": cannot update preserved namespace of snap "layout-fail": cannot update snap namespace: no such file or directory)
```

If you discard the namespace then two more installations, separated by running the `layout-fail` command, will be accepted by snapd. If you do not run the `layout-fail` command between each installation you may install as many times as you like without failure.