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.


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.

  • 2
    Look for the shutdown codes in your syslog: log show --style syslog --contains "shutdown cause" It will give you and error code. Post that to your original question.
    – Allan
    Commented Feb 13, 2017 at 18:33
  • 1
    @Allan, The OP is tagged sierra as well it's mentioned in the OP and the log command in macOS Sierra does not contain an option named --contains, although there is a --predicate option which filters messages based on the provided predicate. Commented Feb 13, 2017 at 18:44
  • 1
    log show --style syslog --predicate 'eventMessage contains "shutdown cause"' The above worked. Posting results in the main post.
    – Zlatty
    Commented Feb 13, 2017 at 20:55
  • 1
    Woops... @user3439894 is correct. Sorry about that...I was typing that from memory when I was out out and about on a PC. Ever since Sierra moved away from syslog I found myself having to memorize a whole new set of commands....
    – Allan
    Commented Feb 14, 2017 at 21:48
  • 1
    Did you get this solved? I have the same problem. Thrice now -in the last 10 days or so- I've woken up to find that the machine -the same model as yours but running high Siera 10.13.1- restarted on its own. When I log in it Does Not prompt me to report a problem or anything like that to Apple meaning its like it was restarted cleanly and am so sure it wasn't because I just select the sleep button. For me, the command you used shows shutdown cause: 5 for all of them. Any other commands I can use to investigate the problem?
    – lukik
    Commented Dec 20, 2017 at 5:17

6 Answers 6


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 was beginning to think that this is a hardware issue rather than a software issue. This all started when I updated to Sierra. I don't remember manually shutting down the laptop in a while since this issue kind of made restarts and shudowns irrelevant due to its daily nature.
    – Zlatty
    Commented Feb 14, 2017 at 23:38
  • 1
    Installation of Sierra may be a coincidence, unfortunately, what I am seeing in the logs points to hardware. I would downgrade to El Capitan to see if the problem goes away (for the record, I went to Sierra and went back to El Cap after a couple of weeks because the problems far outweighed the gains I didn't need).
    – Allan
    Commented Feb 15, 2017 at 0:53

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.

  • Thanks on your comment. I had no changes to make as everything was already set per your recommendations. Energy saver says no issues with the battery. Turn off display is at 10 mins for each. Power nap is disabled for both. No boxes are checked for schedule. Wake for network is unchecked for both. I checked and unchecked each per your last suggestion.
    – Zlatty
    Commented Feb 13, 2017 at 20:43

I had the same issue with my MB Pro 2013 Retina 13". It is only with the new hard drive that I put in though. This is what has solved my issue. Be sure to save the settings somewhere, as if your computer SMC or PRAM resets, these settings you define will be lost and you will need to reset these in terminal again. I do believe that the hibernate mode switching from 25(default) to 0(custom) is what solved my issue, however, it very well could be in combination with standby delay and autopoweroffdelay, as I maxed those out as well. Hope this helps!

user-mbp:~ user$ pmset -g
System-wide power settings:
Currently in use:
standbydelay         1569325055
standby              1
halfdim              1
hibernatefile        /var/vm/sleepimage
powernap             0
gpuswitch            2
disksleep            10
sleep                120
autopoweroffdelay    276447231
hibernatemode        0
autopoweroff         0
ttyskeepawake        0
displaysleep         2
acwake               0
lidwake              0
user-mbp:~ user$ 

I think I met the same problem as you explained.

My new Macbook pro 16inch's problem:

  1. Close the laptop and go to sleep
  2. Next day morning, normally it should have been at the login page, but it restarted and showed "Your computer restarted because of a problem..."

How did I solve the problem?

  1. Kill all the applications before you close the Macbook
  2. See if the "restart alert" shows or not
  3. If it didn't restart, which means, now you can pretty sure, the problem is definitely connected with applications you installed
  4. Before you go to bed, open one application and check if this one caused your laptop restart or not... Keep doing this one after the other one and you will find the buggy application.

Hope it helped you.


I had the same issue after installing high sierra and found this related answer: Auto shutdown at night after High sierra upgrade

Essentially, you just need to install xcode's command line tools and you're good:

Enter the following via terminal:

xcode-select --install

Dont fix it if its not broken. OS upgrades I feel should not be done. Unless doing so offers some great advantage or performance enhancement. UPGRADE not updates. Updates within the same OS version should also be done with with the same thinking in mind but with less concern or caution. As far as SHUTDOWN issues, most are software related unless from what I have read and seen in the various complaints all over the web. Most answers I see seem to offer various ways to remedy this via the terminal or console. And other long drawn out ways to check this or remove that or change those and add this... no one seems to troubleshoot the issue as most may not know how or where to start. Everyone wants the answer and wants it now. Try this; 1. Log in as another user, or create an account similar the one your machine is using when the problem occurs. Then sit an wait.

  1. If the problem does not happen with the new account. ITS SOFTWARE related and simply dump but not delete the system prefs from the problematic user library restart and see what happens.

  2. If the problem persists then guess what.... it still may be software related but most likely its hardware related. ;- Determine what has changed if anything, unplug all added devices, check your settings and make sure to Reset the things apple suggests the way they suggest you do so regarding power management and the like.

  3. know the history of the machine if you don't find out by asking those who use that machine. Machines just don't shutdown unless the hardware over heats, a program has crashed or unexpectedly quits which would show in the log file, few will cause a complete power off.

bottom line there are just to many people with similar complaints that claim they are all having the same problem. Which they are NOT once the conversation continues with everyone and their mother piping in with answers to a problem thats not fully understood.

Id you have a problem Make sure you know exactly what your problem is which often takes a qualified technician to determine. And in the 30 plus years I have been in the IT and Computer industry. I have met very few Qualified technicians with the proper training and education in computer electronics engineering.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .