Component: Nextcloud Desktop (Flatpak)
Version: 33.0.0daily (Flatpak)
OS: blendOS (Arch Linux), GNOME/Wayland
Description
After a logout/login cycle (not a reboot), the Nextcloud Desktop Flatpak client fails to start. The app immediately exits with status 255, logging "Already running, exiting...".
The cause is a stale lock file at:
~/.var/app/com.nextcloud.desktopclient.nextcloud/cache/tmp/kdsingleapp-dad-nextcloud.lock
KDSingleApplication creates this lock to enforce single-instance behavior, but it is not cleaned up when the session ends via logout. On the next login, the new instance finds the lock file, assumes another instance is running, and exits.
Steps to reproduce
- Launch Nextcloud Desktop (Flatpak) — it runs normally
- Log out of the GNOME session
- Log back in
- Nextcloud Desktop fails to start (autostart or manual launch)
Journal output
nextcloud.gui.application: Already running, exiting...
dbus-:1.2-com.nextcloudgmbh.Nextcloud@0.service: Main process exited, code=exited, status=255/EXCEPTION
Workaround
rm ~/.var/app/com.nextcloud.desktopclient.nextcloud/cache/tmp/kdsingleapp-dad-nextcloud.lock
Expected behavior
KDSingleApplication should detect stale locks — for example by using flock() (which auto-releases when the process dies) or by recording the PID in the lock file and checking if it's still alive. Alternatively, Nextcloud could register a cleanup handler for SIGTERM/session-end signals.
Additional context
This likely happens because the Flatpak sandbox receives SIGKILL during logout before the app has time to clean up, or because SIGTERM isn't properly forwarded through the Flatpak/systemd scope. The issue does not occur after a full reboot (since /run/user/ or $XDG_CACHE_HOME/tmp gets wiped).
A secondary issue is that config migration from data/Nextcloud to config/Nextcloud also fails repeatedly for sync log files that exist in both locations, producing log noise on every launch.
File against
Component: Nextcloud Desktop (Flatpak)
Version: 33.0.0daily (Flatpak)
OS: blendOS (Arch Linux), GNOME/Wayland
Description
After a logout/login cycle (not a reboot), the Nextcloud Desktop Flatpak client fails to start. The app immediately exits with status 255, logging
"Already running, exiting...".The cause is a stale lock file at:
KDSingleApplication creates this lock to enforce single-instance behavior, but it is not cleaned up when the session ends via logout. On the next login, the new instance finds the lock file, assumes another instance is running, and exits.
Steps to reproduce
Journal output
Workaround
rm ~/.var/app/com.nextcloud.desktopclient.nextcloud/cache/tmp/kdsingleapp-dad-nextcloud.lockExpected behavior
KDSingleApplication should detect stale locks — for example by using
flock()(which auto-releases when the process dies) or by recording the PID in the lock file and checking if it's still alive. Alternatively, Nextcloud could register a cleanup handler forSIGTERM/session-end signals.Additional context
This likely happens because the Flatpak sandbox receives
SIGKILLduring logout before the app has time to clean up, or becauseSIGTERMisn't properly forwarded through the Flatpak/systemd scope. The issue does not occur after a full reboot (since/run/user/or$XDG_CACHE_HOME/tmpgets wiped).A secondary issue is that config migration from
data/Nextcloudtoconfig/Nextcloudalso fails repeatedly for sync log files that exist in both locations, producing log noise on every launch.File against