突然,snap 软件包无法在我的系统中运行,并出现以下错误:
/user.slice/user-1000.slice/session-1.scope 不是 snap cgroup
操作系统:Debian 11
内核:5.10.0-12-amd64
$ SNAPD_DEBUG=1 snap run slack
2022/03/23 18:48:37.614818 tool_linux.go:204: DEBUG: restarting into "/snap/snapd/current/usr/bin/snap"
2022/03/23 18:48:37.625495 cmd_run.go:1026: DEBUG: executing snap-confine from /snap/snapd/15177/usr/lib/snapd/snap-confine
2022/03/23 18:48:37.625874 cmd_run.go:433: DEBUG: SELinux not enabled
2022/03/23 18:48:37.626049 tracking.go:46: DEBUG: creating transient scope snap.slack.slack
2022/03/23 18:48:37.626597 tracking.go:186: DEBUG: using session bus
2022/03/23 18:48:37.627860 tracking.go:294: DEBUG: StartTransientUnit failed with "org.freedesktop.DBus.Error.Spawn.ChildExited": [Process org.freedesktop.systemd1 exited with status 1]
2022/03/23 18:48:37.627986 cmd_run.go:1198: DEBUG: snapd cannot track the started application
2022/03/23 18:48:37.627996 cmd_run.go:1199: DEBUG: snap refreshes will not be postponed by this process
DEBUG: umask reset, old umask was 022
DEBUG: security tag: snap.slack.slack
DEBUG: executable: /usr/lib/snapd/snap-exec
DEBUG: confinement: non-classic
DEBUG: base snap: core18
DEBUG: ruid: 1000, euid: 0, suid: 0
DEBUG: rgid: 1000, egid: 1000, sgid: 1000
DEBUG: apparmor label on snap-confine is: /snap/snapd/15177/usr/lib/snapd/snap-confine
DEBUG: apparmor mode is: enforce
DEBUG: creating lock directory /run/snapd/lock (if missing)
DEBUG: set_effective_identity uid:0 (change: no), gid:0 (change: yes)
DEBUG: opening lock directory /run/snapd/lock
DEBUG: set_effective_identity uid:0 (change: no), gid:1000 (change: yes)
DEBUG: opening lock file: /run/snapd/lock/.lock
DEBUG: set_effective_identity uid:0 (change: no), gid:0 (change: yes)
DEBUG: set_effective_identity uid:0 (change: no), gid:1000 (change: yes)
DEBUG: sanity timeout initialized and set for 30 seconds
DEBUG: acquiring exclusive lock (scope (global), uid 0)
DEBUG: sanity timeout reset and disabled
DEBUG: ensuring that snap mount directory is shared
DEBUG: unsharing snap namespace directory
DEBUG: set_effective_identity uid:0 (change: no), gid:0 (change: yes)
DEBUG: set_effective_identity uid:0 (change: no), gid:1000 (change: yes)
DEBUG: releasing lock 5
DEBUG: opened snap-update-ns executable as file descriptor 5
DEBUG: opened snap-discard-ns executable as file descriptor 6
DEBUG: creating lock directory /run/snapd/lock (if missing)
DEBUG: set_effective_identity uid:0 (change: no), gid:0 (change: yes)
DEBUG: opening lock directory /run/snapd/lock
DEBUG: set_effective_identity uid:0 (change: no), gid:1000 (change: yes)
DEBUG: opening lock file: /run/snapd/lock/slack.lock
DEBUG: set_effective_identity uid:0 (change: no), gid:0 (change: yes)
DEBUG: set_effective_identity uid:0 (change: no), gid:1000 (change: yes)
DEBUG: sanity timeout initialized and set for 30 seconds
DEBUG: acquiring exclusive lock (scope slack, uid 0)
DEBUG: sanity timeout reset and disabled
DEBUG: initializing mount namespace: slack
DEBUG: setting up device cgroup
DEBUG: libudev has current tags support
DEBUG: device /sys/devices/pci0000:00/0000:00:02.0/drm/card0 has matching current tag
DEBUG: set_effective_identity uid:0 (change: no), gid:0 (change: yes)
DEBUG: get bpf object at path /sys/fs/bpf/snap/snap_slack_slack
DEBUG: set_effective_identity uid:0 (change: no), gid:1000 (change: yes)
DEBUG: found existing device map
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: get next key for map 8
DEBUG: found 20 existing entries in devices map
DEBUG: delete key for c 143:-1
DEBUG: delete elem in map 8
DEBUG: delete key for c 1:8
DEBUG: delete elem in map 8
DEBUG: delete key for c 10:239
DEBUG: delete elem in map 8
DEBUG: delete key for c 1:7
DEBUG: delete elem in map 8
DEBUG: delete key for c 138:-1
DEBUG: delete elem in map 8
DEBUG: delete key for c 142:-1
DEBUG: delete elem in map 8
DEBUG: delete key for c 137:-1
DEBUG: delete elem in map 8
DEBUG: delete key for c 141:-1
DEBUG: delete elem in map 8
DEBUG: delete key for c 5:0
DEBUG: delete elem in map 8
DEBUG: delete key for c 226:0
DEBUG: delete elem in map 8
DEBUG: delete key for c 140:-1
DEBUG: delete elem in map 8
DEBUG: delete key for c 1:9
DEBUG: delete elem in map 8
DEBUG: delete key for c 139:-1
DEBUG: delete elem in map 8
DEBUG: delete key for c 5:2
DEBUG: delete elem in map 8
DEBUG: delete key for c 1:5
DEBUG: delete elem in map 8
DEBUG: delete key for c 1:3
DEBUG: delete elem in map 8
DEBUG: delete key for c 226:128
DEBUG: delete elem in map 8
DEBUG: delete key for c 136:-1
DEBUG: delete elem in map 8
DEBUG: delete key for c 5:1
DEBUG: delete elem in map 8
DEBUG: delete key for c 10:200
DEBUG: delete elem in map 8
DEBUG: set_effective_identity uid:0 (change: no), gid:0 (change: yes)
DEBUG: load program of type 0xf, 33 instructions
DEBUG: set_effective_identity uid:0 (change: no), gid:1000 (change: yes)
DEBUG: v2 allow c 1:3
DEBUG: v2 allow c 1:5
DEBUG: v2 allow c 1:7
DEBUG: v2 allow c 1:8
DEBUG: v2 allow c 1:9
DEBUG: v2 allow c 5:0
DEBUG: v2 allow c 5:1
DEBUG: v2 allow c 5:2
DEBUG: v2 allow c 136:4294967295
DEBUG: v2 allow c 137:4294967295
DEBUG: v2 allow c 138:4294967295
DEBUG: v2 allow c 139:4294967295
DEBUG: v2 allow c 140:4294967295
DEBUG: v2 allow c 141:4294967295
DEBUG: v2 allow c 142:4294967295
DEBUG: v2 allow c 143:4294967295
DEBUG: v2 allow c 10:239
DEBUG: v2 allow c 10:200
DEBUG: inspecting type of device: /dev/dri/card0
DEBUG: v2 allow c 226:0
DEBUG: device /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-1 has matching current tag
DEBUG: cannot get major/minor numbers for syspath /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-1
DEBUG: device /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-1 has matching current tag
DEBUG: cannot get major/minor numbers for syspath /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-1
DEBUG: device /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-2 has matching current tag
DEBUG: cannot get major/minor numbers for syspath /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-2
DEBUG: device /sys/devices/pci0000:00/0000:00:02.0/drm/renderD128 has matching current tag
DEBUG: inspecting type of device: /dev/dri/renderD128
DEBUG: v2 allow c 226:128
DEBUG: process in cgroup /user.slice/user-1000.slice/session-1.scope
/user.slice/user-1000.slice/session-1.scope is not a snap cgroup
从 snapd 日志来看,我认为根本问题是:
2022/03/23 18:48:37.627860tracking.go:294:DEBUG:StartTransientUnit失败,“org.freedesktop.DBus.Error.Spawn.ChildExited”:[进程org.freedesktop.systemd1退出,状态1]
我可以采取哪些步骤来解决这个问题?一些附加信息:
$ snap --version
snap 2.54.4
snapd 2.54.4
series 16
debian 11
kernel 5.10.0-12-amd64
$ systemctl --version
systemd 247 (247.3-6)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified
$ sudo systemct status dbus.service
dbus.service - D-Bus System Message Bus
Loaded: loaded (/lib/systemd/system/dbus.service; static)
Active: active (running) since Wed 2022-03-23 18:17:36 MDT; 34min ago
TriggeredBy: ● dbus.socket
Docs: man:dbus-daemon(1)
Main PID: 551 (dbus-daemon)
Tasks: 1 (limit: 18764)
Memory: 2.3M
CPU: 1.785s
CGroup: /system.slice/dbus.service
└─551 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
Mar 23 18:17:36 sboban-desktop systemd[1]: Started D-Bus System Message Bus.
Mar 23 18:17:37 sboban-desktop dbus-daemon[551]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' requested by ':1.11' >
Mar 23 18:17:37 sboban-desktop dbus-daemon[551]: [system] Successfully activated service 'org.freedesktop.timedate1'
Mar 23 18:17:44 sboban-desktop dbus-daemon[551]: [system] Activating via systemd: service name='org.freedesktop.RealtimeKit1' unit='rtkit-daemon.service' requested by ':1.16' (uid=1000 pid=8>
Mar 23 18:17:44 sboban-desktop dbus-daemon[551]: [system] Successfully activated service 'org.freedesktop.RealtimeKit1'
Mar 23 18:18:10 sboban-desktop dbus-daemon[551]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' requested by ':1.11' >
Mar 23 18:18:10 sboban-desktop dbus-daemon[551]: [system] Successfully activated service 'org.freedesktop.timedate1'
Mar 23 18:18:18 sboban-desktop dbus-daemon[551]: [system] Activating via systemd: service name='org.freedesktop.UPower' unit='upower.service' requested by ':1.36' (uid=1000 pid=1192 comm="/u>
Mar 23 18:18:18 sboban-desktop dbus-daemon[551]: [system] Successfully activated service 'org.freedesktop.UPower'
$ systemctl --user dbus.service
dbus.service - D-Bus User Message Bus
Loaded: loaded (/usr/lib/systemd/user/dbus.service; static)
Active: active (running) since Wed 2022-03-23 18:17:44 MDT; 36min ago
TriggeredBy: ● dbus.socket
Docs: man:dbus-daemon(1)
Main PID: 877 (dbus-daemon)
Tasks: 1 (limit: 18764)
Memory: 1.1M
CPU: 5ms
CGroup: /user.slice/user-1000.slice/[email protected]/app.slice/dbus.service
└─877 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
Mar 23 18:17:44 sboban-desktop systemd[846]: Started D-Bus User Message Bus.
$ sudo systemctl status user@$(id -u)
[email protected] - User Manager for UID 1000
Loaded: loaded (/lib/systemd/system/[email protected]; static)
Active: active (running) since Wed 2022-03-23 18:17:44 MDT; 37min ago
Docs: man:[email protected](5)
Main PID: 846 (systemd)
Status: "Startup finished in 774ms."
Tasks: 9
Memory: 41.1M
CPU: 484ms
CGroup: /user.slice/user-1000.slice/[email protected]
├─app.slice
│ ├─dbus.service
│ │ └─877 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
│ ├─pipewire.service
│ │ ├─866 /usr/bin/pipewire
│ │ └─878 /usr/bin/pipewire-media-session
│ └─pulseaudio.service
│ └─867 /usr/bin/pulseaudio --daemonize=no --log-target=journal
└─init.scope
├─846 /lib/systemd/systemd --user
└─847 (sd-pam)
Mar 23 18:17:44 sboban-desktop systemd[846]: Reached target Sockets.
Mar 23 18:17:44 sboban-desktop systemd[846]: Reached target Basic System.
Mar 23 18:17:44 sboban-desktop systemd[1]: Started User Manager for UID 1000.
Mar 23 18:17:44 sboban-desktop systemd[846]: Started Multimedia Service.
Mar 23 18:17:44 sboban-desktop systemd[846]: Starting Sound Service...
Mar 23 18:17:44 sboban-desktop systemd[846]: Started D-Bus User Message Bus.
Mar 23 18:17:44 sboban-desktop pipewire[866]: Failed to receive portal pid: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get PID of name 'org.freedesktop.portal.Desktop': no such name
Mar 23 18:17:45 sboban-desktop systemd[846]: Started Sound Service.
Mar 23 18:17:45 sboban-desktop systemd[846]: Reached target Main User Target.
Mar 23 18:17:45 sboban-desktop systemd[846]: Startup finished in 774ms.
如果您需要更多信息,请告诉我。任何形式的帮助将不胜感激。谢谢。
答案1
对我来说,解决方案是将环境变量“更正”DBUS_SESSION_BUS_ADDRESS
为:
export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
答案2
构建并安装更新的内核解决了这个问题。就我而言,它来自v5.18-rc1-390-gf45ba67eb74a
分支机构net-next
。其他较新的内核可能也可以工作。