Laptop randomly shuts down while sleeping

This problem started happening several weeks ago on my Thinkpad X1 Carbon 3rd gen.

When I put the laptop to sleep, it will go to sleep as expected, but some time during the sleep it will shutdown, so when I try to wake it again it needs to do a full boot. This seems to happen randomly, sometimes it’ll stay asleep for hours and wake up fine when I wake it, other times I’ll try to wake it only minutes after sleeping it only to find it has shut down.

The problem happens regardless of if I put it to sleep by closing the lid, by selecting sleep from the shutdown menu, or by typing systemctl sleep at the command line. It also doesn’t seem to make a difference whether the laptop is plugged in or not.

Any help on how to begin investigating this issue would be appreciated.

Immediately after it has happened, and assuming you’ve had to restart the system, you might see what the system log recorded.

This will present the final 25 lines of the last sessions log, then provide you with a link (eos-sendlog) you can share here, so we can review it:

journalctl -b -1 | tail -n 25 | eos-sendlog

It’d also help to have some detailed specs, because sometimes these issues are specific to certain chipsets.

inxi -Fxxc0z | eos-sendlog

Hi Bink, so I just put the laptop to sleep and immediately noticed the LED in the power button was not blinking (which means it was completely off, not sleeping) so I restarted the laptop and immediately ran the commands:

Here are the results of the journalctl command: https://0x0.st/XvHH.txt

I don’t see any errors or anything unusual but I’m no expert.

And the specs: https://0x0.st/XvHP.txt

Have you taken note of the battery state when you’re seeing this?

The behaviour you’re describing sounds very much like the battery running flat while the system is asleep (since it will still be draining battery to maintain the system state in RAM).

Obviously this is possibly moot if the laptop is plugged into the AC but worth asking, you could potentially have a failing battery on your hands which could be contributing to the problem depending on how it’s interacting with the charging mechanisms

Definitely not the battery as it happens even when plugged in, and battery holds a charge.

Actually I think I was mistaken in my original post when I said “some time during sleep it shuts down”, it looks like it shuts down (or crashes) immediately after I try to sleep it.

Nothing is really standing out as applicable in searches on the issue, and frustratingly, as you’ve noted, the log records no obvious issue.

I can see you’re running the latest / last release of BIOS for that laptop, so at least that’s ruled out.

Perhaps have a look in the BIOS at power management settings, and see what you might be able to tweak and adjust, with the different suspend states detailed in the Wiki in mind.

https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#

There may be some other pointers in that article as well.

Thanks I’ll check that out. The odd thing is that this problem appeared out of nowhere several weeks ago, the laptop was working flawlessly on endeavour for several years prior to that. I’m guessing a software update introduced a new bug.

Given it’s an older device, and it’s possible it was a recent update that introduced the bug, perhaps give the LTS kernel a go.

sudo pacman -S linux-lts linux-lts-headers

Once complete, reboot and select it from the boot menu.