Bug 436504

Summary: Sleep/suspend is broken on KDE Neon Testing Edition and KDE Neon User Edition
Product: [KDE Neon] neon Reporter: yamiyukisenpai
Component: Packages Testing EditionAssignee: Neon Bugs <neon-bugs-null>
Status: RESOLVED MOVED    
Severity: major CC: bizyaev, guimarcalsilva, javiercorderoperez, jr, kde, kermit, kotarf, nate, neon-bugs-null, pseudo-account, sitter
Priority: NOR Keywords: regression
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Reproduction scenario

Description yamiyukisenpai 2021-05-02 22:39:18 UTC
SUMMARY
Whenever I want my computer to sleep via power button on my desktop or directly from Kickoff, the computer logs out instead

STEPS TO REPRODUCE
* Click the logout from Kickoff
* Press the power button 

OBSERVED RESULT
The screen would shut off, like it's about to sleep, but would instead log me out.

EXPECTED RESULT
PC is supposed to sleep

SOFTWARE/OS VERSIONS
Operating System: KDE neon Testing Edition
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2
Kernel Version: 5.11.0-7614-generic
OS Type: 64-bit
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-6500 CPU @ 3.20GHz
Memory: 15.6 GiB of RAM
Graphics Processor: GeForce GTX 1060 6GB/PCIe/SSE2

ADDITIONAL INFORMATION
This might be the wrong section, but I'm not sure where to report the bug.  Feel free to move it or point me to the right direction.
Comment 1 Nate Graham 2021-05-03 19:20:21 UTC
Cannot reproduce on openSUSE Tumbleweed FWIW.
Comment 2 yamiyukisenpai 2021-05-03 19:22:26 UTC
(In reply to Nate Graham from comment #1)
> Cannot reproduce on openSUSE Tumbleweed FWIW.

Which version is Tumbleweed on?

And what's FWIW?
Comment 3 Nate Graham 2021-05-03 23:31:32 UTC
(In reply to techxgames from comment #2)
> (In reply to Nate Graham from comment #1)
> > Cannot reproduce on openSUSE Tumbleweed FWIW.
> 
> Which version is Tumbleweed on?
Plasma 5.22.4, though I build everything from source so I'm using current git master.

> And what's FWIW?
Sorry. It's short for "For what it's worth". Just filler in a conversation.
Comment 4 yamiyukisenpai 2021-05-16 21:40:20 UTC
Now that I can finally make it sleep, waking up kills the network.

I would be able to see a connection available after running `systemctl restart NetworkManager`, but it'd be unable to connect.  Couldn't detect my network card.
Comment 5 David Edmundson 2021-05-19 21:11:12 UTC
>Now that I can finally make it sleep,

Sounds fixed then. 

The other issue is not KDE related if you need to restart daemons to fix it
Comment 6 yamiyukisenpai 2021-05-20 02:21:08 UTC
(In reply to David Edmundson from comment #5)
> >Now that I can finally make it sleep,
> 
> Sounds fixed then. 
> 
> The other issue is not KDE related if you need to restart daemons to fix it

Restarting daemons didn't work. The wired connection would show up, but wouldn't connect. I need to restart to fix it.
Comment 7 yamiyukisenpai 2021-06-01 07:34:17 UTC
(In reply to David Edmundson from comment #5)
> >Now that I can finally make it sleep,
> 
> Sounds fixed then. 
> 
> The other issue is not KDE related if you need to restart daemons to fix it

what could be the issue if it's not this one?
Comment 8 David Edmundson 2021-06-01 09:05:28 UTC
>what could be the issue if it's not this one?

If you can reconnect using nmcli but not the plasma applet please open a new bug on plasma-nm.

If you cannot reconnect using nmcli, please report to NetworkManager.
Comment 9 Javier O. Cordero Pérez (Cuperino) 2021-06-28 16:52:18 UTC
I'm on the current KDE neon User Edition and am also facing this bug. What Plasma version was this fixed in?

SOFTWARE/OS VERSIONS
Operating System: KDE neon User Edition
KDE Plasma Version: 5.22.2
KDE Frameworks Version: 5.83.0
Kernel: 5.8.0-59-generic
Graphics Platform: X11
Graphics Processor: Intel Iris Plus Graphics G7
Comment 10 Javier O. Cordero Pérez (Cuperino) 2021-07-31 06:09:35 UTC
Hello,

I've upgraded my system to KDE neon Testing Edition a while back and continue to face the reported bug, where any attempts to sleep result in a session log out.

Unusual behavior
When using X11 I can log in again, but when I'm logged out from a Wayland session the screen stays black after login and no panels, widgets, backgrounds or windows are loaded.

I attempted switching out SDDM to GDM and LXDM to see if this would mitigate the issue but the behavior is the same always, any sleep attempt result in a session crash or logout.

SOFTWARE/OS VERSIONS
Operating System: KDE neon User Edition
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.3
Kernel: 5.8.0-63-generic
Graphics Platform: both X11 and Wayland 
Graphics Processor: Intel Iris Plus Graphics G7
Comment 11 yamiyukisenpai 2021-08-01 17:59:50 UTC
Seems like my sleep/suspend issue is related to 5.11


https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1931301
Comment 12 Arek Guzinski 2021-08-28 12:42:05 UTC
I think this might be an issue with some lower level. Maybe systemd?

I'm on KDE neon with Plasma 5.22.4 and have this problem.

However the same (=logout) happens using 

$ systemctl suspend

while

$ echo -n mem > /sys/power/state

puts the computer to sleep like expected
Comment 13 guimarcalsilva 2021-10-19 01:56:37 UTC
Hi. I'm not sure if my issue is completely related to this one, but on Neon after suspending and come=ing back plasmashell doesn't get loaded. If I press ALT+F2 I can summon Krunner and type "plasmashell" and things go back to normal. I'm on a Wayland session and my kernel is 5.11. I'm on Plasma 5.23 too.
Comment 14 Arek Guzinski 2021-10-19 05:53:17 UTC
I Completely forgot about this bug...
It works fine for me now on 
Plasma 5.23.0
Frameworks 5.87.0
Kernel 5.11.0-37-generic
systemd 245.4-4ubuntu3

and has so for a few weeks now.
I also never had any networking issues because of this.
Comment 15 Arek Guzinski 2022-01-11 14:44:59 UTC
Upgraded the system, and now that issue is back again - great... not!

systemd is now 245.4-4ubuntu3.14

The rest:
Operating System: KDE neon 5.23
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-46-generic (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-6500 CPU @ 3.20GHz
Memory: 15,6 GiB of RAM
Graphics Processor: NV136
Comment 16 Javier O. Cordero Pérez (Cuperino) 2022-01-11 15:38:47 UTC
The suspend bug never went away for me. My laptop's battery is now at 47% health, partly because of it.

SUMMARY
Whenever I want my computer to sleep via power button or directly from Kickoff, the computer logs out instead

STEPS TO REPRODUCE
* Click a sleep button
* Close laptop lid while laptop is configure to go to sleep when its lid is closed
* Leave device on for a while long enough that it triggers sleep. 

OBSERVED RESULT
The screen would shut off, like it's about to sleep, but would instead log me out.

EXPECTED RESULT
PC is supposed to sleep

SOFTWARE/OS VERSIONS
Operating System: KDE neon Testing Edition
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.3
Kernel Version: 5.11.0-44-lowlatency (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-1065G7 CPU @ 1.30GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® Iris® Plus Graphics
Comment 17 Arek Guzinski 2022-01-11 17:22:41 UTC
Does anyone who is *not* on neon experience this bug? If so, what Distro are you on? Is it Ubuntu-based?

I still think, this is more likely an issue with systemd (or at least it's ubuntu-packages), but I can't find anything on their bugtrackers :/

Btw: here is a workaround for the Sleep-shortcut, that might work for some people. I did work for me before, but not now, because every time the system wakes up again, some fan decides to spin and not stop until I reboot :( - this did not happen the last time.

In the shell:
$ sudo -i
$ echo "echo mem > /sys/power/state" > /usr/local/sbin/sleep
$ chmod +x /usr/local/sbin/sleep
$ visudo

This will open /etc/sudoers in vim (do NOT do this manually).
Add the following line somewhere near the bottom (I put it right above the #includedir statement), replacing USER and HOSTNAME with your user name and whatever is in /etc/hostname:

USER HOSTNAME   = (root) NOPASSWD: /usr/local/sbin/sleep

close with ESC ZZ

then open systemsettings and navigate to Shortcuts -> Custom Shortcuts
Right Click on some group (or create one) and create a new shortcut (New -> Global Shortcut -> Command/URL)

Set Trigger to your prefered Sleep shortcut
Set Action to 
sudo /usr/local/sbin/sleep
Comment 18 Nate Graham 2022-09-08 16:45:18 UTC
Anyone still experiencing this with Plasma 5.25 on the latest Neon testing or unstable?
Comment 19 Javier O. Cordero Pérez (Cuperino) 2022-09-08 21:21:05 UTC
The KDE Neon Testing install where I experienced this issue no longer exists. I moved on to Fedora two weeks ago. The last time I deliberately tested sleep was in May, and the issue was still present.

I have a full `rsync -aX` backup of /home /etc /var /opt from that system, if anything there is useful to you.

The issue is not hardware specific because the laptop that originally ran that neon install broke earlier this year. I cloned its partitions to a backup desktop system and kept using it for months with the sleep issue, until new hardware arrived to replace the laptop and I decided to move the NVME from the desktop and perform a clean install.
Comment 20 guimarcalsilva 2022-09-08 22:16:51 UTC
I cannot reproduce on Neon with the latest updates as of September 8th.
Comment 21 Arek Guzinski 2022-09-10 08:09:23 UTC
I'm still getting logged out instead of putting the computer to sleep.
But at least my workaround is working..

Current setup:
Operating System: KDE neon 5.25
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5
Kernel Version: 5.15.0-46-generic (64-bit)
Graphics Platform: X11
systemd: 245.4-4ubuntu3.17
Comment 22 Bug Janitor Service 2022-09-25 04:48:29 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 23 Andrey E. 2024-02-28 17:45:14 UTC
Created attachment 166164 [details]
Reproduction scenario
Comment 24 Andrey E. 2024-02-28 17:47:07 UTC
After the update, neither the physical nor the software power buttons work.

Operating System: KDE neon 6.0
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.5.0-1015-oem (64-bit)
Graphics Platform: Wayland
Processors: 6 × AMD Ryzen 5 4500U with Radeon Graphics
Memory: 5.6 ГиБ of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: LENOVO
Product Name: 20VG
System Version: ThinkBook 15 G2 ARE
Comment 25 Ilya Bizyaev 2024-02-28 21:14:00 UTC
For those affected in 2024 (so technically a different bug), this is tracked in https://bugs.kde.org/show_bug.cgi?id=481938