content interface slot not working probably on parallel install of snap

Bug #1915709 reported by Jochen Scheib on 2021-02-15
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
snapd
Medium
Unassigned

Bug Description

Related forum post: https://forum.snapcraft.io/t/problem-with-content-interface-and-parallel-install/22744/6

Problem: A snap "my-snap" that should support parallel install. This snaps provides a content slot for another snap, "plug-snap". The slot definition:

slots:
  package-assets:
    interface: content
    content: package-assets
    source:
      read:
      - $SNAP_DATA/package-assets/${SNAPCRAFT_PROJECT_NAME}

Another snap uses this provided content to read information about my-snap.
When interfaces are connected, the plug-snap has access to /var/snap/my-snap/current instead of /var/snap/my-snap_key/current

Some more information:

snap list
[...]
snapd 2.49 11107 latest/beta canonical✓ snapd
octoprint-sdev_artistd 1.5.3-devel+202102142159 x1 - - -
octoprint-sdev_mega 1.5.3-devel+202102142159 x1 - - -
[...]

---

Interface Plug Slot Notes
[...]
content[package-assets] rexroth-deviceadmin:package-assets octoprint-sdev_mega:package-assets manual
content[package-assets] rexroth-deviceadmin:package-assets rexroth-automationcore:package-assets manual
content rexroth-deviceadmin:package-run - -
[...]

---

# I created a file wrongdir from outside the snap, just to add clearity
root@idefix:/var/snap/octoprint-sdev/x1/package-assets/octoprint-sdev# ls
wrong_dir
root@idefix:/var/snap/octoprint-sdev/x1/package-assets/octoprint-sdev# snap run --shell octoprint-sdev_mega
root@idefix:/var/snap/octoprint-sdev/x1/package-assets/octoprint-sdev# cd $SNAP_DATA
root@idefix:/var/snap/octoprint-sdev/x1# cd package-assets/octoprint-sdev/
root@idefix:/var/snap/octoprint-sdev/x1/package-assets/octoprint-sdev# ls
octoprint-sdev_mega.package-manifest.json
# Seems like from within the snap shell everything looks correctly

---

# Now on the counter part
root@idefix:/var/snap/octoprint-sdev/x1/package-assets/octoprint-sdev# snap run --shell rexroth-deviceadmin.web
root@idefix:/var/snap/octoprint-sdev/x1/package-assets/octoprint-sdev# cd $SNAP_DATA
root@idefix:/var/snap/rexroth-deviceadmin/x2# cd package-assets/octoprint-sdev/
root@idefix:/var/snap/rexroth-deviceadmin/x2/package-assets/octoprint-sdev# ls
wrong_dir
# Wrong dir is mounted on the counter part

---

# Output of *.fstab
root@idefix:/var/snap/octoprint-sdev/x1/package-assets/octoprint-sdev# cat /var/lib/snapd/mount/snap.octoprint-sdev_mega.fstab
/snap/octoprint-sdev_mega /snap/octoprint-sdev none rbind,x-snapd.origin=overname 0 0
/var/snap/octoprint-sdev_mega /var/snap/octoprint-sdev none rbind,x-snapd.origin=overname 0 0
/var/snap/octoprint-sdev/x1/dist-packages /snap/octoprint-sdev/x1/usr/lib/python3/dist-packages none rbind,rw,x-snapd.origin=layout 0 0
/var/snap/octoprint-sdev/x1/site-packages /snap/octoprint-sdev/x1/usr/lib/python3/site-packages none rbind,rw,x-snapd.origin=layout 0 0
/var/snap/octoprint-sdev/x1/dist-packages /snap/octoprint-sdev/x1/usr/local/lib/python3/dist-packages none rbind,rw,x-snapd.origin=layout 0 0

root@idefix:/var/snap/octoprint-sdev/x1/package-assets/octoprint-sdev# cat /var/lib/snapd/mount/snap.rexroth-deviceadmin.fstab
/snap/rexroth-deviceadmin/x2/shadow /etc/shadow none bind,rw,x-snapd.kind=file,x-snapd.origin=layout 0 0
/snap/rexroth-automationcore/x1/package-assets/rexroth-automationcore /var/snap/rexroth-deviceadmin/x2/package-assets/rexroth-automationcore none bind,ro 0 0
/snap/ctrlx-influxdb/x5/package-assets/ctrlx-influxdb /var/snap/rexroth-deviceadmin/x2/package-assets/ctrlx-influxdb none bind,ro 0 0
/snap/ctrlx-deconz/x79/package-assets/ctrlx-deconz /var/snap/rexroth-deviceadmin/x2/package-assets/ctrlx-deconz none bind,ro 0 0
/var/snap/octoprint-sdev/x1/package-assets/octoprint-sdev /var/snap/rexroth-deviceadmin/x2/package-assets/octoprint-sdev none bind,ro 0 0
/var/lib/snapd/hostfs/var/lib/dhcp /var/lib/dhcp none bind,rw,x-snapd.ignore-missing 0 0
/var/snap/rexroth-automationcore/common/package-certificates/rexroth-automationcore /var/snap/rexroth-deviceadmin/common/package-certificates/rexroth-automationcore none bind 0 0

---

Changed in snapd:
status: New → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers