First of all, the value “1” in “PreventUserIdleSystemSleep” is nothing special. It's only a problem, if a process keeps this "flag" set continually, as I showed in a previous example. The "thingy" preventing sleep, was the value “1” in “PreventUserIdleSystemSleep”, but the originator of this flag was (most of the time) a contacts sync process repeated each 30 seconds (when sync to iCloud was NOT enabled). Here’s a “cut” from my “power” log (pmset -g log) as an example of one of many cases for the value “1” in “PreventUserIdleSystemSleep”, that is totally acceptable and normal:
Total Sleep/Wakes since boot at 14/07/14 19.34.03 CEST :11
15/07/14 12.52.51 CEST Showing all currently held IOKit power assertions
Assertion status system-wide:
BackgroundTask 1
PreventDiskIdle 0
ApplePushServiceTask 0
UserIsActive 1
PreventUserIdleDisplaySleep 0
InteractivePushServiceTask 0
PreventSystemSleep 0
ExternalMedia 1
PreventUserIdleSystemSleep 1
NetworkClientActive 0
Listed by owning process:
* pid 1771(backupd): [0x00000001000006c7] 00:01:55 PreventUserIdleSystemSleep named: "Time Machine backup"
pid 1771(backupd): [0x0000000c000006c6] 00:01:55 BackgroundTask named: "Time Machine backup"
pid 84(hidd): [0x0000000a000006b9] 00:03:33 UserIsActive named: "com.apple.iohideventsystem.queue.tickle"
Timeout will fire in 592 secs Action=TimeoutActionRelease
* pid 1609(ChronoSync): [0x00000001000005f3] 00:56:15 PreventUserIdleSystemSleep named: "<EZSSynchronizer: 0x1040ac400>"
pid 16(powerd): [0x000000090000012c] 17:18:47 ExternalMedia named: "com.apple.powermanagement.externalmediamounted"
pid 11(UserEventAgent): [0x0000000c000006d1] 00:00:15 BackgroundTask named: "com.apple.metadata.mds_stores.power"
pid 11(UserEventAgent): [0x0000000c000006c3] 00:02:26 BackgroundTask named: "com.apple.backupd-auto"
pid 137(mds_stores): [0x0000000c000006d0] 00:00:15 BackgroundTask named: "com.apple.metadata.mds_stores.power"
Kernel Assertions: 0x2c=USB,BT-HID,THNDR
id=500 level=255 0x4=USB mod=14/07/14 19.41 description=XHC1 owner=AppleUSBXHCI
id=503 level=255 0x20=THNDR mod=15/07/14 11.53 description=NHI0 owner=AppleThunderboltHAL
id=504 level=255 0x8=BT-HID mod=01/01/70 01.00 description=com.apple.driver.IOBluetoothHIDDriver owner=BNBMouseDevice
id=505 level=255 0x8=BT-HID mod=01/01/70 01.00 description=com.apple.driver.IOBluetoothHIDDriver owner=AppleBluetoothHIDKeyboard
From this, you can see, that there are TWO tasks, that prevent sleep. One is “Time Machine Backup” and the other my “ChronoSync” application, which is currently performing a sync operation to a NAS connected through Ethernet. Both operations (marked * above) should be left to complete their work, before my macbook goes to sleep. At least, that’s the common wisdom. Even if it wasn’t so, I’d personally prefer things to behave that way.
The important thing is this state, taken a bit later:
Total Sleep/Wakes since boot at 14/07/14 19.34.03 CEST :11
15/07/14 13.05.17 CEST Showing all currently held IOKit power assertions
Assertion status system-wide:
BackgroundTask 0
PreventDiskIdle 0
ApplePushServiceTask 0
UserIsActive 1
PreventUserIdleDisplaySleep 0
InteractivePushServiceTask 0
PreventSystemSleep 0
ExternalMedia 1
PreventUserIdleSystemSleep 1
NetworkClientActive 0
Listed by owning process:
pid 84(hidd): [0x0000000a000006b9] 00:15:59 UserIsActive named: "com.apple.iohideventsystem.queue.tickle"
Timeout will fire in 583 secs Action=TimeoutActionRelease
* pid 1609(ChronoSync): [0x00000001000005f3] 01:08:41 PreventUserIdleSystemSleep named: "<EZSSynchronizer: 0x1040ac400>"
pid 16(powerd): [0x000000090000012c] 17:31:13 ExternalMedia named: "com.apple.powermanagement.externalmediamounted"
Kernel Assertions: 0x2c=USB,BT-HID,THNDR
id=500 level=255 0x4=USB mod=14/07/14 19.41 description=XHC1 owner=AppleUSBXHCI
id=503 level=255 0x20=THNDR mod=15/07/14 11.53 description=NHI0 owner=AppleThunderboltHAL
id=504 level=255 0x8=BT-HID mod=01/01/70 01.00 description=com.apple.driver.IOBluetoothHIDDriver owner=BNBMouseDevice
id=505 level=255 0x8=BT-HID mod=01/01/70 01.00 description=com.apple.driver.IOBluetoothHIDDriver owner=AppleBluetoothHIDKeyboard
Now it’s only my active sync process (marked * above), that prevents the notebook from going to sleep. Time Machine Backup has terminated, and no longer prevents my computer from sleeping. After some intensive work, the system even settles down to this:
15/07/14 14.32.26 CEST
Assertion status system-wide:
BackgroundTask 0
PreventDiskIdle 0
ApplePushServiceTask 0
UserIsActive 1
PreventUserIdleDisplaySleep 0
InteractivePushServiceTask 0
PreventSystemSleep 0
ExternalMedia 1
PreventUserIdleSystemSleep 0
NetworkClientActive 0
Listed by owning process:
pid 84(hidd): [0x0000000a0000080a] 00:09:05 UserIsActive named: "com.apple.iohideventsystem.queue.tickle"
Timeout will fire in 589 secs Action=TimeoutActionRelease
pid 16(powerd): [0x000000090000012c] 18:58:22 ExternalMedia named: "com.apple.powermanagement.externalmediamounted"
Kernel Assertions: 0x2c=USB,BT-HID,THNDR
id=500 level=255 0x4=USB mod=14/07/14 19.41 description=XHC1 owner=AppleUSBXHCI
id=503 level=255 0x20=THNDR mod=15/07/14 11.53 description=NHI0 owner=AppleThunderboltHAL
id=504 level=255 0x8=BT-HID mod=01/01/70 01.00 description=com.apple.driver.IOBluetoothHIDDriver owner=BNBMouseDevice
id=505 level=255 0x8=BT-HID mod=01/01/70 01.00 description=com.apple.driver.IOBluetoothHIDDriver owner=AppleBluetoothHIDKeyboard
where there is nothing blocking the system from going to sleep, except me (the flag “UserIsActive” equals “1”). Everything looks relaxed and beautiful, and sleep should be possible any moment now. …any moment noooowwffhh …any …shhh
Here’s an example of a period of real and completely undisturbed sleep from the recent night:
Time stamp Domain Message Duration Delay
14/07/14 23.22.06 CEST Sleep Idle Sleep to DarkWake: Using AC (Charge:100%)
14/07/14 23.22.06 CEST Assertions PID 16(powerd) Created InternalPreventSleep "com.apple.powermanagement.darkwakelinger" 00:00:00 id:0xe00000455 [System: SRPrevSleep NetAcc kCPU]
14/07/14 23.22.06 CEST Assertions PID 127(cupsd) Released NetworkClientActive "org.cups.cupsd" 01:06:23 id:0x1200000380 [System: SRPrevSleep kCPU]
14/07/14 23.22.22 CEST Assertions PID 16(powerd) TimedOut InternalPreventSleep "com.apple.powermanagement.darkwakelinger" 00:00:15 id:0xe00000455 [System: SRPrevSleep kCPU]
14/07/14 23.22.22 CEST Assertions PID 16(powerd) Released InternalPreventSleep "com.apple.powermanagement.darkwakelinger" 00:00:15 id:0xe00000455 [System: SRPrevSleep kCPU]
14/07/14 23.22.22 CEST Summary- [System: No Assertions] Using AC
14/07/14 23.22.22 CEST Sleep Idle Sleep: Using AC (Charge:100%) 36619 secs
14/07/14 23.22.23 CEST Assertions PID 127(cupsd) Created NetworkClientActive "org.cups.cupsd" 00:00:00 id:0x1200000460 [System: BGTask NetAcc kCPU]
14/07/14 23.22.24 CEST SlowResponse PMConnection: Response from com.apple.apsd is slow (powercaps:0x0) 1997 ms
14/07/14 23.22.24 CEST WakeRequests Clients requested wake events: None
15/07/14 09.32.41 CEST Wake Wake [CDNVA] due to EHC1/HID Activity: Using AC (Charge:100%) 1399 secs
15/07/14 09.32.41 CEST Cancelled Kernel: Response from cupsd is to cancel state change (powercaps:0x9)
15/07/14 09.33.10 CEST Assertions PID 1092(backupd-helper) Released BackgroundTask "backupd-helper" 00:00:28 id:0xc0000046c [System: PrevIdle BGTask NetAcc kCPU]
15/07/14 09.33.11 CEST Assertions PID 1165(AddressBookSour) Released PreventUserIdleSystemSleep "Address Book Source Sync" 00:00:30 id:0x100000473 [System: PrevIdle BGTask NetAcc kCPU]
15/07/14 09.33.11 CEST Assertions PID 221(UserEventAgent) Released BackgroundTask "com.apple.AddressBook.ScheduledSync" 00:00:30 id:0xc00000474 [System: PrevIdle BGTask NetAcc kCPU]
15/07/14 09.33.12 CEST Assertions PID 127(cupsd) Released NetworkClientActive "org.cups.cupsd" 10:10:49 id:0x1200000460 [System: PrevIdle BGTask]
15/07/14 09.34.29 CEST Assertions PID 1092(backupd-helper) Released BackgroundTask "backupd-helper" 00:00:30 id:0xc0000048a [System: PrevIdle BGTask]
15/07/14 09.34.38 CEST Assertions PID 137(mds_stores) Released BackgroundTask "com.apple.metadata.mds_stores.power" 00:01:45 id:0xc00000485 [System: PrevIdle BGTask]
15/07/14 09.34.38 CEST Assertions PID 11(UserEventAgent) Released BackgroundTask "com.apple.metadata.mds_stores.power" 00:01:45 id:0xc00000486 [System: PrevIdle BGTask]
15/07/14 09.37.04 CEST Assertions PID 1180(backupd) Released BackgroundTask "Time Machine backup" 00:03:54 id:0xc00000487 [System: PrevIdle]
15/07/14 09.37.04 CEST Assertions PID 1180(backupd) Released PreventUserIdleSystemSleep "Time Machine backup" 00:03:54 id:0x100000488 [System: No Assertions]
15/07/14 09.41.21 CEST Assertions PID 1266(AddressBookSour) Released PreventUserIdleSystemSleep "Address Book Source Sync" 00:00:30 id:0x10000049c [System: BGTask]
15/07/14 09.41.21 CEST Assertions PID 221(UserEventAgent) Released BackgroundTask "com.apple.AddressBook.ScheduledSync" 00:00:30 id:0xc0000049d [System: No Assertions]
15/07/14 09.45.03 CEST Assertions PID 99(apsd) Released ApplePushServiceTask "com.apple.apsd-recreatecachedictionaries-push.apple.com" 00:00:29 id:0xc000004aa [System: BGTask]
15/07/14 09.50.20 CEST Assertions PID 1274(AddressBookSour) Released PreventUserIdleSystemSleep "Address Book Source Sync" 00:00:30 id:0x1000004c6 [System: BGTask]
15/07/14 09.50.20 CEST Assertions PID 221(UserEventAgent) Released BackgroundTask "com.apple.AddressBook.ScheduledSync" 00:00:30 id:0xc000004cd [System: No Assertions]
15/07/14 09.51.29 CEST Assertions PID 1393(AddressBookSour) Released PreventUserIdleSystemSleep "Address Book Source Sync" 00:00:30 id:0x1000004e0 [System: BGTask]
15/07/14 09.51.29 CEST Assertions PID 221(UserEventAgent) Released BackgroundTask "com.apple.AddressBook.ScheduledSync" 00:00:30 id:0xc000004e1 [System: No Assertions]
15/07/14 09.55.45 CEST Assertions PID 16(powerd) Created InternalPreventSleep "com.apple.powermanagement.darkwakelinger" 00:00:00 id:0xe000004e7 [System: SRPrevSleep kCPU]
15/07/14 09.56.00 CEST Assertions PID 16(powerd) TimedOut InternalPreventSleep "com.apple.powermanagement.darkwakelinger" 00:00:15 id:0xe000004e7 [System: SRPrevSleep kCPU]
15/07/14 09.56.00 CEST Assertions PID 16(powerd) Released InternalPreventSleep "com.apple.powermanagement.darkwakelinger" 00:00:15 id:0xe000004e7 [System: SRPrevSleep kCPU]
Between 23.22.24 and 09.32.41 nothing happened. The system was effectively dead, quiet and inactive for more than 10 hours. No log entry. No nothing, until I woke up the system. Then I start to see sync entries - as you should with active sync immediately after wakeup after 10 hours downtime - and also “Time Machine Backup” wants a say together with a lot of other things. Immediately after wakeup, the system is a busy place, and it may take minutes before the system is not prevented from going to sleep again. This is also as it should be. From time to time i.e. contact sync has to take place. The important thing is, that it completes, and no longer blocks the computer from entering sleep mode.
Before activating iCloud contact sync, this situation was often (maybe most of the time or always ???) blocked by a sync process recurring again and again and again each 30 seconds in "perpetuity" ;-)
I hope, this will help in understanding the problem, and - if Apple looks into this - it may even lead to a fix for the problem.