Failed to save the current environment block

Problem

I have received some questions lately about a weird blocking MDT bug on some uEFI machines.

A quick scan of the bdd.log does not reveal any clue as to what the failure is, however when we check the SMSTS.log file we can see the following:

Set a global environment variable _SMSTSNextInstructionPointer=53     TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)
Set a TS execution environment variable _SMSTSNextInstructionPointer=53       TSManager         1/29/2013 6:41:40 AM                1532 (0x05FC)
Set a global environment variable _SMSTSInstructionStackString=46       TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)
Set a TS execution environment variable _SMSTSInstructionStackString=46         TSManager         1/29/2013 6:41:40 AM                1532 (0x05FC)
Save the current environment block       TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)
pszPath[0] != L'', HRESULT=80070057 (c:\qfe\nts_sms_fre\sms\framework\core\ccmcore\path.cpp,58)                TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)
Filesystem::Path::Add(sEnvPath, EnvDataFileName, sEnvPath), HRESULT=80070057 (e:\nts_sms_fre\sms\framework\tscore\environmentlib.cpp,639)         TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)
Failed to save environment to  (80070057)           TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)
TS::Environment::SharedEnvironment.saveEnvironment(szPath), HRESULT=80070057 (e:\nts_sms_fre\sms\client\tasksequence\executionengine\executionenv.cxx,842)     TSManager         1/29/2013 6:41:40 AM         1532 (0x05FC)
Failed to save the current environment block. This is usually caused by a problem with the program. Please check the Microsoft Knowledge Base to determine if this is a known issue or contact Microsoft Support Services for further assistance.
The parameter is incorrect. (Error: 80070057; Source: Windows) TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)
SaveEnvironment(), HRESULT=80070057 (e:\nts_sms_fre\sms\client\tasksequence\executionengine\executionenv.cxx,420)     TSManager         1/29/2013 6:41:40 AM         1532 (0x05FC)
Failed to persist execution state. Error 0x(80070057)       TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)
Failed to save execution state and environment to local hard disk             TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)
Reboot to local harddisk               TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)
FALSE, HRESULT=80004005 (e:\nts_sms_fre\sms\client\tasksequence\executionengine\engine.cxx,584)                TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)
The task sequence execution engine can not reboot the machine because we failed to persist execution environment     TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)
CheckForRebootRequest(&bRebootInitiated), HRESULT=80004005 (e:\nts_sms_fre\sms\client\tasksequence\executionengine\engine.cxx,274)   TSManager         1/29/2013 6:41:40 AM                1532 (0x05FC)
Fatal error is returned in check for reboot request of the action (Restart computer). 
Unspecified error (Error: 80004005; Source: Windows)   TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)
An error (0x80004005) is encountered in execution of the task sequence              TSManager         1/29/2013 6:41:40 AM                1532 (0x05FC)
Sending status message . . .        TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)
Executing in non SMS standalone mode. Ignoring send a task execution status message request               TSManager                1/29/2013 6:41:40 AM    1532 (0x05FC)
m_TSEngine.Execute(& m_eExecutionResult), HRESULT=80004005 (e:\nts_sms_fre\sms\client\tasksequence\tsmanager\tsmanager.cpp,763)       TSManager         1/29/2013 6:41:40 AM                1532 (0x05FC)
Task Sequence Engine failed! Code: 80004005    TSManager         1/29/2013 6:41:40 AM    1532 (0x05FC)

The important line here is when we see: “Failed to save the current environment block.” MDT uses the SMS Stand Alone Task Sequencer, and it must save it’s state, including environment variables and other instruction pointer steps to the hard disk before it can reboot so it can continue where it left off.

For whatever reason, the SMS Stand Alone Task Sequencer (SMSTS) can’t save to the local disk, perhaps it’s having trouble trying to enumerate through the uEFI GPT Partitioning structure.

Resolution

Upon further review we can see that for most of these machines the problem is occurring during the WinPE Phase, and the WinPE version is 7600, meaning that it was created from the WAIK. Normally this would be OK, as MDT 2012 and the WAIK have been tested with uEFI, however there is this one note in the MDT 2012 Update 1 “Release Notes” that should be taken into account:
• 64-bit versions of Windows are unable to deploy to computers with Unified Extensible Firmware Interface (UEFI) 2.3.1, because the Windows AIK is being used to perform the deployment. The Windows ADK is required when deploying Windows to a computer with UEFI 2.3.1.

It appears that the ADK is required for deployment to uEFI machines, at least with uEFI 2.3.1, which is most modern Windows 8 class machines. So the resolution is to upgrade to ADK on your build machine to see if the problem goes away.

Advertisements

5 thoughts on “Failed to save the current environment block

    • I am running into the same issue just now. I cannot image new machines we just got. All drivers seem to be in order. I can see the main drive in WINpe with disk part. Win PE version 6.3.900

      • Verify that you booted into uEFI by checking the bdd.log file, it should contain the line “Property isUEFI is now = True”. Additionally, you should not be installing Windows 7. Only Windows 8.1 or newer. If you still have problems, file a case with Microsoft Support.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s