Error running snaps: cannot create transient scope

A few months ago my Ubuntu 18.04 machine started periodically having problems running snaps (so far I’ve tested slack, skype, kubectl)

$ SNAPD_DEBUG=1 SNAP_CONFINE_DEBUG=1 snap run slack
2021/05/20 15:23:53.930136 tool_linux.go:204: DEBUG: restarting into "/snap/core/current/usr/bin/snap"
2021/05/20 15:23:53.956785 cmd_run.go:410: DEBUG: SELinux not enabled
2021/05/20 15:23:53.957008 tracking.go:44: DEBUG: creating transient scope snap.slack.slack
2021/05/20 15:23:53.958773 tracking.go:173: DEBUG: using session bus
2021/05/20 15:25:53.968958 tracking.go:278: DEBUG: StartTransientUnit failed with "org.freedesktop.DBus.Error.TimedOut": [Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=120000ms)]
error: cannot create transient scope: DBus error "org.freedesktop.DBus.Error.TimedOut": [Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=120000ms)]

I have not yet been able to determine what causes this issue to start happening, or why it eventually recovers. Reboot does not appear to affect it. Typically I will notice it when Slack becomes unresponsive and cannot be started again. The issue will persist for several hours at a time.

The only workaround is to run the snap as root (sudo kubectl), which is terrifying, especially in the case of slack.

$ snap version
snap    2.50
snapd   2.50
series  16
ubuntu  18.04
kernel  5.4.0-72-generic

Edit: nothing apparent in sudo journalctl -u snapd; today’s logs are just two messages showing no updates available.

The error comes from an attempt to create a separate systemd user scope for the snap application. I think the user instance of systemd or dbus may be dead or unresponsive in your system. When you see this happen, please collect the outputs of the following commands:

  • journactl --user
  • ps -ef|grep -e systemd -e dbus
  • busctl |grep systemd

Thanks - output below.

journalctl --user

May 21 10:20:03 aconway-le-RVLM dbus-daemon[3434]: [session uid=1000 pid=3434] Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=120000ms)

journalctl also shows a bunch of gdm/gnome shell mesages which seem unrelated.

ps -ef|grep -e systemd -e dbus

root         1     0  0 May07 ?        00:12:38 /lib/systemd/systemd --system --deserialize 18
root      1379     1  0 May07 ?        00:02:57 /usr/sbin/thermald --no-daemon --dbus-enable
message+  1382     1  0 May07 ?        00:04:48 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
root      1443     1  0 May07 ?        00:02:06 /lib/systemd/systemd-logind
gdm       1816     1  0 May07 ?        00:00:04 /lib/systemd/systemd --user
gdm       1905  1816  0 May07 ?        00:00:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
gdm       2220  2215  0 May07 ?        00:00:00 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
alex      3387     1  0 May07 ?        00:51:05 /lib/systemd/systemd --user
alex      3434  3387  0 May07 ?        00:02:34 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
alex      3557  3552  0 May07 ?        00:00:12 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
systemd+ 13311     1  0 May11 ?        00:01:36 /lib/systemd/systemd-resolved
systemd+ 13340     1  0 May11 ?        00:00:02 /lib/systemd/systemd-timesyncd
root     13379     1  0 May11 ?        00:01:06 /lib/systemd/systemd-journald
root     14024     1  0 May12 ?        00:00:02 /lib/systemd/systemd --user
root     14219     1  0 May11 ?        00:00:33 /lib/systemd/systemd-udevd
alex     18374 20095  0 10:20 pts/4    00:00:00 grep --color=auto -e systemd -e dbus
root     19291 14024  0 May13 ?        00:00:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only

busctl |grep systemd

:1.106                                    3387 systemd         alex             :1.106        user@1000.service         -          -                  
:1.21                                     1443 systemd-logind  root             :1.21         systemd-logind.service    -          -                  
:1.2432                                      1 systemd         root             :1.2432       init.scope                -          -                  
:1.2433                                  13311 systemd-resolve systemd-resolve  :1.2433       systemd-resolved.service  -          -                  
:1.27                                     1816 systemd         gdm              :1.27         user@121.service          -          -                  
:1.3111                                  14024 systemd         root             :1.3111       user@0.service            -          -                  
org.freedesktop.DBus                         1 systemd         root             -             init.scope                -          -                  
org.freedesktop.login1                    1443 systemd-logind  root             :1.21         systemd-logind.service    -          -                  
org.freedesktop.resolve1                 13311 systemd-resolve systemd-resolve  :1.2433       systemd-resolved.service  -          -                  
org.freedesktop.systemd1                     1 systemd         root             :1.2432       init.scope                -          -

This is supposed to work. I think you should file a bug with your distribution. This could be a problem with dbus or systemd.

1 Like