packer-plugin-windows-update icon indicating copy to clipboard operation
packer-plugin-windows-update copied to clipboard

Provisioner hangs on Waiting for the Windows Modules Installer to exit on Windows Server 2019

Open Peter1295 opened this issue 3 years ago • 7 comments

Hello,

I face occasionally with an issue that Windows Update hangs on the Waiting for the Windows Modules Installer to exit... , where provisioner waits when TiWorker.exe process shut down. I was waiting even 3 hours with no luck. It happens on multiple different versions of packer and provisioner, I also tried multiple Windows Server 2019 1809 iso. If I manually shut down that process, provisioner continue and whole packer job finish successfuly. I'm monthly recreating 4 VMs on different environments, what are just applying WU and then converts to VMWare templates. They use the same Packer and WU Provisioner version, same Windows iso, very similar configuration (difference in NIC and HDD) but sometimes one hang, other works fine. Then next month, VM what had a problem finish smoothly. Same happened to me just yesterday with Packer 1.7.2 and Windows Update Provisioner 0.7.0 that on the 1st attempt it hanged, on 2nd worked smoothly. In the past it failed on Packer 1.6.5 and Provisioner 0.10.1 but also other versions.

I can see there are already existing same issues from the past, but none of them looks like were closed and bug solved. Maybe would be good idea to implement feature to not only wait until TiWorker.exe shut down, but add timer/counter, what will force shut down that process after some time or X attemnts.

Peter1295 avatar Apr 29 '21 14:04 Peter1295

I have this issue on 2012 and the vSphere-iso builder. I was digging into the windows-update.ps1 file to see where I could build a timeout, but I haven't had the time to dig into it yet. I think a reasonable timeout is great, or another check on TiWorker.exe, because when mine hangs, I cannot find a tiworker.exe process running. It is almost like the check itself is broken, not TiWorker.exe hanging.

tvories avatar May 07 '21 15:05 tvories

I'm having the same problem with Windows 10 20H2. TiWorker.exe isn't running on the box yet "Waiting for the Windows Modules Installer to exit..." just loops.

JordanMalcolmUK avatar May 14 '21 17:05 JordanMalcolmUK

Having this issue on Windows Server 2016 on Cumulative updates. TiWorker.exe never exits so Packer thinks it's still updating while the host is waiting to reboot and install the Cumulative update.

shotah avatar May 27 '21 01:05 shotah

We tried Windows updates in two vms at the same time side by side, one is windows 10 20h2-evd, and the other is windows server 2019 and they both had this infinite loop "Waiting for the Windows Modules Installer to exit..."

feiyushi avatar Jun 24 '21 20:06 feiyushi

Fun fact. From the creation of this issue I didn't face it... 4 scheduled packer jobs monthly and it works. I did absolutely no changes and didn't even change WIN iso. It is really strange.

Peter1295 avatar Jun 25 '21 07:06 Peter1295

We tried Windows updates in two vms at the same time side by side, one is windows 10 20h2-evd, and the other is windows server 2019 and they both had this infinite loop "Waiting for the Windows Modules Installer to exit..."

We use v0.9.0. I think there's an improvement included in v0.10.0 fixing #61. I'll try more in that version.

feiyushi avatar Jun 25 '21 07:06 feiyushi

We tried Windows updates in two vms at the same time side by side, one is windows 10 20h2-evd, and the other is windows server 2019 and they both had this infinite loop "Waiting for the Windows Modules Installer to exit..."

We use v0.9.0. I think there's an improvement included in v0.10.0 fixing #61. I'll try more in that version.

v0.10.0 should fix this.

feiyushi avatar Jul 31 '21 21:07 feiyushi