snap-confine (or some helper) can't open cgroup freezer tasks file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Triaged
|
Medium
|
Zygmunt Krynicki |
Bug Description
It's not clear to me how I got myself into this situation (nor really how I got out of it), but I was stuck being unable to install a simple test snap, because some helper inside snap-confine would consistently fail thusly:
$ SNAPD_DEBUG=1 SNAP_CONFINE_
2019/12/12 13:51:09.374431 cmd_linux.go:194: DEBUG: re-exec disabled by user
error: cannot perform the following tasks:
- Run install hook of "test-post-
-----
var/lib/
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: remounting tmpfs as read-only /tmp/snap.
DEBUG: mounting tmpfs at /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: remounting tmpfs as read-only /tmp/snap.
DEBUG: mounting tmpfs at /tmp/snap.
DEBUG: creating symbolic link /tmp/snap.
DEBUG: remounting tmpfs as read-only /tmp/snap.
DEBUG: performing operation: pivot_root /tmp/snap.
DEBUG: performing operation: (disabled) use debug build to see details
DEBUG: performing operation: rmdir /var/lib/
DEBUG: performing operation: (disabled) use debug build to see details
DEBUG: performing operation: (disabled) use debug build to see details
DEBUG: performing operation: (disabled) use debug build to see details
DEBUG: performing operation: (disabled) use debug build to see details
DEBUG: performing operation: (disabled) use debug build to see details
DEBUG: performing operation: (disabled) use debug build to see details
DEBUG: performing operation: (disabled) use debug build to see details
DEBUG: performing operation: (disabled) use debug build to see details
DEBUG: calling snapd tool snap-update-ns
DEBUG: waiting for snapd tool snap-update-ns to terminate
DEBUG: requesting changing of apparmor profile on next exec to snap-update-
common.go:59: DEBUG: locking mount namespace of snap "test-post-
common.go:80: DEBUG: freezing processes of snap "test-post-
debug.go:34: DEBUG: desired mount profile: (none)
debug.go:34: DEBUG: current mount profile (before applying changes): (none)
change.go:501: DEBUG: desiredIDs: map[]
change.go:502: DEBUG: reuse: map[]
debug.go:45: DEBUG: mount changes needed: (none)
update.go:75: DEBUG: performing mount changes:
debug.go:34: DEBUG: current mount profile (after applying changes): (none)
common.go:88: DEBUG: unlocking mount namespace of snap "test-post-
common.go:90: DEBUG: thawing processes of snap "test-post-
DEBUG: snap-update-ns finished successfully
DEBUG: saved mount namespace meta-data to /run/snapd/
DEBUG: sending command 1 to helper process (pid: 103769)
DEBUG: waiting for response from helper
DEBUG: sanity timeout reset and disabled
DEBUG: helper process received command 1
DEBUG: capturing per-snap mount namespace
DEBUG: mount namespace of process 103755 preserved as test-post-
DEBUG: helper process waiting for command
DEBUG: sanity timeout initialized and set for 30 seconds
cannot open file /sys/fs/
DEBUG:
-----)
(also it would fail the same way even if I didn't define those variables above)
I could not find where in the snap-confine codebase we actually try to open the tasks file, which is confusing to me, but this problem persisted no matter which channel of the core snap I was on, and even if I disabled re-exec and it ran with the version of snapd from deb. I confirmed that I didn't have any hacked around files lying around in the debian package install directories by running debsums and that said all the files matched their SHA sums.I also tried manually removing that cgroup freezer with `sudo rmdir /sys/fs/
I finally rebuilt snapd from the releases/2.43 branch with `make hack install` in the cmd dir and then was able to install it and thereafter all installs worked.
I don't expect this bug to go much anywhere but figured I would report it anyways before moving on to other things.
Probably something for zyga to take a quick look at.