Troubleshooting the Mysterious “-122” Shutdown Code
In an earlier article, “Mac G5 Desktop Spontaneously Shuts Down,” I discuss a problem with Macintosh OS X computers that can be difficult to diagnose, and for which there is precious little accurate information available to assist you – online or even with Apple Support!
If you are experiencing mysterious and random shutdown events on your Mac, check your system.log file for the following text, or something very similar:
ApplePMU::PMU FORCED SHUTDOWN, CAUSE = -122
or, as reported for later model G5's:
AppleSMU -- shutdown cause = -122
This discussion is an update of that earlier article, including specific troubleshooting suggestions, as well as new information gleaned from comments and emails detailing the experiences of readers of this blog. Yes, this problem may be serious, but it also can be as simple as a loose power cord. Read on to get the benefit of some hard won wisdom!
Click here to jump straight to the Troubleshooting section!
Symptoms to Look For
The symptom of this problem is that the Macintosh will mysteriously and randomly shut itself off. Perhaps you leave your Mac on all the time, and you just walked in to find your Macintosh completely shut off; or, perhaps you are using your Mac, and suddenly it turns off as if someone pulled the power cord right out of the wall. The key here is that the Macintosh is shutting itself off completely. There is no “crash,” no error dialog – just a computer that is suddenly completely turned off.
If this is what you are experiencing, make sure to check the system.log file (go your Applications folder, open the Utilities folder, and then open the Console application; click on the Logs button, then choose system.log from the list on the left). Find the section with the date and time showing the most recent reboot, and look carefully for text that mentions “shutdown” and look for an error code. The paragraph at the beginning of this article lists two actual log entries as examples, although future releases of the operating system may vary the text somewhat.
If you see a shutdown message that lists the numeric code “-122” then read on; any other numeric code will indicate issues other than what is addressed here.
A Little Background
Depending on the age and model of Mac you have, the power is controlled either by a Power Management Unit (PMU) or a Systems Management Unit (SMU). The changeover appears to have taken place around late 2004, but it doesn’t really affect the issue discussed in this article. I’ll use the term “SMU” in the rest of the article for convenience.
When the SMU has to initiate a shutdown, it attempts to store a code (either on the hard disk, or in non-volatile RAM) that indicates the reason for the shutdown. The codes indicate reasons running the gamut from emergency thermal shutdowns to the power units just getting “confused.” The code that concerns us here (code -122) seems to appear whenever there is a sudden loss of power to the computer.
There is surprisingly little information out on the Internet that really discusses this problem. Even Apple Support seems confused, giving very uneven responses to callers, and inconsistent repair recommendations. One thing to be aware of, should you have searched the Internet already, is that an old Macintosh OS 9 error code list is floating around, listing an “-122” error as some kind of file system error (to be specific, a “badMovErr” under the HFS file system). This does not apply to Macintosh OS X at all, so just ignore this red herring.
Outright Speculation
In the absence of specific official information, my speculation regarding this is that the operating system takes advantage of a common technique to handle unknown events. After the computer boots up and all is well, the SMU writes out a special code to indicate that it started up normally – we’ll call it “000”; when the SMU next shuts down the computer, it writes out a different code. Let’s say it writes out “001” for a normal shutdown. The next time the computer boots up, if it sees a “001” code, it knows that the last time it shut down, all was well, and so it doesn’t make any mention of any problems in the system.log file. But let’s say that the SMU shut down the computer for a reason, like an overheating condition. In this case, the SMU might write out a different code, like “999.” When the Mac next boots up, it sees the “999” code, and so it writes out a message in the system.log letting you know that the SMU forced a shutdown for a reason.
But think about this for a second: if someone literally trips over your power cord, your computer instantly loses power. The SMU doesn’t get a chance to do anything, and so it never gets a chance to write ANY code out. As a result, the “000” code is left in non-volatile memory, since it was the last code written out when the computer started up normally. When next the Mac reboots, it reads in the code, and when it sees “000” instead of any of the other codes, it knows that the computer shut down abnormally, but it has no clue of why. In this specific case—sort of the “mystery” case—the message that gets written out to the system.log file indicates that the SMU shutdown cause was “-122.” That is to say, when you see the “-122” code, it means that there was a sudden and catastrophic loss of power to the main logic board. Unfortunately, it doesn’t tell you the actual reason behind it.
The Likely Culprits (… And At Last, Some Troubleshooting)
When you are in this situation, there are a number of possible reasons for a sudden loss of power. More or less in order of how easy/cheap they are to fix, here are my top contenders:- Software Problems: although I don’t think the -122 code is generated by software issues, it’s standard practice at Apple to recommend that you reset the SMU (or PMU) on your Macintosh. And it’s easier than any of the following! So, try it out. Check the Apple Support site for an article on your computer; there are variations in the method and the effects, depending on your computer, so read carefully before doing anything. Here are some quick links that were active as of this writing:
-
Preference Problems: again, I don’t believe the -122 code is caused by the PMU “just getting confused,” but it doesn’t hurt to try this other standard Apple recommendation: delete the files “com.apple.powermanagement.plist” and “preferences.plist” from your Library/Preferences/SystemConfiguration folder.
Note: I have not personally received this information from Apple, but it has been related to me through comments and email messages. I strongly recommend that you confirm with Apple the proper files to delete before performing this step, and make sure to make backup archives of these files before deleting them!
Power Cord and Computer Case Problems: make sure your power cord is firmly plugged in to the back of the Macintosh, as well as the power outlet. If you’re using a power strip, take it out and plug it directly into the wall. Swap out a different power cord. There is also a report that an improperly closed case will cause this problem, so if you have recently installed RAM or an Airport Card in your Mac, make sure your case is completely closed, seated properly, and sealed tight.
External Device Problems: at least one user has reported definitively that his problems were caused by a bad external FireWire cable. I would recommend unplugging all external devices and their cables (external hard drives, iPod docks/cables, digital camera docks, printers, etc.) and see if it has any effect on the problem.
External Power Problems: perhaps the quality of the external power coming into your Mac is bad. Perhaps you’re on an overloaded circuit, or there’s a big load on your service that comes and goes, or you just have a bad plug. Try plugging your Mac into a different plug, and preferably a different circuit in your home/office. Or, move it to a different home/office and try it there. If you’re using a UPS (uninterruptible power supply), try plugging your Mac into a different UPS, or directly into the wall. UPS’s do fail, and in fact this is what introduced me to this very problem! If you’re not using a UPS, borrow one from a friend, and seriously consider buying one. While a quality UPS will allow your Mac to run for 10’s of minutes or longer (if you shell out a couple of hundred bucks!), decent UPS’s that will handle transient power failures of less than a minute can be had for less than $40 at your local office supply store.
-
Internal Component Failure: this is where things start to get a little ugly and a little expensive. When you have an intermittent hardware failure, they are notoriously hard to nail down exactly. The two main culprits are the power supply that converts AC power from the wall to DC power for your circuits, and the main logic board itself. At this point, I fear you're in the fine hands of Apple Support. If you’re writing the checks, I suspect that the power supply is the less expensive component, but if you’re under warranty, you’ll have to go with whatever Apple suggests.
Note: If you do have a bad internal component, I heartily recommend making sure you’re on a UPS when you get your computer back, as normal household power can be pretty tough on today’s electronics. Something caused your normally reliable hardware components to fail, and a UPS will go a long way to improving the power quality and preventing damaging power surges in the future.
Closing Thoughts
I hope that this article has been of help to you if you find yourself experiencing this maddening error. There is nothing worse than having your Macintosh just “turn off” for no apparent reason. And, it’s certainly not easy on your computer, either!
If you do find yourself experiencing this error, and manage to correct it, please take a moment to post your experience here on this blog entry – it’s through your efforts that we can add to the online knowledgebase for future readers!
Cheers!
..Chris..