Bug 498332 - Logout not working due to cloudflare-warp-bin failing to quit properly at logout
Summary: Logout not working due to cloudflare-warp-bin failing to quit properly at logout
Status: VERIFIED DOWNSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: Session Management (show other bugs)
Version: 6.2.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-06 21:21 UTC by dougg0k
Modified: 2025-01-21 18:21 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dougg0k 2025-01-06 21:21:53 UTC
SUMMARY
I opened a thread at `kde.discuss` the other day in attempt to find a solution and today I found it.

https://discuss.kde.org/t/logout-are-slow-or-does-not-happen/27563/1

It seems that the tray system were impeding logout to work.

Cause was a package that spawned a tray. 
cloudflare-warp-bin

STEPS TO REPRODUCE
1. Install https://aur.archlinux.org/packages/cloudflare-warp-bin
2. Make sure tray is shown
3. Try to logout

OBSERVED RESULT
The UI stops responding, and I had to open terminal through keyboard binding to do a reboot.


EXPECTED RESULT
To work normally like any other app that has a tray.

SOFTWARE/OS VERSIONS
Operating System: CachyOS Linux
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1
Kernel Version: 6.12.8-2-cachyos (64-bit)
Graphics Platform: Wayland
Comment 1 Nate Graham 2025-01-07 17:14:56 UTC
Sounds like that app is buggy. You'll need to report this to the app's authors. Thanks!
Comment 2 Abdul Rafay Shaikh 2025-01-11 18:26:09 UTC
I have been trying to find the solution too my workaround is I uninstall cloudflare-warp before logout/reboot and reinstall it after
Comment 3 dougg0k 2025-01-11 19:23:35 UTC
It doesn't make sense, I reinstalled and somehow it worked after a second try. Too random and buggy though. Seems like a previous behavior that happened with Restart.


Why the app is buggy? the DE (or KDE), should enforce to close, regardless, in case it doesnt want to.

Main problem was with logout, that never worked. So, maybe something are missing in KDE logout, to forcefully close if needed. Who knows if KDE are considering all cases. Because the application never caused any problems in the system.


It's a simple tray that can be closed by stopping a user (non-sudo) service. It should not cause issue like this.
systemctl --user stop warp-taskbar 

Seems more like DE problem here, than app.
Comment 4 dougg0k 2025-01-11 23:25:26 UTC
That's it, pretty much the service keeps respawning the tray. If I press to logout and it hang / doesnt work. As soon as I run the command to stop the service, the logout process continue.

So, the problem are that KDE are not stopping user services to logout, restart and who knows what else. 

That's the bug.
Comment 5 Abdul Rafay Shaikh 2025-01-12 14:48:55 UTC
(In reply to dougg0k from comment #4)
> That's it, pretty much the service keeps respawning the tray. If I press to
> logout and it hang / doesnt work. As soon as I run the command to stop the
> service, the logout process continue.
> 
> So, the problem are that KDE are not stopping user services to logout,
> restart and who knows what else. 
> 
> That's the bug.

share the command please and which service did you stop? the `warp-svc`??, I also tried closing the programs running with warp and they kept re spawning. 

just to give more info I am on Endeavour OS. and I had been using gnome warp-cli for about 5 months and didnt have any problem
Comment 6 Abdul Rafay Shaikh 2025-01-12 14:50:41 UTC
(In reply to Abdul Rafay Shaikh from comment #5)
> (In reply to dougg0k from comment #4)
> > That's it, pretty much the service keeps respawning the tray. If I press to
> > logout and it hang / doesnt work. As soon as I run the command to stop the
> > service, the logout process continue.
> > 
> > So, the problem are that KDE are not stopping user services to logout,
> > restart and who knows what else. 
> > 
> > That's the bug.
> 
> share the command please and which service did you stop? the `warp-svc`??, I
> also tried closing the programs running with warp and they kept re spawning. 
> 
> just to give more info I am on Endeavour OS. and I had been using gnome
> warp-cli for about 5 months and didnt have any problem

ignore my previous comment I skipped a comment that had the relevant info I was looking for!
Comment 7 dougg0k 2025-01-12 21:19:18 UTC
A temporary automated solution to this.

Create a bash script:
touch logout.sh

Add the content:
#!/bin/bash
systemctl --user stop warp-taskbar

Make sure it's executable:
chmod +x logout.sh

Open System Settings > Autostart > Add New > Logout Script > Choose logout.sh

Done.
Comment 8 dougg0k 2025-01-12 21:23:13 UTC
Edit doesnt work here. So, if unable to use the UI.

Here is the location that the script would be.

~/.config/plasma-workspace/shutdown/logout.sh
Comment 9 Nate Graham 2025-01-13 17:22:57 UTC
If the app fails to quit properly when not explicitly stopped using systemctl, that's a bug in the app. In Plasma 6.3, we'll have a notification that tells you about such apps.

Plewase report this to the developers of cloudflare-warp-bin
Comment 10 dougg0k 2025-01-13 22:21:47 UTC
Not really.

Other apps are also causing the same issue for the same reason.

https://github.com/feschber/lan-mouse/issues/237
Comment 11 Nate Graham 2025-01-14 16:46:20 UTC
The fact that other apps have the same bug doesn't absolve those apps of the responsibility for fixing it.
Comment 12 David Edmundson 2025-01-14 16:56:14 UTC
Does it block forever or block for 90 seconds?

The fact that we're processing the timeout scripts means that from a KDE POV we haven't blocked the logout and are shutting down completely. KDE's stuff has stopped running at this point and we've closed all apps at any sort of application level and have ended the session.

We're then hitting systemd's clearup of stray processes. 

This timeout can be configured with /etc/systemd/user.conf where it has: 
#DefaultTimeoutStopSec=90s
Comment 13 dougg0k 2025-01-14 17:18:38 UTC
I didnt check, but good to know.
Comment 14 Nate Graham 2025-01-14 17:24:13 UTC
Also note that some distros override this. AFAIK Fedora sets it to 45 seconds while Neon sets it to 5 seconds.
Comment 15 dougg0k 2025-01-14 17:25:54 UTC
5 seconds seems about the right value to set.
Comment 16 Nate Graham 2025-01-14 17:28:52 UTC
Can you answer David's question? When this happens, does it block logout literally forever, or just until it hits the systemd timeout number?
Comment 17 dougg0k 2025-01-14 17:58:50 UTC
Just tested.

I didnt uncoment anything in the systemd conf file. 

But if the default were to be 90s, it didnt work. 

Just as the UI stopped working, so did the clock, but only by stopping that service, the logout process continued.
Comment 18 dougg0k 2025-01-14 18:08:14 UTC
I tried setting DefaultTimeoutStopSec to 5s to make sure. And tried to logout after a reboot. It didnt work.

Only solution at this point

echo 'systemctl --user stop warp-taskbar' | tee ~/.config/plasma-workspace/shutdown/logout.sh && chmod +x ~/.config/plasma-workspace/shutdown/logout.sh
Comment 19 Nate Graham 2025-01-14 18:35:34 UTC
> It didnt work.
What didn't work? The app failed to get terminated after the configured termination duration? Did you try waiting the full 90 seconds anyway?

Please try waiting for two full minutes to see if logout eventually happens at that point in time.
Comment 20 dougg0k 2025-01-14 18:39:38 UTC
Yes and yes.

I waited for more than 3 minutes.
Comment 21 dougg0k 2025-01-14 18:43:53 UTC
App does not get terminated, if you kill it, it will just be instantly be respawned, that's why the service need to be stopped.
Comment 22 dougg0k 2025-01-14 18:45:17 UTC
If that timeout does not stop the user services, that cleanup doesnt do a thing.
Comment 23 Nate Graham 2025-01-14 19:06:50 UTC
Yes, if the app literally restarts itself, then there's nothing even systemd can do. Which makes this *unequivocally* an app bug. It's a really user-hostile behavior for it to re-spawn itself automatically unless you know the magic incantation to disable its systemd service. Please report this to the devs of such apps and ask that they reconsider this behavior.
Comment 24 Abdul Rafay Shaikh 2025-01-21 18:21:49 UTC
I can also confirm that no matter how long you wait it does not log out. Even if you kill the program it respawns and doesnt logout `reboot` command works from terminal and the script posted by dougg0k I have been using that and it works! thanks dougg0k