cosmic-epoch icon indicating copy to clipboard operation
cosmic-epoch copied to clipboard

Intermittent hang on shutdown

Open lostipod opened this issue 1 year ago • 5 comments

Describe the bug Intermittently, when shutting down: Stopping Session 3 of User test ... a bunch of OKs then A stop job is running for Session 3 of User test (1s / 1 min 30s) It then counts up to 90 seconds then finally shuts down.

To Reproduce Shutdown desktop, via Cosmic terminal or Cosmic desktop. Happens intermittently.

Expected behavior No hang, a bunch of OKs and shuts down in a couple of seconds.

Screenshots N/A

Desktop (please complete the following information):

  • Arch with hardened kernel
  • no other DEs installed

Additional context

  • has happened since first using Cosmic, around Alpha 3 and has continued up until now (Alpha 6)
  • Not certain, but seems to be related to Flatpak or perhaps not Flatpak generally but only the Firefox Flatpak
  • most noticed (perhaps only noticed) when the Firefox Flatpak was opened during the Cosmic session but intermittently
  • due to hardened kernel have to use bubblewrap-suid package instead of bubblewrap package for Flatpak
  • packages xdg-desktop-portal and xdg-desktop-portal-cosmic are installed

Attached Logs

  • see attached log on April 12 at 11:31 AM (and add 90 seconds of padding both before and after)
  • systemd.log_level=debug
  • used Gemini 2.5 Pro (experimental) to analyze logs but the model reported " the specific process causing the deadlock isn't explicitly named in this log. Systemd reports the timeout occurring for the overall user manager service because it couldn't get everything under its control to stop cleanly."

boot_minus_1_log.txt

lostipod avatar Apr 12 '25 19:04 lostipod

I have a similar issue on nixos. I've attached my log (journalctl -b -1) showing that both cosmic-settings and notify-rs fail to terminate properly as seen on lines 1871 and 1872. I've also added my nixos config, which is very basic.

boot_minus_1_log.txt

configuration.nix.txt

xynxynxyn avatar Jul 25 '25 21:07 xynxynxyn

I have the exact same issue (nixOS 25.05) https://discourse.nixos.org/t/timeout-on-shutdown-with-cosmic-due-to-session-3-scope/70326

Okt 03 15:12:31 desktop-nixos cosmic-session[1699]: [2025-10-03T13:12:31Z WARN  wgpu_hal::gles::egl] No config found!
Okt 03 15:12:31 desktop-nixos cosmic-session[1699]: [2025-10-03T13:12:31Z WARN  wgpu_hal::gles::egl] EGL says it can present to the window but not natively
Okt 03 15:12:31 desktop-nixos cosmic-session[1699]: [2025-10-03T13:12:31Z WARN  wgpu_hal::gles::egl] No config found!
Okt 03 15:12:31 desktop-nixos cosmic-session[1699]: [2025-10-03T13:12:31Z WARN  wgpu_hal::gles::egl] EGL says it can present to the window but not natively
Okt 03 15:12:31 desktop-nixos cosmic-session[1699]: [2025-10-03T13:12:31Z WARN  wgpu_hal::vulkan::conv] Unrecognized present mode 1000361000
Okt 03 15:12:31 desktop-nixos cosmic-session[1699]: [2025-10-03T13:12:31Z WARN  wgpu_hal::vulkan::conv] Unrecognized present mode 1000361000
Okt 03 15:12:31 desktop-nixos cosmic-session[1699]: [2025-10-03T13:12:31Z WARN  wgpu_hal::vulkan::conv] Unrecognized present mode 1000361000
Okt 03 15:12:31 desktop-nixos cosmic-session[1699]: [2025-10-03T13:12:31Z WARN  wgpu_hal::vulkan::conv] Unrecognized present mode 1000361000
Okt 03 15:12:31 desktop-nixos cosmic-session[1699]: [2025-10-03T13:12:31Z WARN  wgpu_hal::vulkan::conv] Unrecognized present mode 1000361000
Okt 03 15:12:31 desktop-nixos cosmic-session[1699]: Failed to watch theme org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.GeoClue2 was not provided by any .service files. Will try again in 0s
Okt 03 15:12:31 desktop-nixos cosmic-session[1699]: [2025-10-03T13:12:31Z WARN  wgpu_hal::vulkan::conv] Unrecognized present mode 1000361000
Okt 03 15:12:31 desktop-nixos .cosmic-panel-wrapped[1767]: com.system76.CosmicAppletStatusArea: Acquired bus name: org.kde.StatusNotifierWatcher
Okt 03 15:12:31 desktop-nixos .cosmic-panel-wrapped[1767]: com.system76.CosmicAppList: Error getting config: com.system76.CosmicAppList [GetKey("enable_drag_source", Os { code: 2, kind: NotFound, message: "No such file or directory" })]
Okt 03 15:12:32 desktop-nixos .cosmic-panel-wrapped[1767]: com.system76.CosmicAppletBattery: exited with code 0
Okt 03 15:12:32 desktop-nixos cosmic-session[1699]: Failed to watch theme org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.GeoClue2 was not provided by any .service files. Will try again in 1s
Okt 03 15:12:33 desktop-nixos cosmic-session[1699]: [2025-10-03T13:12:33Z WARN  wgpu_hal::vulkan::conv] Unrecognized present mode 1000361000
Okt 03 15:12:33 desktop-nixos cosmic-session[1699]: Failed to watch theme org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.GeoClue2 was not provided by any .service files. Will try again in 3s
Okt 03 15:12:36 desktop-nixos cosmic-session[1699]: Failed to watch theme org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.GeoClue2 was not provided by any .service files. Will try again in 6s
Okt 03 15:12:43 desktop-nixos cosmic-session[1699]: Failed to watch theme org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.GeoClue2 was not provided by any .service files. Will try again in 12s
Okt 03 15:12:56 desktop-nixos cosmic-session[1699]: Failed to watch theme org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.GeoClue2 was not provided by any .service files. Will try again in 25s
Okt 03 15:13:21 desktop-nixos cosmic-session[1699]: Failed to watch theme org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.GeoClue2 was not provided by any .service files. Will try again in 51s
Okt 03 15:14:12 desktop-nixos cosmic-session[1699]: Failed to watch theme org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.GeoClue2 was not provided by any .service files. Will try again in 102s
Okt 03 15:15:55 desktop-nixos cosmic-session[1699]: Failed to watch theme org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.GeoClue2 was not provided by any .service files. Will try again in 204s
Okt 03 15:19:20 desktop-nixos cosmic-session[1699]: Failed to watch theme org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.GeoClue2 was not provided by any .service files. Will try again in 409s
Okt 03 15:22:17 desktop-nixos cosmic-session[1699]: EXITING: received request to terminate
Okt 03 15:22:17 desktop-nixos cosmic-session[1699]: process 'ProcessKey(2v1)' cancelled
Okt 03 15:22:17 desktop-nixos systemd[1]: Stopping Session 3 of User xxxx...
Okt 03 15:23:48 desktop-nixos systemd[1]: session-3.scope: Stopping timed out. Killing.
Okt 03 15:23:48 desktop-nixos systemd[1]: session-3.scope: Killing process 1749 (cosmic-settings) with signal SIGKILL.
Okt 03 15:23:48 desktop-nixos systemd[1]: session-3.scope: Killing process 1754 (n/a) with signal SIGKILL.
Okt 03 15:23:48 desktop-nixos systemd[1]: session-3.scope: Killing process 1771 (cosmic-settings) with signal SIGKILL.
Okt 03 15:23:48 desktop-nixos systemd[1]: session-3.scope: Failed with result 'timeout'.
Okt 03 15:23:48 desktop-nixos systemd[1]: Stopped Session 3 of User xxxx.
Okt 03 15:23:48 desktop-nixos systemd[1]: session-3.scope: Consumed 1min 1.205s CPU time, 724.4M memory peak, 114.6M read from disk, 24K written to disk.

daemonfire300 avatar Oct 04 '25 16:10 daemonfire300

I have a similar issue on nixos. I've attached my log (journalctl -b -1) showing that both cosmic-settings and notify-rs fail to terminate properly as seen on lines 1871 and 1872. I've also added my nixos config, which is very basic.

boot_minus_1_log.txt

configuration.nix.txt

What I wanted to try but is a bit unprecise: Fresh install of nixOS directly with COSMIC and see if that fixes the issue and second experiment use unstable but that's very much not what I actually want to run.

But first I am going to try to run COSMIC with something like

environment.sessionVariables = {
  RUST_LOG = "cosmic_settings=trace,iced=trace";  # Target specific crates if needed
};

and see if this digs something up and also try to find out whether I can override the COSMIC packages to use nixpkgs-unstable instead.

daemonfire300 avatar Oct 04 '25 18:10 daemonfire300

Confirming this issue on NixOS

I'm experiencing the exact same issue on a different setup, which might help narrow down the cause:

System Info:

  • OS: NixOS 25.05 unstable (Warbler)
  • Kernel: 6.17.5
  • Cosmic Version: 1.0.0-alpha.7
  • GPU: AMD Renoir (Radeon Vega Series / Radeon Vega Mobile Series)

Key Differences from OP:

  • Happens almost every shutdown (not just intermittently)
  • Not using Flatpak - so this doesn't appear to be Flatpak-specific
  • Clean Cosmic-only setup, no other DEs installed

Behavior: Same 90-second timeout with "A stop job is running for Session X of User" message during shutdown.

Logs showing the hang:

nov 01 19:43:24 nixos cosmic-session[1368]: EXITING: received request to terminate
nov 01 19:43:24 nixos cosmic-session[1368]: process 'ProcessKey(2v1)' cancelled
nov 01 19:43:24 nixos systemd[1]: Stopping Session 3 of User huxx...
[90 second gap - no activity from cosmic-session]
nov 01 19:44:54 nixos systemd[1]: Stopped Session 3 of User huxx.

cosmic-session logs "EXITING" but the process doesn't actually exit until systemd kills it after the full timeout period.

Possibly Related Runtime Errors: Throughout the session, cosmic-session repeatedly logs:

  • No such file or directory (os error 2)
  • Failed to watch theme org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.GeoClue2 was not provided by any .service files

This confirms the issue affects multiple distros and isn't Flatpak-specific. Happy to provide additional logs or testing if helpful!


(Note: This comment was drafted with assistance from Claude AI)

huxxcb avatar Nov 01 '25 19:11 huxxcb

Confirming this issue on NixOS

I'm experiencing the exact same issue on a different setup, which might help narrow down the cause:

System Info:

  • OS: NixOS 25.05 unstable (Warbler)
  • Kernel: 6.17.5
  • Cosmic Version: 1.0.0-alpha.7
  • GPU: AMD Renoir (Radeon Vega Series / Radeon Vega Mobile Series)

Key Differences from OP:

  • Happens almost every shutdown (not just intermittently)
  • Not using Flatpak - so this doesn't appear to be Flatpak-specific
  • Clean Cosmic-only setup, no other DEs installed

Behavior: Same 90-second timeout with "A stop job is running for Session X of User" message during shutdown.

Logs showing the hang:

nov 01 19:43:24 nixos cosmic-session[1368]: EXITING: received request to terminate
nov 01 19:43:24 nixos cosmic-session[1368]: process 'ProcessKey(2v1)' cancelled
nov 01 19:43:24 nixos systemd[1]: Stopping Session 3 of User huxx...
[90 second gap - no activity from cosmic-session]
nov 01 19:44:54 nixos systemd[1]: Stopped Session 3 of User huxx.

cosmic-session logs "EXITING" but the process doesn't actually exit until systemd kills it after the full timeout period.

Possibly Related Runtime Errors: Throughout the session, cosmic-session repeatedly logs:

  • No such file or directory (os error 2)
  • Failed to watch theme org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.GeoClue2 was not provided by any .service files

This confirms the issue affects multiple distros and isn't Flatpak-specific. Happy to provide additional logs or testing if helpful!

(Note: This comment was drafted with assistance from Claude AI)

Try installing geoclue2 https://discourse.nixos.org/t/timeout-on-shutdown-with-cosmic-due-to-session-3-scope/70326/9?u=daemonfire

This will be fixed with 25.11 and is already fixed on unstable. I fixed it manually on my stable version.

daemonfire300 avatar Nov 01 '25 21:11 daemonfire300