Sunday, August 19, 2018

Windows 10 upgrade from 1709 to 1803 kept failing at 86% no matter what.

Windows 10 upgrade from 1709 to 1803 fails. Maybe other upgrades too? Provisioning may be the reason for the failure. 

Symptoms: Installation stops at 86% no matter what, reverts back to 1709 and gives an Error Code: 0xC1900101-0x4001E  "The installation failed in the SECOND_BOOT phase with an error during PRE_OOBE operation"

Since April 2018, My Windows 10 has been trying to update itself to version 1803 and every single time the update has failed. So it took several months to succeed, but finally today (2018-8-19) I got my Windows updated to 1803 and no clean install was needed. All my software and app's are still in place. That was the main reason to keep trying, installing all the app´s again was not an option. 

When automatic update fails, there are some alternative solutions. Lots of articles suggest removing 3'rd party antivirus software, external devices etc. Some sites suggest disabling Intel virtualization etc. but according to my experience it's nonsense. After trying all that and a lot more, I also chose to update my motherboards and SSD's firmware as suggested in some sources. That obviously solved nothing either. 

When automatic update had failed several times, it was time to try Windows Update Assistant. It may have solved some cases, but not this one. After that, I took some time using Media Creation tool to create DVD for installation. As expected, it failed too. Then I used it to create bootable USB and tried updating from it. Same crash happened again. 

At this point I figured out that I need to find out the real reason behind the problem. By googling around, I figured out that there is no definitive answer for the error code given by Windows. Finally I found out that there are hidden logs created during the update process, telling the real reason for crash. They are the only way to figure out what really caused the crash. 

The answer lies within "setuperr" -logfile which Microsoft places into hidden folder structure just to make things a bit more complicated. File "setuperr" can usually be found from folder: "C:\$Windows.~BT\source\panther\". Should it not be readable over there (user rights), you can copy it to alternative location and read using notepad etc. 


ERROR:

In my case the fatal error was found at last line of "setuperr" - logfile:
2018-08-18 15:45:16, FatalError [0x090001] PANTHR Exception (code 0xC0000005: ACCESS_VIOLATION) occurred at 0x00007FFF80CF494B in C:\Windows\System32\provengine.dll (+000000000000494B). 
Minidump attached (99815 bytes) to diagerr.xml and C:\Windows\Panther\mnd68D9.diagerr.mdmp.

At this point I started googling around about Provengine and figured out that it's related to Windows 10 Provisioning packages which are located at C:\Windows\Provisioning -folder and registry tree HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning. As I have installed my Windows 10 from the scratch couple of years ago, I should have only Microsoft's default packages, so it seemed that something (Microsoft probably) has messed my registry settings. 

Having a Windows 10 as virtual machine also, I was able to compare the folder structures both in registry and C:\Windows\Provisioning and figured out that there are some differences in the registry tree though there should not be, so I decided to try to replace "Proviosioning" tree by copying it from my virtual machine. At this point I also found out that someone else had tried this too, so I decided to give it a go. 

Edit (2018-8-20): I've checked also Windows Home versions registry and Provisioning tree is very similar in both so I've added both Pro and Home registry into this document in case you have no access to suitable 1709 version. 

SOLUTION  (Or how I finally got my Windows Updated to 1803)

NOTE! Actions suggested here require using registry editor (regedit)! If you don't understand what you are doing, don't do it and stay with 1709 version or ask some technical person to help you! Make sure your problem is also with provengine.dll, otherwise you'll just probably damage your Windows even more! Try this at your own risk. I can't quarantee this will work with your system! Be careful! Do not mess around registry elsewhere but under KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning


STEPS:

YOU NEED WORKING REGISTRY BRANCH, GET ONE FROM ANOTHER PC WITH WINDOWS 1709 INSTALLED OR DOWNLOAD ONE I'VE CREATED

1) Export registry tree KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning 
Select "Provisioning" and right click "Export"... and save file as "provisioning.reg"

Edit (2018-8-20): I've created registry entries for both Windows 10 Pro and Windows 10 Home in case you have no Windows v. 1709 available. There seem to be only minor differences in these files. Both files are in txt -format, so you need to rename one before you can import. I used the Pro version to fix my registry. I can't guarantee these will work for you!

ON A MACHINE WHERE UPDATE FAILS

Importing registry may be a bit harder. I deleted all the old keys (under Provisioning naturally) first as there were some extra branches under provisioning which did not exist in my virtual Windows. Anyway, removing them required that I took the ownership of keys first as I'm not usually running my system as an Administrator. After that you may proceed:

2) Make backup of your "KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning" 
just in case all fails and you need to get them back (don't know why though). If you are still reading this, there's a big change they're corrupted anyway so... 


REMOVE SUBKEYS UNDER: KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning

3) You need to start regedit as Administrator or as with SYSTEM account.
4) Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Provisioning
5) Delete everything inside Provisioning (See how to take ownership if needed)
6) Using regedit.exe as administrator to Import Provisioning registry settings (provisioning.reg) you created at the other machine. 
7) If there are differences between files in subfolders of C:\Windows\Provisioning you may copy files to there also from another PC.

Note: I renamed the folder "C:\Windows\Provisioning" to "Provisioning.old" before copying. As I have a Virtual Machine with identical setup, I was able to copy the folder incredients from there. When comparing data though it seemed identical so I guess that fixing registry was/is enough. 

That's it. Now you can retry update again and it should go pass 86% and Windows 1803 should work after installation is completed. 

Btw: If you renamed old Provisioning -> Provisioning.old like I did:

To clean up "provisioning.old", you may need to use CMD (Execute it as Administrator) and take the ownership of incredients:

takeown /f "C:\Windows\Provisioning.old"​
takeown /f "C:\Windows\Provisioning.old\Packages"
icacls "C:\Windows\Provisioning.old\Packages" /grant Admin:F
cd Packages
del *.*
rmdir Packages
takeown /f "C:\WINDOWS\Provisioning.old\Cosa\"
takeown /f "C:\WINDOWS\Provisioning.old\Cosa\Microsoft"
icacls "C:\WINDOWS\Provisioning.old\Cosa\Microsoft\Microsoft.Windows.Cosa.Desktop.Client.ppkg" /grant Admin:F
etc...


Great thanks to Microsoft for making our lives so hard! I wonder how many people will end up doing clean install or buying new PC after all the frustration with 1803 update.  

P.S. If you don't have another Windows machine where you could copy the registry settings for Provisioning, you may consider creating a virtual Windows 10 machine using for example VmWare workstation player.  https://www.vmware.com/products/workstation-player.html.

37 comments:

  1. Wow, man! Thank you a lot! You made our day... That's really working solution. May be the one through the internet.

    ReplyDelete
    Replies
    1. Thank you for sharing it here.

      Delete
    2. This comment has been removed by a blog administrator.

      Delete
    3. Looks like some malware link and bot army has attacked your blog...

      Delete
    4. Oh, by the way, I've made a powershell script for use in a domain environment. I can upload it here (script + reg file) if you need.

      Delete
  2. Thank you for sharing this. It really works!!

    ReplyDelete
  3. Incredible man, where´s the donation button ? After 6 months looking for a solution (mostly on official MS sites) you saved my life )) ! Hopefully the 1809 update works flawlessly ! THANK YOU SO MUCH !!!

    ReplyDelete
  4. Thank you for your feedback. It's great to hear that this information has been helpful and certainly this link and information can be shared. I'm afraid that most people running into this problem eventually ended up doing clean install or taking their machines into expensive maintenance for clean install. I hope Microsoft has fixed this issue in their next major update, but looking news about their growing problems with these updates I would not expect too much.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. If thy wouldn´t stop the support after 2 cycles I´d just stay with it but... that´s MS (

      Delete
  5. Obviously this is the TRUE solution, I must say, It really works! I started trying to upgrade my system verison from 1703 to 1809 since 10/12, but after 1709, it got stuck. I tried nearly all methods, and the same failure made me crazy. I read the docs on MS website of ERROR CODES and analysed my error logs but the PRE_OOBE problem shows to another log file which says "windeploy.exe" got wrong>_<. I alse read the other's report and MS's replies, but there were all bullshits... Fortunately, there was a message guided me to this blog. I downloaded a new 1709 Pro ISO and installed it on VMware, copied files and exported .reg to my PC, and upgrade 1809 sucessful! Your blog prevent me from formatting and reinstall plenty of applications! If possible, I'll try to translate your blog on Chinese websites to help more people in trouble.

    ReplyDelete
  6. THANK YOU!
    I have a PC that couldn't be upgraded since 1803, and it took 2 hours to boot every f***in time it tried - and failed - to upgrade.
    I thought 1809 will solve the problem, but it didn't.

    Your solution finally worked!
    You Sir, deserve a medal or something :D

    ReplyDelete
  7. I can't delete all of the subkeys, I have tried the take ownership but with no succes.
    Does anyone what is going wrong.

    ReplyDelete
    Replies
    1. Did you start regedit as administrator? https://winaero.com/blog/run-apps-administrator-windows-10/

      Delete
    2. If you haven't gotten it yet, I had to set ownership to my name in particular, not just all administrators.

      Delete
  8. Hello, thanks a lot!
    it really helped, me, after 6 months+ of searching... finally something that worked.

    1) I had to take only the registry step
    2) files were not needed to modify
    3) some reg. keys couldn't be deleted inside Provisioning, so had to take ownership of them (as said here).

    So, thumbs up for this solution and thanks again!! :D

    ReplyDelete
  9. Hey! I wanted to drop a line to say thank you so much for this tip. I'm pretty savvy generally but had been trying to upgrade from v1709 -- since April -- to no avail. The final magic combination was 1) removing my PCI-E graphics card, which finally gave me the error which brought me to your site and 2) your approach which helped me fix that error.

    Hugely grateful for this contribution. Thanks for putting it out there!

    ReplyDelete
  10. This comment has been removed by a blog administrator.

    ReplyDelete
  11. Holy freaking crap, thank you SO MUCH!! I have been at my wits' end trying to fix this issue on my computer. I seriously tried every single thing that was suggested on the Microsoft forums and official replies, as well as other forums and blogs. It was at the point where I ran a cmd line as soon as I booted up to shut off Windows Update so it wouldn't try to download the stupid update.

    I was almost resigned to a full refresh. I had backed up my hard drive and was just gathering my willpower to take the plunge. But I tried one last thing, got one last error message, did one last search, and found this entry. I checked the log you pointed out and I had the exact same error. Finally! A real answer!

    It was my first time doing a real registry edit so I managed to screw it up a bit, but I had a bootable backup of 1709 on a USB drive for just such an occasion. It all worked out, my computer is finally updated without losing any files or programs, and now I know where to look for error logs if it starts doing it again. Thank you once more, deeply and sincerely.

    ReplyDelete
  12. Very good! This is the right solution!
    And now for out german people.

    Funktioniert perfekt... auch müssen nicht alle Schlüssel in der Registry gelöscht werden. Einfach die neue importieren und fertig. Danke nochmal für die Lösung!

    ReplyDelete
  13. The OP deserves a medal for this! I tried and failed the 1803 update 10+ times (not to mention 7 months worth of failed automatic updates) and using your directions I was now able to get to version 1809! Thanks so much for posting these directions, before that I had no idea what to try next!

    Oh one thing.. same as someone else here I was not able to delete all subkeys inspite being logged in as admin. So I just deleted what I could and then imported. Don't know if that was a clever thing to do but for now everything is running just perfect!

    Kiitos tuhannesti avusta Jukka! Mulla oli täysin jo hitsannut kiinni tämän ongelman kanssa... :)

    ReplyDelete
  14. Thankyou for posting this. After solving earlier issues by uninstalling developer mode, I came across these issues.

    Like the others commenting here I had spent a couple of days trying everything on MSFT and other blogs, including remote desktop support from MSFT before coming across this one.

    SUCCESS.

    A couple of notes:
    I was not able to delete all subkeys (some were locked) but deleted and replaced everything I could.
    I skipped step 7 (copying Provisioning folder from another PC).

    THANKYOU. You just saved me another couple of days of restoring my setup were I forced to do a clean install.

    ReplyDelete
  15. THANK YOU big time. I was not able to delete all registry keys neither. I was experienceing two different error Codes while updates from 1709 to 1803 and my setuperr.log didnt show anything about provisioning errors. Since I had two different error codes, I thought i would give it a try - and it worked. THANKS A LOT. (I would provide the different error codes but my list is empty :-()

    ReplyDelete
  16. This really works! It's been almost a year before I could install this stupid update. Microsoft support clueless as ever! But you took the problem out in one shot. Thanks!

    ReplyDelete
  17. After 12 month trying all i can read on the net without success your solution work !!

    ReplyDelete
  18. Amazing! It took me more than one week to figure out what was wrong. This update has been driving me crazy

    ReplyDelete
  19. Great bit of investigative work! Thanks, this fixes the upgrade issue.

    ReplyDelete
  20. Thank you so very much! It worked, after trying all the regular solutions. You rock!

    ReplyDelete
  21. This comment has been removed by a blog administrator.

    ReplyDelete
  22. Thanks Jukka, I had almost given up on updating my windows to anything beyond 1709. I only needed the registry change and nothing else. It is beyond me why MS cannot handle this. After trying a lot of different things last summer, I gave up but when 1809 came along the WU hide/show no longer worked, it wanted to update to one or the other version and started to annoy me again. So after a while I found your solution. A heartfelt thanks from across the pond (Sweden).

    ReplyDelete
  23. thx thx thx thx!!!!!! I had spent weeks looking for a solution.. i was thinking about purchasing an imac... and i got into this blog!!

    It worked like a charm. Mi dell xps 8300 that was a beast 8 year ago still works, and now will work for more time because of your post.

    Thx thx thx!!!

    ReplyDelete
  24. This comment has been removed by a blog administrator.

    ReplyDelete

Note: Only a member of this blog may post a comment.

Testing private Methods in C#

Testing private methods in a C# can be a bit challenging. This is just to remember what's needed. [TestClass] private MyUnit _myUni...