Sleep on KDE fails sometimes

I have a strange problem. I recently acquired a refurbished ThinkPad, and decided to install KDE (normally I use XFCE). Normally sleep works, both when I close the lid, or trigger it manually from the menu. However sometimes it seems to sleep, e.g. the ThinkPad red dot goes from steady to blinking slowly, but when I try to open the laptop again after sometime I see it’s turned off! It’s not after a long duration, typically it’s just my commute + grocery shopping, so 1-2 hrs. This laptop also does not have any battery problems, some days I have used it almost the entire day unplugged.

The only thing that I can tell that’s different between the times when it succeeds and fails is, if I can hear the fan going hard when going to sleep, it is very likely to not wake up. I have tried to look through the logs after booting again, and I couldn’t spot anything obvious. Before putting to sleep I tend to stop any heavy tasks, but I do have Firefox and some other apps open, like the terminal or file explorer. Any idea how I can debug this?

I’d start with a look at the journalctl to see what is going on when it stops. It’s rather tedious but it could yield a clue.

No help. It happened again this evening.

$ sudo journalctl --no-hostname -b -1
...
Jul 22 17:27:09 systemd[1]: Reached target sleep.target - Sleep.
Jul 22 17:27:09 systemd[1]: Starting systemd-suspend.service - System Suspend...
Jul 22 17:27:09 systemd[1]: user@1000.service: Unit now frozen-by-parent.
Jul 22 17:27:09 systemd[1]: session-2.scope: Unit now frozen-by-parent.
Jul 22 17:27:09 systemd[1]: user-1000.slice: Unit now frozen-by-parent.
Jul 22 17:27:09 systemd[1]: user.slice: Unit now frozen.
Jul 22 17:27:09 systemd-sleep[256186]: Successfully froze unit 'user.slice'.
Jul 22 17:27:09 systemd-sleep[256186]: Performing sleep operation 'suspend'...
Jul 22 17:27:09 kernel: PM: suspend entry (deep)

That’s where it ends :person_shrugging: