iMac won’t stop going to sleep while in use

I have a 2017 21.5 iMac on macOS Ventura 13.6.7. Recently, the device suddenly restarted 3 times and since then the display has suddenly gone to sleep while the device is in use. Upon waking the iMac after that it goes back to sleep 15-30 seconds afterwards whether it’s in use or not.


Ive done a few things in attempt to fix it with no luck. I’ve tried messing around with the screen timeout and energy settings, updating the operating system, ran a First Aid on the disk, A PRAM reset and I’ve reinstalled MacOS Ventura onto the device.


I did try to diagnose if it was any external hardware, as I do have a pen display hooked up through a usb c to hdmi adapter, but the issue persists still.


Does anyone have any tips or solutions to fix this issue?

iMac (2017 – 2020)

Posted on Jun 16, 2024 7:03 AM

Reply
2 replies

Jun 17, 2024 2:53 PM in response to ecriis0544

The sudden restarts could have corrupted/damaged one of the temp cache files. To see if that is the case or possible some 3rd party software is the culprit boot into Safe Mode according to How to use safe mode on your Mac and test to see if the problem persists. Reboot normally and test again.


NOTE 1: Safe Mode boot can take up to 3 - 5 minutes as it's doing the following; 

• Verifies your startup disk and attempts to repair directory issues, if needed

• Loads only required kernel extensions (prevents 3rd party kernel/extensions from loading)

• Prevents Startup Items and Login Items from opening automatically

• Disables user-installed fonts 

• Deletes font caches, kernel cache, and other system cache files


NOTE 2: if you have a wireless keyboard with rechargeable batteries connect it with its charging cable before booting into Safe Mode. This makes it act as a wired keyboard as will insure a successful boot into Safe Mode.


Jun 16, 2024 5:13 PM in response to ecriis0544

You can try installing macOS to an external USB3 SSD & boot from the external SSD to see how the iMac works. If this works fine, then you know that something is either wrong with macOS on the internal drive or the internal drive itself is the problem.


You can try installing macOS to a new APFS volume on the internal drive assuming you have at least 80GB+ of Free storage space....ignore the "Available" storage value as it is very misleading. This option is not as good since it you are still using the same APFS file system and drive.


When installing macOS with either method, it is important NOT to restore from a backup, and do NOT install any third party apps, and do not sign into your AppleID or iCloud since you want a fresh OS for testing to confirm a hardware issue.


You can check the health of the internal drive(s) by running DriveDx (free trial period) and posting the complete text report here using the "Additional Text" icon which looks like a piece of paper on the forum editing toolbar.


You can also run the third party app EtreCheck and posting the complete report here so we can examine it for possible clues.


Try booting into Safe Mode to see how it works. If this works, then you most likely have an issue with third party software that is installed.


Try running Disk Utility First Aid on the hidden Container or Fusion Drive. Within Disk Utility you may need to click "View" and select "Show All Devices" before the hidden Container appears on the left pane of Disk Utility. Even if First Aid says everything is "Ok", click "Show Details" and scroll back through the log to see if any unfixed errors are listed. If there are errors listed, then run First Aid again until they are gone. If after several attempts the errors remain, then run First Aid while booted into Recovery Mode. If the errors still remain after several more attempts, then you will need to perform a clean install of macOS by first erasing the whole physical drive (or Fusion Drive item) followed by reinstalling macOS & restoring from a backup.


Try running the Apple Diagnostics to see if any hardware issues are detected.


Disconnect all external devices in case one of them is causing a problem.


You can try using the following command in the Terminal app to see if the system is actually triggering sleep mode or if it may be something else.

pmset  -g  log


To narrow the results down to a single day, you can use "grep" to filter output for a particular date such as "2024-06-16" (adjust accordingly):

pmset  -g  log  |  grep  '2024-06-16'





iMac won’t stop going to sleep while in use

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.