Why does my laptop shut down overnight?

Whenever I leave my MacBook Pro (Retina, 13-inch, Early 2015) unattended (plugged in, or not) overnight (or for long periods of time) it shuts down by itself. When I open the lid it boots up to the FileVault password screen. It seems that if the lid is up, the laptop does not shut down.

It is running the latest and greatest macOS Sierra build (10.12.3 (16D32)).

There is no kernel panic, and I cannot find anything in the logs or settings that would cause this behavior. I tried searching and did a SMC reset.

EDIT

log show --style syslog --predicate 'eventMessage contains "shutdown cause"'
Skipping info and debug messages, pass --info and/or --debug to include.
Filtering the log data using "eventMessage CONTAINS "shutdown cause""
Timestamp                       (process)[PID]
2017-02-08 09:54:22.064782-0800  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 3
2017-02-08 20:07:46.801647-0800  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2017-02-10 07:52:07.041401-0800  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 0
2017-02-10 19:10:11.005920-0800  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 0
2017-02-11 10:17:08.462940-0800  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 5
2017-02-12 10:22:55.834601-0800  localhost kernel[0]: (AppleSMC) Previous shutdown cause: 0

EDIT 2 It turned out that the batteries on the laptop were failing. We sent the laptop to Apple for fixing under Apple Care.


Your "Shutdown Cause" has three separate values: 0, 3, and 5.

  • "5" is a clean shutdown
  • "3" is a dirty shutdown meaning the power button was held for 3 seconds or more
  • "0" means power loss

(contrary to what you'd think the values "should be", I know...)

There's an answer here on Ask Different that addresses the shutdown causes: Are OS X shutdown cause and sleep cause numbers listed/explained anywhere?

A power failure on a "desktop" Mac (iMac, Mac mini, Mac Pro) is easily explained. However, since you have a laptop (MacBook Pro), it's very concerning because if your electric current is cut, your battery will kick in and if that battery gets too low, it will save a hibernation image.

The 0 is as if you had no battery and pulled the plug - the system just cut out. I would take it in and have a look at it. This is definitely not normal behavior.


I'd give a look at Power Saver panel in System Preferences. It is possible that when unattended, your MacBook doesn't suspend as you expect or wake up for some reason. Or that your battery isn't working as it should.

Look at these options:

  1. Look at battery info on the last line of the panel: if your battery is damaged, it should tell you to replace it.
  2. Look at Turn display off after option. Try to set it to a short amount of time for both Battery and Power Adapter, and look what happens when you leave your computer for a while. Does it suspend and wake on your input as you expect?
  3. Try to disable Power Nap and wait for a night or two. Does you Mac wake as you expect the next morning? Power Napallows the Mac to automatically wake up periodically, to do several tasks. It's possible that Power Napwakes up your Mac for too much time or too often during the night, using all your battery power.
  4. Click on Schedule button on the bottom left of the window, and uncheck any checkbox. Maybe there's a shutdown scheduled for night time.
  5. Try to uncheck the Wake for network access option, and wait for a night or two. Maybe some other device on the network wakes your Mac during the night.

It's also possible that one or more preference files that store one these options got damaged, causing some kind of strange behaviour. Just deactivating and reactivating them could be enough to fix them, and restore normal behaviour.