I have run into this issue a couple of days ago and it keeps happening. MacBookPro in question is a 13" 2016 model with Touch Bar running macOS Mojave 10.14.1 (18B75).
If I lock my MacBook with Login window and leave it for some time (it looks like it has to be more than 1 hour but I am not certain) then it shuts down. It doesn't wake up and I have to either reconnect power cable or press power button to turn it on. MacBook is constantly connected to power supply. Energy Saver parameters (for Power Adapter) set do not allow MacBook to sleep:
- Prevent computer from sleeping… – checked
- Turn display off after – Never
I have checked logs and unfortunately I cannot make anything certain out of them. What looks suspicious is this:
Dec 5 09:47:43 mac com.apple.xpc.launchd[1] (com.apple.powerd.swd): Service only ran for 0 seconds. Pushing respawn out by 30 seconds.
Dec 5 09:48:13 mac com.apple.xpc.launchd[1] (com.apple.powerd.swd): Service only ran for 0 seconds. Pushing respawn out by 30 seconds.
Dec 5 09:48:43 mac com.apple.xpc.launchd[1] (com.apple.powerd.swd): Service only ran for 0 seconds. Pushing respawn out by 30 seconds.
Dec 5 09:49:14 mac com.apple.xpc.launchd[1] (com.apple.powerd.swd): Service only ran for 1 seconds. Pushing respawn out by 29 seconds.
Dec 5 09:49:45 mac com.apple.xpc.launchd[1] (com.apple.powerd.swd): Service only ran for 2 seconds. Pushing respawn out by 28 seconds.
Dec 5 09:50:14 mac com.apple.xpc.launchd[1] (com.apple.powerd.swd): Service only ran for 0 seconds. Pushing respawn out by 30 seconds.
Dec 5 09:50:45 mac com.apple.xpc.launchd[1] (com.apple.powerd.swd): Service only ran for 0 seconds. Pushing respawn out by 30 seconds.
Which usually occurs around the time the MacBook "starts sleeping" that leads to shutdown (but also scattered in smaller quantities in logs.)
I have already tried resetting the SMC but to no avail.
Does anyone have any ideas?
Best Answer
I would probably start with testing to see if this behaviour is replicated when booted into Safe Mode and if the issue persists then running Apple Diagnostics.
Boot into Safe Mode
Follow these steps to boot your Mac into Safe Mode:
If the problem doesn't occur while booted into Safe Mode, let me know and we'll go from there.
If the problem persists, proceed with running Apple Diagnostics.
Run Apple Diagnostics
Follow the steps below to run Apple Diagnostics:
Note: If pressing and holding the D key at Step 3 doesn't work, start again at Step 1 and, at Step 3 press and hold both the OptionD keys instead. This will try and run diagnostics from the internet instead, so you will need to allow more time for it to complete.
Regardless, take a note of what happens and let me know how you went.
[UPDATE]
Since we've established the problem is not occurring when booted into Safe Mode then it's time to investigate login items, fonts, and kernel extensions.
Investigating login items, fonts, and kernel extensions
Let's start with Login Items:
Now your Mac will boot up without those login items loading. Test to see if you can use your Mac without it going to sleep, etc:
Fonts:- You can remove any of the fonts you've installed yourself to see if this makes a difference. For more info, read the following Apple resources:
Kernel Extensions:- You can open Terminal (found within your Utilites folder) and enter the following command:
kextstat | grep -v com.apple
The above command will list 3rd party kernel extensions (you may need to stretch the Terminal window so it's easier to read). Look for anything you don't remember installing, or something that belongs to software you've removed, or just anything that looks out of place. Remember though, this is a list of 3rd party kernel extensions and therefore any of them could be causing the problem.