iMac randomly shuts down We have a late 2012 27 inch iMac. It has a 2.9 GHz i5 processor and a 1 TB fusion drive along with 8 GB of RAM. I recently upgraded it to El Capitan.

A couple of months ago it randomly started to not wake up after being asleep. We would have to unplug it and plug it back in to get it back on. It also would just randomly shut off while we were using it. If we had music playing, the screen would go black and the music would stop so it's not a display issue.

I took it in to our local Apple store and talked to them about it and they said the first thing they would do would be to reinstall OS X. So I decided to do that myself but that still did not fix the issue.

I then lugged it back into the Apple store about 2 weeks ago and left it with them for a few days to get to the bottom of it. They repaired OS X and then put it through a battery of tests to see if there were any issues with memory or the hard drive but everything came back fine. They then left it plugged in with a bunch of graphics programs and videos playing and still had no issues.

At this point, I was thinking it was a power issue with the plug we were using. When I brought it home, we left it plugged in and running in our dining room for a few days and did not have any issues. I gradually loaded programs back on and still did not have any issues. I then moved it back upstairs but the other day it started acting up again on my wife. I moved it back to our dining room thinking it was the outlet up there, but it's exhibiting the same behavior there now.

After doing some searching online, I found this post http://samwize.com/2013/10/13/imac-shutdown-suddenly-and-randomly/. It seems to describe the issue we are having.

I was able to check the Console and it says the cause for shutdown is 0. I'm pretty sure the Apple store ran the hardware test and memtest while it was there. I have repeatedly reset the SMC, which the Apple store employee informed me is basically what I'm doing every time I have to unplug it and plug it back in.

The only thing I haven't done yet is a PRAM reset.

So, now I'm not sure what to do next. According to that post, his logic board needed to be replaced. The Apple store quoted me $583.32 to replace the logic board if that was what was needed. But I only want to do that if I know definitively that's the issue.

So sorry for the long post, but does anyone have a suggestion on how to  root cause this?
Chances are this is a bad power supply board.



Shutdown error codes can be negative or positive values; negative being hardware and positive being software.

A "0" code is right there in the middle where it usually means a sudden loss of power.  See this post for more info:  Are OS X shutdown cause and sleep cause numbers listed/explained anywhere?

If any part of your logic board was beginning to fail, it would generate kernel panics which would be in the log and likewise, if you had software causing issues, there would be a log of a crash somewhere.

I've see this previously on other platforms whether it was a Mac, or a PC, or even enterprise grade servers.  What is probably happening is that a component in your power supply is getting too hot and consequently shutting down.  If you take it to the Apple store, they probably have the ambient temperature much lower than you home so it never has a chance to over heat. Just when you think everything is good, the symptoms return.

Is your downstairs location warmer or cooler than the upstairs location where it normally resides?

If you need to replace your power supply, rest assured these are fairly easy to come by and fairly inexpensive.  At the time of this post, they were trending around $65.   It's also very easy to replace (see the guide at ifixit.com)

While you are in there, I would swap out your (spinning) HDD with a SSD. I just installed a Samsung 850 EVO SSD in my 27" iMac and it is substantially quieter and cooler than before.

Disclaimer:  There still is a chance it's the logic board, but it's highly unlikely.  Before you do any expensive logic board replacements, try replacing the power supply first.  

One more thing....I would definately follow agentroadkill's advice from his comment and put a UPS (battery backup) between the outlet and your Mac.