Macrium Support Forum

Computer is not waked from S3 sleep

https://forum.macrium.com/Topic57103.aspx

By JK - 16 January 2022 4:17 PM

I am experimenting with Reflect's scheduling functionality for the first time, so I get to be a newb again!

Every evening, I put my laptop top sleep using Start > Power > Sleep.  I had a backup scheduled for 8:00am this morning, but it apparently did not wake the computer up, and only executed after I had manually woken the computer up at 9:58am (see screenshot):




I did set the condition for waking the computer:



And I have confirmed that my computer does not use Modern Standby (S0xi); the only supported sleep state is the legacy standby (S3):



Thus, the registry hacks proposed to solve the S0xi problem presumably do not apply to this case.

Any suggestions?
By JK - 16 January 2022 10:57 PM

Found this KB article, and I have now changed my wake timers to enabled.  We'll see if it wakes up tomorrow morning.
By JK - 17 January 2022 4:00 PM

This time it worked!  However, there was some unexpected behavior, so I have follow-up questions...

When I arrived at my computer this morning, it was asleep.  Thus, I first though that the wake timer fix had not worked, and that the scheduled backup had not run.  However, upon manually waking the laptop and examining logs, I found that the backup did run on schedule (36 seconds after the computer was woken out of S3 sleep), and completed 67 seconds later.  The unexpected behavior was that 101 seconds after the backup completed, there was an Event 42 indicating that the system was entering sleep, stating "Sleep Reason: System idle."  I was surprised by this, because my custom power plan specifies that the computer should never go to sleep or even turn off its display (it does specify to turn off hard disk after 60 min of inactivity, but I'm not sure if this even applies to an SSD).

After researching this behavior, I found that there is an additional, hidden setting for the advanced power configuration, which can be revealed by typing the following command in an elevated PowerShell window (hat tip to user jenae at techsupportforum.com):
powercfg -attributes SUB_SLEEP 7bc4a2f9-d8fc-4469-b07b-33eb785aaca0 -ATTRIB_HIDE


After executing the above command, settings for System unattended sleep timeout will be available under the Sleep node in the advanced power settings.  The tool tip pop-up clarifies that these settings represent "Idle timeout before the system returns to a low power sleep state after waking unattended"; the default value is 2 min (for when on battery power and when plugged in).  So this seems to explain why the computer resumed sleep after being woken by the Macrium Scheduler.


Follow-up Questions:
  • Although this morning's behavior seems to make sense now, the timing of events is not perfectly consistent with the default 2-min setting for the System unattended sleep timeout.  The sleep state was resumed 101 seconds (< 2 min) after the Reflect backup was completed, which was 204 seconds (> 3 min) after the wake-up call.  I can accept that maybe "2 min" doesn't necessarily mean exactly 2 min, but I'd like to know when does it start counting (i.e., what constitutes "idle" for the purposes of this timer?)?  Is the computer considered "idle" as long as there is no human input? Or is it considered "idle" only if the backup job has completed (and there are no further scheduled tasks or human inputs)?
  • If the "idle" timer starts as soon as the computer wakes up (and keeps ticking as long as there is no human input), is there a risk that this System unattended sleep timeout event could interrupt/terminate the running Reflect backup task?
  • Bottom line question:  Do I need to make sure that the System unattended sleep timeout settings are sufficiently long to guarantee that the scheduled backup can be completed before the system is put back to sleep?
Thank you!
By JK - 18 January 2022 1:07 PM

In case anybody is reading this (and for my future reference):  This morning, the computer did not go back to sleep after completing the scheduled morning backup, even though I had made no changes to the System unattended sleep timeout settings (other than enabling them to be displayed in the Advanced Power Settings).  Perhaps they are quantum timers, that do not work when observed?
By pokeefe - 18 January 2022 6:54 PM

It's probably a bit late for this, but does "powercfg -requests" in an elevated Powershell prompt show anything preventing sleep?  (I don't pretend to know anything about the different sleep states and don't know if that command is even applicable to S3.)
By JK - 18 January 2022 8:13 PM

For what it's worth:

> powercfg -requests

DISPLAY:
None.

SYSTEM:
None.

AWAYMODE:
None.

EXECUTION:
None.

PERFBOOST:
None.

ACTIVELOCKSCREEN:
None.
By JK - 19 January 2022 1:32 PM

Update:
Third morning of successful wake-up.  This time, the computer did put itself back to sleep after the backup, with timing similar to the first morning:  Sleep was resumed 104 seconds (< 2min) after the end of the backup, which was 193 second (> 3min) after the initial wake-up call.  As previously, I still have the System unattended sleep timeout set to 2 min.  

So it's still unclear when the 2-min timeout timer starts counting, or whether it is important to ensure that this timeout setting is always longer than the expected time for Reflect to complete the scheduled backup.  Experiences reported elsewhere by @DanDanz suggest that it is possible for the computer to fall asleep in the middle of a backup, which indicates it would be critical to ensure that the System unattended sleep timeout setting is sufficiently large to prevent this.

Edit: Crossed out a speculation that was based on what turned out to be an inaccurate interpretation of Dan's post (see follow-up comments below).
By DanDanz - 19 January 2022 3:14 PM

It's quite possible that you and I have different cases.  My failure is not because it goes back to sleep, but a network error which I believe is the Connected Standby code shutting it down.   The job runs long enough to connect to the target folder share on another system, backup two small partitions (EFI and MSR), create VSS snapshots for both C; and D: (a small data partition) and then is able to report the error to the log file, and close both logs.
Here is the end of the log:
Saving Partition - Windows (CSmile
    Reading File System Bitmap
    Looking for changes
    Saving Partition
    Gathering Windows Events - Please Wait
    Backup aborted! - Write operation failed - An unexpected network error occurred.

By JK - 19 January 2022 3:19 PM

Dan, thanks for the clarification. When you had written that your "HP laptop wakes up at 02:00 but repeatedly dies in a short time after starting the actual writing", I assumed you meant that the laptop was going back to sleep in the middle of creating the backup.
By DanDanz - 19 January 2022 3:21 PM

JK - 19 January 2022 3:19 PM
Dan, thanks for the clarification. When you had written that your "HP laptop wakes up at 02:00 but repeatedly dies in a short time after starting the actual writing", I assumed you meant that the laptop was going back to sleep in the middle of creating the backup.

My fault for using imprecise wording.  Please let me know if you stumble across anything to do with a network disconnect time. 
By pokeefe - 19 January 2022 5:52 PM


L. W. "Dan" Danz - 19 January 2022 3:14 PM
It's quite possible that you and I have different cases.  My failure is not because it goes back to sleep, but a network error which I believe is the Connected Standby code shutting it down.   The job runs long enough to connect to the target folder share on another system, backup two small partitions (EFI and MSR), create VSS snapshots for both C; and D: (a small data partition) and then is able to report the error to the log file, and close both logs.
Interesting.  Is this a Windows-to-Windows backup such that Connected Standby is shutting down the destination system?   When a backup is running on my computers the "powercfg -requests" shows
PS C:\WINDOWS\system32> powercfg -requests
DISPLAY:
None.

SYSTEM:
[PROCESS] \Device\HarddiskVolume2\Program Files\Macrium\Reflect\ReflectBin.exe

AWAYMODE:
[PROCESS] \Device\HarddiskVolume2\Program Files\Macrium\Reflect\ReflectBin.exe

EXECUTION:
None.

PERFBOOST:
None.

ACTIVELOCKSCREEN:
None.

which prevents sleep during the backup, but that, of course, would not keep the remote Windows awake if I were backing up to another Windows system.


By DanDanz - 19 January 2022 6:14 PM

Patrick O'Keefe - 19 January 2022 5:52 PM

L. W. "Dan" Danz - 19 January 2022 3:14 PM
It's quite possible that you and I have different cases.  My failure is not because it goes back to sleep, but a network error which I believe is the Connected Standby code shutting it down.   The job runs long enough to connect to the target folder share on another system, backup two small partitions (EFI and MSR), create VSS snapshots for both C; and D: (a small data partition) and then is able to report the error to the log file, and close both logs.
Interesting.  Is this a Windows-to-Windows backup such that Connected Standby is shutting down the destination system?   When a backup is running on my computers the "powercfg -requests" shows
PS C:\WINDOWS\system32> powercfg -requests
DISPLAY:
None.

SYSTEM:
[PROCESS] \Device\HarddiskVolume2\Program Files\Macrium\Reflect\ReflectBin.exe

AWAYMODE:
[PROCESS] \Device\HarddiskVolume2\Program Files\Macrium\Reflect\ReflectBin.exe

EXECUTION:
None.

PERFBOOST:
None.

ACTIVELOCKSCREEN:
None.

which prevents sleep during the backup, but that, of course, would not keep the remote Windows awake if I were backing up to another Windows system.


No, the target system is not going offline.   Only the source system, and of 4 systems this one is the only one that consistently goes offline in the middle of a backup.
Edited to correct spell checker that changed Only to offline.
By pokeefe - 19 January 2022 6:34 PM

L. W. "Dan" Danz - 19 January 2022 6:14 PM
No, the target system is not going offline.   Only the source system, and of 4 systems this one is the only one that consistently goes offline in the middle of a backup.
Anything in the Windows Event log indicating a problem?  I've seen Event Id 6062 -"Lso was triggered" cause a network failure during a Reflect backup.
(Sorry to hijack JK's thread.)

By JK - 19 January 2022 8:37 PM

I'm gonna high-jack it right back!

I confirmed that when a scheduled incremental backup was running, I get similar results to powercfg -requests as those posted by @pokeefe:

> powercfg -requests

DISPLAY:
None.

SYSTEM:
[PROCESS] \Device\HarddiskVolume3\Program Files\Macrium\Reflect\reflectbin.exe

AWAYMODE:
[PROCESS] \Device\HarddiskVolume3\Program Files\Macrium\Reflect\reflectbin.exe

EXECUTION:
None.

PERFBOOST:
None.

ACTIVELOCKSCREEN:
None.


So, does this mean that I don't have to worry about the System unattended sleep timeout setting (i.e., as long as the scheduled backup starts before the timeout, it will not be interrupted by an Event 42)?
By pokeefe - 19 January 2022 9:46 PM

JK - 19 January 2022 8:37 PM
So, does this mean that I don't have to worry about the System unattended sleep timeout setting (i.e., as long as the scheduled backup starts before the timeout, it will not be interrupted by an Event 42)?

I thought so, but I just found something on the web here that makes me question that. It says

SYSTEM power request type (PowerRequestSystemRequired)
This request prevents the computer from automatically entering sleep mode after a period of user inactivity.
This request type is not honored on systems capable of connected standby. Applications should use PowerRequestExecutionRequired requests instead.
You said the Modern Standby is not an issue here so I think that means Connected Standby is also not an issue, but I could be wrong.  Perhaps  Reflect should also enable PowerRequestExecutionRequired to cover that case.  I have no idea what other implications PowerRequestExecutionRequired has.
By JK - 19 January 2022 9:50 PM

Good find!

Perhaps Reflect should also enable PowerRequestExecutionRequired to cover that case.

+1
By JK - 21 January 2022 2:50 PM

I'm starting to think that the System unattended sleep timeout setting may be a red herring (not actually used by my OS), or perhaps its configured value is more of a "suggestion" than a firm setting.  Although my timeout setting has always been 2 min, in the past two days, the computer remained awake for 8 min (after the end of the scheduled backup) yesterday, and 1 hour this morning.
By JK - 22 January 2022 4:25 PM

Just updating to consolidate possibly relevant information found elsewhere...

So, does this mean that I don't have to worry about the System unattended sleep timeout setting (i.e., as long as the scheduled backup starts before the timeout, it will not be interrupted by an Event 42)?

I thought so, but I just found something on the web here that makes me question that. It says

A recently resurfaced thread from 2017 indicates that running backups do prevent the system from entering Sleep or Hibernation states. A post by Nick in that thread explains that a Registry key must be defined to enable sleep or hibernation during an active backup operation.