iMac Randomly going into Safe Sleep macOS 10.14.5 (Mojave)
On or about the release of 10.14.5, my Late 2015 27" iMac began go into safe sleep (so I thought, more later) randomly. I had Amphetamine installed since March 2018 upon the purchase of the machine and even Amphetamine would not prevent the iMac from sleeping. I uninstalled the App and reinstalled, with no resolution. I then turned to Caffeine for Mac and same issue despite letting the monitor remain on.
In March of 2019 I purchased two 8GB sticks of RAM from OWC, so I thought it was possibly the issue. Called Apple Support and during that call I learned how to run a diagnostic of the hardware, which is simply holding the D key after rebooting your machine with no other external devices attached. The test noted no issues with any of the hardware.
I then completed the usual PRAM, SMC, and Safe Mode. I ran the Combo updater and then completed a reinstalled from the recovery partition. None of these items worked to resolved my issue.
I should mention the System References > Energy Saver options changed sometime in macOS 10.14 option of when disks fall asleep from a time interval to simply checking a box "Prevent computer from sleeping automatically when the display is off". The option is still available from what I can tell on the MacBook and Mac mini line ups. This is what led me down my path of thinking, maybe Apple did something to sleep setting for iMac.
I went into the terminal and tried to discover what hibernation the iMac was in. I learned using the terminal command "pmset -g | grep hibernatemode" that the iMac was in Mode 0, which is correct for Desktop Macs. I ran a few more terminal commands to move the sleep setting out for a full week. Download a number of apps to keep my drives from not sleeping and so forth. Nothing solved my problem.
I then set up a user account, which should have been my first step, but it did nothing to resolve my issue. At that point I created a clone, then completed a nuke and pave of the machine. After 9 days no random reboots. I loaded programs on one-by-one. Then this past Thursday July 11, I didn't get an email from CCC noting my backup was completed.
The night prior I installed Handbrake and VLC. I uninstalled both. Then that afternoon I came home for my lunch break and my daughter was talking about her unusual Summer break sleep habits and noted a reason for not getting proper sleep was hearing my iMac start up chime in the middle of the night/morning. It was at this point the light bulb went off.
After thinking it was a sleeping issue it was actually, my computer was restarting and because I have file vault on it went the log in page and after not being signed in the iMac went into hibernation until I hit the power button to turn it back on.
I checked the Energy Settings to see if I had a setting turned on to restart the iMac at a certain time and I did not. I then determined it had to be a power issue or more likely fluctuations in power.
I have a two and a half year old home. After about year one I had all but three of nine GFIC outlets replaced. I completed warranty work on my home and the outlets were on my punch list. The electrician noted the GFIC outlets installed in the house were from a group he noted were at a "discount". Turns out he had replaced all of those outlets since as they were all faulty causing power issues in every situation.
I have an APC UPS attached to the iMac and three powered USB Drives. I took that device to my local Batteries + store and they determined the Battery was good, but when energy is taken from the APC the Battery could not maintain enough amps to keep the power sufficient to maintain the power.
To sum up my conclusion, I have a bad outlet. I pulled it and replaced with a commercial grade 15-Amp Decorator Commercial Outlet https://www.lowes.com/pd/White-15-Amp-Decorator-Commercial-Outlet/1000050839. It may be an overkill, but when you count on the iMac for running your Media and completing certain tasks, having it reboot randomly is not the best situation.
Right now I am running the iMac directly to the new outlet along with one of my Powered USB drives, which holds my media. Hopefully this has resolved my issue. If of course anyone has another theory, I am all ears. Thanks.
Thanks for the detailed description of the diagnostics you went through.
If the mains power supply is indeed the underlying problem and you need the iMac to always be running you might want to invest in a UPS which will smooth out any power dips or interruptions.
I know that parsing logs is often an exercise in frustration because there is so much that is not of any interest, but now you know that the Mac is shutting down in the middle of the night you should be able to find that point in the logs and generally upon startup the logs have a line or two reporting the reason for the previous shutdown. This may, or may not, help isolate the real problem further.
If this is a power issue, I have seen situations where a power company may do "Brown Outs" (lower voltage) in areas to conserve power, or do various middle of the night line switching (switching a power generation plant in or out of the network).
I've even had a guy discover that they had an electrical outlet problem that they discovered after they installed a UPS, because the UPS would issue an alarm that he could hear when away from his computer, and eventually figured out it was the outlet that was causing his network and computer interruptions.
Thanks for the feedback. I was torn on the need to buy another UPS. After some research and thought I decided to go with a TRIPP Lite surge protector.
Given the amount of surge I believe I was experiencing I didn't want to put the UPS through that again. Also having isolated the plug with a new surge outlet I think I have resolved a ton of my issues. Here in Idaho the Power is fairly consistent. Just this weekend we had quite a few thunderstorms roll through and nothing flickered once. With that said I still may end up getting a UPS down the road.
I did check the logs. Yes they are quite large and despite my looking, nothing stood out from the logs. So far over the past 3 days nothing has caused the iMac to restart. Keeping my fingers crossed.
Thanks for the feedback, not that I would want anyone to go through this, but knowing I am not the only one to have electrical issues with gear makes me a bit more relieved.
Right now I am working under the assumption the outlet was bad. Given the home is only two years old, electrical has been an issue as I noted above in my post. Replacing 9 GFCI outlets and now a regular outlet. After the GFCI outlets were fixed my nest for Modem, Router, Switch and Drobo have been running fine. I did notice that in all the bedrooms there is one surge outlet, but the office did not have one.
The other thing I noticed on the old outlet was the wires were lose in the install. When the electrician that installed the outlets tells me he purchased cheap GFCI outlets, I have a tendency to believe that corners were cut.
Hopefully, I am on the right path of resolution. 🙂
I had an outlet fail because the wire slipped out of the push connector. Many outlets these days have the quick install push connector. While this took a lot of years, I was the house's first owner, so it had to be the original electrical installation.
When I'm replacing outlets or wall switches, I try very hard to always use the screw terminals with as close to a full wrap around the terminal I can get.