Answered by:
10074 Sysprep: "A fatal error occurred when trying to sysprep the machine."

Question
-
We were excited to see a new Enterprise ISO for Windows 10 show up yesterday with Build 10074. Putting it through the normal install, sysprep, and capture process we use to build WIM files, it seems like Sysprep may be broken in this build.
If I install Build 10074 Enterprise 64-bit on a vanilla virtual machine and go through setup accepting default prompts, then launch an elevated command prompt and issue a sysprep /generalize /oobe, I get the following error: "A fatal error occurred when trying to sysprep the machine." Here's how the setuperr.log file looks:
2015-04-30 17:14:22, Error SYSPRP setupdigetclassdevs failed with error 0
2015-04-30 17:15:03, Error SYSPRP Encountered error 0x80070020 while deleting contents of package repository. Another process, likely Windows Installer service, is accessing the files inside 'C:\ProgramData\Microsoft\Windows\AppRepository'. Try stopping the Windows Installer service and ensure that no other process is accessing files inside this directory before retrying[gle=0x00000012]
2015-04-30 17:15:03, Error SYSPRP Failed while deleting repository files under 'C:\ProgramData\Microsoft\Windows\AppRepository': 0x80070020.[gle=0x00000012]
2015-04-30 17:15:03, Error SYSPRP Failed to clean the package repository database: 0x80070020.
2015-04-30 17:15:03, Error [0x0f0082] SYSPRP ActionPlatform::LaunchModule: Failure occurred while executing 'SysprepGeneralize' from C:\Windows\System32\AppxSysprep.dll; dwRet = 0x20
2015-04-30 17:15:03, Error SYSPRP ActionPlatform::ExecuteAction: Error in executing action; dwRet = 0x20
2015-04-30 17:15:03, Error SYSPRP ActionPlatform::ExecuteActionList: Error in execute actions; dwRet = 0x20
2015-04-30 17:15:03, Error SYSPRP SysprepSession::Execute: Error in executing actions from C:\Windows\System32\Sysprep\ActionFiles\Generalize.xml; dwRet = 0x20
2015-04-30 17:15:03, Error SYSPRP RunPlatformActions:Failed while executing SysprepSession actions; dwRet = 0x20
2015-04-30 17:15:03, Error [0x0f0070] SYSPRP RunExternalDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x20
2015-04-30 17:15:03, Error [0x0f00a8] SYSPRP WinMain:Hit failure while processing sysprep generalize internal providers; hr = 0x80070020
Anybody tried running Sysprep on 10074 yet?
- Edited by Christian Bell at Meijer Monday, May 4, 2015 1:45 PM
Monday, May 4, 2015 1:45 PM
Answers
-
I was getting the same error but was able to track it back to a service called "tiledatamodelsvc". This service seems to be locking onto the "StateRepository"... files in "C:\ProgramData\Microsoft\Windows\AppRepository". If you stop the service before running sysprep, sysprep is able to run.
- Proposed as answer by Jacob.Wilde Wednesday, May 6, 2015 3:09 PM
- Marked as answer by Karen HuModerator Monday, May 11, 2015 9:42 AM
Wednesday, May 6, 2015 1:01 PM
All replies
-
Yes - I can confirm that I get the exact same error. I have not figured out how to fix it yet (or if a fix is even possible), but I'll keep everyone updated if I figure something out.Monday, May 4, 2015 7:39 PM
-
I get that too, clean Win 10 Build 10074 install, my error log looks very similar.Monday, May 4, 2015 10:34 PM
-
Hi,
I noticed the same thing.
I have to use older build 10041 for creating test images because of this :(
Tuesday, May 5, 2015 5:16 AM -
I have the same problem here.Tuesday, May 5, 2015 6:16 AM
-
Same here, it looks like the account sysprep runs under does not have sufficient priviledges to access the path:
'C:\ProgramData\Microsoft\Windows\AppRepository'
Windows Installer was not running on my test machine, so I would guess this is a permissions problem. I'll try messing around with ownership and permissions, maybe you guys can try as well
- Edited by Ralf Gomeringer Tuesday, May 5, 2015 9:38 AM
Tuesday, May 5, 2015 9:37 AM -
I found out the same thing as you. That Sysprep don't have permission to delete the StateRepository files in \AppRepository. It seems to be able to delete all the Microsoft* files in the folder. But not the StateRepository* files.
I booted the PC back into WinPE and deleted all files in \AppRepository before booting back into Windows and running Sysprep. This worked. I not sure if this causes any problems at a later stage though.
But when deploying the image that I created after running Sysprep into Audit Mode, everything look OK. There are also files in the \AppRepository again.
Tuesday, May 5, 2015 10:25 AM -
I'm also getting the same error. My error logs look just like those above.
I've installed onto several different hardware platforms, as well as virtual machines. I've run sysprep as a user that is a local administrator, and I've run it logged in as "the" administrator user. Everything fails with the exact same error.
Tuesday, May 5, 2015 1:24 PM -
Yes - this *seems* to work okay. Once I delete everything from AppRepository, doing a capture task sequence in deployment workbench still fails, but manually sysprepping, using dism in WinPE to capture, and redeploying with a deploy task sequence works fine.
- Edited by Matt Partain Tuesday, May 5, 2015 3:22 PM
- Proposed as answer by hath08 Wednesday, May 6, 2015 12:55 PM
- Unproposed as answer by hath08 Wednesday, May 6, 2015 12:55 PM
Tuesday, May 5, 2015 3:21 PM -
I was getting the same error but was able to track it back to a service called "tiledatamodelsvc". This service seems to be locking onto the "StateRepository"... files in "C:\ProgramData\Microsoft\Windows\AppRepository". If you stop the service before running sysprep, sysprep is able to run.
- Proposed as answer by Jacob.Wilde Wednesday, May 6, 2015 3:09 PM
- Marked as answer by Karen HuModerator Monday, May 11, 2015 9:42 AM
Wednesday, May 6, 2015 1:01 PM -
This worked for me. Thanks hath08!
- Edited by Jacob.Wilde Wednesday, May 6, 2015 3:10 PM
Wednesday, May 6, 2015 3:10 PM -
Worked for me as well. Thx!Wednesday, May 6, 2015 8:54 PM
-
Confirmed here, as well. It looks like that service might have some other issues, too.
Thanks Hath.
Wednesday, May 6, 2015 9:45 PM -
Hath08 You're a god/goddess among men. That did it. Thank you so much!Wednesday, May 20, 2015 12:55 AM
-
Works like a charm. Be advised though if you try to run sysprep first and get the error, stopping the service will not work, you are presented with another fatal error in sysprep.
Also, don't know if it makes a difference, but this time I ran sysprep from Admin command prompt.
EDIT:
Does not matter if running sysprep as Admin or not.
- Edited by Kronical_420 Sunday, May 31, 2015 10:39 PM
Sunday, May 31, 2015 10:35 PM -
Hi, with TP build 10130 I stopped the mentioned service before to run sysprep. However, I got another fatal error, which seems referred to possibility that system has been updated (no fresh install of windows 10), but this is not the truth. Any suggestions?
<![LOG[Return code from command = 0]LOG]!><time="20:39:49.000+000" date="06-30-2015" component="LTISysprep" context="" type="1" thread="" file="LTISysprep">
<![LOG[FAILURE (Err): -2147024894 0x80070002: Test for CloneTag in registry to verify Sysprep completed. - Unable to open registry key "HKEY_LOCAL_MACHINE\System\Setup\CloneTag" for reading.]LOG]!><time="20:39:49.000+000" date="06-30-2015" component="LTISysprep" context="" type="2" thread="" file="LTISysprep">
<![LOG[FAILURE ( 6191 ): Test for CloneTag in registry to verify Sysprep completed. - Unable to open registry key "HKEY_LOCAL_MACHINE\System\Setup\CloneTag" for reading.]LOG]!><time="20:39:49.000+000" date="06-30-2015" component="LTISysprep" context="" type="3" thread="" file="LTISysprep">Tuesday, June 30, 2015 8:51 PM -
You have to stop the service before attempting to run sysprep. If you run sysprep first and get the error, stopping the service is ineffective on subsequent sysprep attempts.
Thursday, July 9, 2015 11:17 PM