Timeout on shutdown with COSMIC due to session-3.scope

Currently running 25.05 stable nixOS via a flake based config which also draws in a few unstable packages but nothing that ends up in my configuration.nix.

I switched to Cosmic a few days ago. Previously on KDE Plasma 6.

I consistently get a timeout on session-3.scope when trying to shutdown.

Below is my output (most recent) of journalctl -u session-3.scope -b -1 --no-pager.

You can see when the request to stop starts and when it starts killing it. What is unclear to me if all or any of the killed processes are actually the culprit and what’s mighty strange to me is that one of them does have n/a as name.

I am wondering if it’s the preceding missing GeoClue2 service. I am adding this now and see if it fixes things by enabling services.geoclue2.enable = true; I have read multiple accounts of people on Arch having a similar issue but with KDE. Not sure if there is some leftover artifacts from KDE when I switched. But I suppose I only have KDE Kate installed explicitly and nothing else.

Related posts maybe (but not answer: "A stop job is running for User Manager for UID XX")

Crossposted to COSMIC github, since a few other people are having this issue. Will post a reply here if something should change over there: Intermittent hang on shutdown · Issue #1797 · pop-os/cosmic-epoch · GitHub

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.

The majority of development for COSMIC happens in the nixos-unstable and backports to nixos-${stable} are rarely a thing. Could you briefly switch to the unstable channel and report back with which issues you face post switch?

My setup is flake based. Haven’t tried to switch something to be selectively unstable yet. Will try

Sorry for the late reply. I think installing geoclue2 as service fixed it. Because it suddenly is not happening anymore (at least for 3 times it just worked). But I am not 100% sure, because I did update my stable nix flake as well when I added geoclue2.

I don’t follow. Did your issue of a timeout on shutdown go away when you switched to the nixos-unstable channel?

What fixed it supposedly so far: nix flake update and add geoclue2 while still staying on nixos25.05

Ah, it looks like a backport of 415901 to nixos-${stable} would’ve fixed it.

Is that a commit hash or what’s that number?