SUMMARY With plasma-workspace upgraded from 6.0.5 to 6.0.5.1, plasma X11 session is not restored after logout/login regardless of "Desktop Session" options (last logout or manual saved) in System Setting. STEPS TO REPRODUCE 1. Upgrade plasma -workspace to 6.0.5.1, 2. Set "Desktop Session" option to "last logout" or "manual saved" in System Setting 3. Logout and login OBSERVED RESULT New session starts as empty one. There are several messages "Qt: Session management error: None of the authentication protocols specified are supported" in journalctl and no other errors. EXPECTED RESULT The previous session saved at last logout or manually is restored SOFTWARE/OS VERSIONS Linux/KDE Plasma: Arch Linux KDE Plasma Version: 6.0.5 KDE Frameworks Version: 5.2 Qt Version: 6.7.1
The bug is presumably caused by recent changes in plasma-workspace made in 6.0.5.1, namely, in ksmserver (server.cpp and server.h). plasma-workspace 6.0.5 is free of this bug
I also have this bug. Interestingly, applications are still opened correctly (preserving their previous state) when resuming an activity.
(In reply to Kishore Gopalakrishnan from comment #2) > ... Interestingly, applications are still opened correctly > (preserving their previous state) when resuming an activity. Scratch that. Activity supension/resumption also doesn't work for me. When I suspend an activity, I can see using htop that those applications are still running (and thus, they still appear if I resume the same activity without rebooting). However, attempting to resume the activity after rebooting, one is indeed presented with just an empty activity.
Installing the xorg-iceauth package does not help for me.
After enabling 'full debug' output for ksmserver and rebooting, I get the following messages in `journalctl -b -0 --user` (I have only reproduced a segment that seems relevant) ``` Jun 02 14:59:53 kishorearchtestingVM systemd[499]: Started KDE Daemon 6. Jun 02 14:59:53 kishorearchtestingVM ksmserver[588]: org.kde.kf6.ksmserver: "/run/user/1000/KSMserver" Jun 02 14:59:53 kishorearchtestingVM systemd[499]: Starting KDE Configuration Module Initialization (Phase 1)... Jun 02 14:59:53 kishorearchtestingVM ksmserver[588]: Failed to write ice auth file entry Jun 02 14:59:53 kishorearchtestingVM ksmserver[588]: Failed to write xsmp ice auth file entry Jun 02 14:59:53 kishorearchtestingVM ksmserver[588]: Failed to write ice auth file entry Jun 02 14:59:53 kishorearchtestingVM ksmserver[588]: Failed to write xsmp ice auth file entry Jun 02 14:59:53 kishorearchtestingVM ksmserver[588]: org.kde.kf6.ksmserver: KSMServer::restoreSession "saved at previous logout" Jun 02 14:59:53 kishorearchtestingVM systemd[499]: Started KDE Session Management Server. Jun 02 14:59:53 kishorearchtestingVM systemd[499]: Starting KDE Plasma Workspace... Jun 02 14:59:53 kishorearchtestingVM kcminit_startup[550]: Initializing "/usr/lib/qt6/plugins/plasma/kcms/systemsettings/kcm_touchpad.so" Jun 02 14:59:53 kishorearchtestingVM kcminit_startup[550]: kcm_touchpad: Using X11 backend Jun 02 14:59:53 kishorearchtestingVM kcminit_startup[550]: Initializing "/usr/lib/qt6/plugins/plasma/kcms/systemsettings_qwidgets/kcm_kgamma.so" Jun 02 14:59:53 kishorearchtestingVM systemd[499]: Finished KDE Configuration Module Initialization (Phase 1). Jun 02 14:59:53 kishorearchtestingVM kded6[590]: org.kde.libkbolt: Failed to connect to Bolt manager DBus interface: Jun 02 14:59:53 kishorearchtestingVM kded6[590]: org.kde.bolt.kded: Couldn't connect to Bolt DBus daemon Jun 02 14:59:53 kishorearchtestingVM systemd[499]: Started KDE Window Manager. Jun 02 14:59:53 kishorearchtestingVM kded6[590]: org.kde.plasma.printmanager.kded: unable to register service to dbus Jun 02 14:59:53 kishorearchtestingVM kded6[590]: QDBusObjectPath: invalid path "/modules/plasma-session-shortcuts" Jun 02 14:59:53 kishorearchtestingVM kded6[590]: kf.dbusaddons: The kded module name "plasma-session-shortcuts" is invalid! Jun 02 14:59:53 kishorearchtestingVM systemd[499]: Starting KActivityManager Activity manager Service... Jun 02 14:59:53 kishorearchtestingVM kded6[590]: QDBusObjectPath: invalid path "/modules/kded_plasma-welcome" Jun 02 14:59:53 kishorearchtestingVM kded6[590]: kf.dbusaddons: The kded module name "kded_plasma-welcome" is invalid! Jun 02 14:59:53 kishorearchtestingVM kded6[590]: kcm_touchpad: Using X11 backend Jun 02 14:59:53 kishorearchtestingVM ksmserver[588]: org.kde.kf6.ksmserver: KSMConnection::count 1 Jun 02 14:59:53 kishorearchtestingVM ksmserver[588]: org.kde.kf6.ksmserver: ICE Connection rejected! Jun 02 14:59:53 kishorearchtestingVM plasmashell[607]: Qt: Session management error: None of the authentication protocols specified are supported ```
In ksmserver/server.cpp, I see (around line 365) ``` if (IceWriteAuthFileEntry(fp, file_entry) != 0) { qWarning("Failed to write ice auth file entry"); } ``` but the documentation for IceWriteAuthFileEntry ( https://www.x.org/releases/X11R7.7/doc/libICE/ICElib.html#IceWriteAuthFileEntry ) says "The function returns a nonzero status if the operation was successful. " I suppose this means the 'Failed to write ice auth file entry' messages in my logs in comment 5 may be misleading.
I can at least confirm that my iceauth file (/run/user/1000/iceauth_XXXXXX , where XXXXXX is some apparently random string) is empty, so perhaps ksmserver is indeed failing to write the 'magic cookie' (whatever that is) to that file.
Confirmed, this happens with the latest version of plasma-workspace 6.0.5.1, if I install the previous 6.0.5 the session restoration works again
I can confirm this, luckily I could revert to 6.0.5, heavily rely on session restore functionality. I even restored home FS to a snapshot before I logged in with broken session restore, to be sure.
(In reply to Kishore Gopalakrishnan from comment #7) > I can at least confirm that my iceauth file (/run/user/1000/iceauth_XXXXXX , > where XXXXXX is some apparently random string) is empty, so perhaps > ksmserver is indeed failing to write the 'magic cookie' (whatever that is) > to that file. I don't even have this file on my system with 6.0.5 where everything works just fine. So I would not be so sure that the issue is there.
(In reply to Eduardo from comment #10) > (In reply to Kishore Gopalakrishnan from comment #7) > > I can at least confirm that my iceauth file (/run/user/1000/iceauth_XXXXXX , > > where XXXXXX is some apparently random string) is empty, so perhaps > > ksmserver is indeed failing to write the 'magic cookie' (whatever that is) > > to that file. > > I don't even have this file on my system with 6.0.5 where everything works > just fine. So I would not be so sure that the issue is there. That is the issue. With new release this file is created, written, but not flushed or closed, so it stays empty. And new env variable ICEAUTHORITY pointing to this file is set up. Flushing or closing file fixed issue for me with plasma workspace 5.27.11.1 as in https://bugs.kde.org/show_bug.cgi?id=487936#c3.
(In reply to i.Dark_Templar from comment #11) > > That is the issue. With new release this file is created, written, but not > flushed or closed, so it stays empty. And new env variable ICEAUTHORITY > pointing to this file is set up. Flushing or closing file fixed issue for me > with plasma workspace 5.27.11.1 as in > https://bugs.kde.org/show_bug.cgi?id=487936#c3. Could you explain how can one close or flush this file?
*** Bug 487936 has been marked as a duplicate of this bug. ***
(In reply to i.Dark_Templar from comment #11) > That is the issue. With new release this file is created, written, but not > flushed or closed, so it stays empty. And new env variable ICEAUTHORITY > pointing to this file is set up. Flushing or closing file fixed issue for me > with plasma workspace 5.27.11.1 as in > https://bugs.kde.org/show_bug.cgi?id=487936#c3. Good catch!
After plasma workspace 6.0.5.1 is rebuilt with the following patch applied, everything seems to be quite right: -- $ICEAUTHORITY=/run/user/1000/iceauth_XXXXX -- file iceauth_XXXXX does exist and is not empty -- plasma X11 session is saved and restored correctly. --- a/ksmserver/server.cpp<---->2024-05-31 15:48:02.000000000 +0300 +++ b/ksmserver/server.cpp<---->2024-06-04 08:47:52.966458262 +0300 @@ -397,6 +397,7 @@ IceSetPaAuthData(2, &(*authDataEntries)[i]); } . + (void)fclose(fp); return (1); }
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4405
Thanks for following up so quickly.
In addition to Comment 15: There are still the following messages in journalctl: ksmserver[983]: Failed to write ice auth file entry ksmserver[983]: Failed to write xsmp ice auth file entry ksmserver[983]: Failed to write ice auth file entry ksmserver[983]: Failed to write xsmp ice auth file entry However, iceauth command shows that all the entries are is written correctly into the /run/user/1000/iceauth_XXXXX file. Kishore Gopalakrishnan in Comment #6 notices that the function IceWriteAuthFileEntry returns a nonzero status if the operation was successful. So the condition "if (IceWriteAuthFileEntry(fp, file_entry) != 0)" in ksmserver/server.cpp (lines 367,391) should be "if (IceWriteAuthFileEntry(fp, file_entry) = 0)"
Git commit 0dcf34458d99b07a3d9054ae0c86c656e0dfa7aa by Fushan Wen, on behalf of Tomáš Trnka. Committed on 04/06/2024 at 11:39. Pushed by fusionfuture into branch 'master'. Fix writing ICEAuthority file Commit 9398f6cf8933055b31506ba155aef2fc2b3561d7 "Remove iceauth dependency" introduced two bugs: 1) "fp" is never closed, so the generated auth data stays buffered in memory for some indeterminate time and the file stays empty on disk. This completely breaks authentication and thus also session restore. 2) Checking the return value of IceWriteAuthFileEntry() is inverted (the function returns non-zero on success), so warnings are printed iff everything goes well. M +7 -2 ksmserver/server.cpp https://invent.kde.org/plasma/plasma-workspace/-/commit/0dcf34458d99b07a3d9054ae0c86c656e0dfa7aa
Git commit 0857d18dfc3fc870a7f768731fdf46dc3abc5f8f by Fushan Wen. Committed on 04/06/2024 at 12:17. Pushed by fusionfuture into branch 'Plasma/6.1'. Fix writing ICEAuthority file Commit 9398f6cf8933055b31506ba155aef2fc2b3561d7 "Remove iceauth dependency" introduced two bugs: 1) "fp" is never closed, so the generated auth data stays buffered in memory for some indeterminate time and the file stays empty on disk. This completely breaks authentication and thus also session restore. 2) Checking the return value of IceWriteAuthFileEntry() is inverted (the function returns non-zero on success), so warnings are printed iff everything goes well. (cherry picked from commit 0dcf34458d99b07a3d9054ae0c86c656e0dfa7aa) Co-authored-by: Tomáš Trnka <tomastrnka@gmx.com> M +7 -2 ksmserver/server.cpp https://invent.kde.org/plasma/plasma-workspace/-/commit/0857d18dfc3fc870a7f768731fdf46dc3abc5f8f
Git commit 1181acfe30557d6646511df8d98d82589878a570 by Fushan Wen. Committed on 04/06/2024 at 12:18. Pushed by fusionfuture into branch 'Plasma/5.27'. Fix writing ICEAuthority file Commit 9398f6cf8933055b31506ba155aef2fc2b3561d7 "Remove iceauth dependency" introduced two bugs: 1) "fp" is never closed, so the generated auth data stays buffered in memory for some indeterminate time and the file stays empty on disk. This completely breaks authentication and thus also session restore. 2) Checking the return value of IceWriteAuthFileEntry() is inverted (the function returns non-zero on success), so warnings are printed iff everything goes well. (cherry picked from commit 0dcf34458d99b07a3d9054ae0c86c656e0dfa7aa) Co-authored-by: Tomáš Trnka <tomastrnka@gmx.com> M +7 -2 ksmserver/server.cpp https://invent.kde.org/plasma/plasma-workspace/-/commit/1181acfe30557d6646511df8d98d82589878a570
I have also noticed that gtk apps that are on the desktop (I use gkrellm) multiply after logout/login or reboot. I have gkrellm on the desktop and I noticed many copies of it running. I killed them all started one and tested again and they keep multiplying. I will test to see if this patch fixes that too.
No it did not. I will open a new case
This needs to be backported to 6.0 too (and a 6.0.5.2 tarball released). Currently there is a security advisory asking users to upgrade to a broken version.
Fedora 40 included these patches in a new version. However, it seems to break the logout from KDE plasma. When I select logout (on multiple computers) I get a black screen with the mouse cursor showing only.
Git commit 918cb38c3522ffcc241ac6a22b6741e41cdd3c30 by David Edmundson, on behalf of David Edmundson. Committed on 09/06/2024 at 08:25. Pushed by davidedmundson into branch 'Plasma/6.0'. Fix writing ICEAuthority file Commit 9398f6cf8933055b31506ba155aef2fc2b3561d7 "Remove iceauth dependency" introduced two bugs: 1) "fp" is never closed, so the generated auth data stays buffered in memory for some indeterminate time and the file stays empty on disk. This completely breaks authentication and thus also session restore. 2) Checking the return value of IceWriteAuthFileEntry() is inverted (the function returns non-zero on success), so warnings are printed iff everything goes well. (cherry picked from commit 0dcf34458d99b07a3d9054ae0c86c656e0dfa7aa) Co-authored-by: Tomáš Trnka <tomastrnka@gmx.com> M +7 -2 ksmserver/server.cpp https://invent.kde.org/plasma/plasma-workspace/-/commit/918cb38c3522ffcc241ac6a22b6741e41cdd3c30
*** Bug 488308 has been marked as a duplicate of this bug. ***
*** Bug 488442 has been marked as a duplicate of this bug. ***