mount namespace issues

Bug #1891371 reported by Kyle Nitzsche
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Released
High
Zygmunt Krynicki

Bug Description

On a customer project we are seeing various mount namespace errors that seem to prevent installing from seed on first boot, and interface manual connection.

ERROR cannot update mount namespace of snap "THESNAP": cannot update preserved namespace of snap "THESNAP":
[...]
umount "/lib/ld-musl-x86_64.so.1" UMOUNT_NOFOLLOW (error: device or resource busy)

I'll email the complete debug first boot log to Ian and Zygmunt (due to private poject)

The snap has a layout:

layout:
  /lib/ld-musl-x86_64.so.1:
    bind-file: $SNAP/lib/x86_64-linux-musl/libc.so

And uses the gnome-3-28 extension:

  ui:
    extensions: [gnome-3-28]

Regarding global plugs/slots we have:

slots:
  x11-slot:
    interface: x11
plugs:
  station0:
    interface: serial-port
  logind:
    bus: system
    interface: dbus
    name: org.freedesktop.login1
[ . . . ]
hooks:
  install:
    plugs:
      - snapd-control
      - hardware-observe
  configure:
    plugs: []
  post-refresh:
    plugs: [snapd-control]

And spread among apps the following plugs:
      - snapd-control
      - network
      - i2c
      - opengl
      - audio-playback
      - wayland
      - network-manager
      - network-observe
      - network-bind
      - network-control
      - shutdown
      - snapd-control (we have an potential queueing issue with post-refresh and app using this)
      - station0
      - logind

And this slot: (which should be changed to network-bind with no slot I think)
    slots: [ x11-slot ]

When I try to manually connect i2c to a slot defined in the gadget, I also get a namespace error:

"user@linux:~$ snap connect THESNAP:i2c GADGET:i2c-1
error: cannot perform the following tasks:
- Connect THESNAP:i2c to GADGET:i2c-1 (cannot update mount namespace of snap "THESNAP": cannot update preserved namespace of snap "THESNAP":
-----
update.go:85: cannot change mount namespace according to change unmount (/snap/gnome-3-28-1804/128 /snap/THESNAP/79/gnome-platform none bind,ro 0 0): device or resource busy
cannot update snap namespace: device or resource busy"

user@linux:~$ snap version
snap 2.45.3.1
snapd 2.45.3.1
series 16
kernel 4.15.0-1004-fde

Changed in snapd:
assignee: nobody → Zygmunt Krynicki (zyga)
Zygmunt Krynicki (zyga)
Changed in snapd:
status: New → In Progress
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I managed to reproduce the symptom but I was unable to reproduce the whole flow. I'm working through the kernel side co confirm my theory and to test a snapd-side fix. Following that I will explore an idea that may fix this without changing snapd, so that the customer snap can be unblocked.

Zygmunt Krynicki (zyga)
Changed in snapd:
importance: Undecided → High
milestone: none → 2.46
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I now understand the bug in detail, can reproduce it reliably, have fixed it and I believe my idea will also allow you to work around it before a fix is available. I will post details of the workaround via private mail.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :
Zygmunt Krynicki (zyga)
Changed in snapd:
status: In Progress → Fix Committed
Revision history for this message
Simon Déziel (sdeziel) wrote :

Marking as fix released because the PR was merged and released with snapd 2.46.

Changed in snapd:
status: Fix Committed → Fix Released
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.