-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows 2022 - packer-windows-update-elevated.ps1 repeatedly fails #142
Comments
Been having the same issue. Looking for solutions. |
Hi, I am facing a similar issue as well but for a Windows Server 2019 Datacenter VM. We are using Azure Image Builder and running the WindowsUpdate customizer. The packer-windows-update-elevated.ps1 script runs initially and then gives a non zero error. I observed a non zero exit code (101) after which the VM restarts. After the VM is back the same script is run after which I get the following error PACKER 2024/07/18 13:43:29 ui error: ==> azure-arm: The argument 'C:/Windows/Temp/packer-windows-update-elevated.ps1' to the -File parameter does not exist. Provide the path to an existing '.ps1' file as an argument to the -File parameter. |
Hi all, just to report I am seeing the same issue when attempting to use the Packer for Win11 Multi-Session [5c307259-2810-456f-9b21-df1c667950ba] PACKER 2024/07/29 09:55:38 ui: azure-arm: ERROR: at , C:\Windows\Temp\packer-windows-update.ps1: line 190 |
Hi @Raeykall, Can you please share in detail on what the error code is? Maybe paste a bigger section of the customizations log? Maybe we can work together to understand the issue and resolve it. My expertise is based on Azure Image Builder only so I'm not sure to what level I can help but I want to contribute to how much ever I can. :) |
Hi, I have a similar issue with Windows 11 Enterprise Multi-Session using Image Builder... [8a6c2380-c4f9-480c-a69a-9d0bd11f2f17] PACKER 2024/07/31 02:41:02 ui: ==> azure-arm: Running Windows update... |
Any update on this issue from someone? |
Have you tried the options given here: |
Hi @bronandrews, it took me a while to get this fixed, but it seems the provisioner does not work properly if you override the default shell for I've set the default shell to # FIXME: This causes failure with windows-update provisioner, so disabled it!
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force Hope this helps and @rgl requesting your input if this could be valid reason. |
Hi @saily As before, I'm using packer to provision a Hyper-V VM from a Windows2022 ISO image This time I'm using the most recent As before, It does find the Windows updates I've specified (Important only) and looks to successfully install them... (takes about 30 mins)
But still getting the same error, still consistently fails when exiting the installer
and it retries 4 times until.... Any other ideas? |
Hi again @saily I will test changing the default later in the process & revert |
Hi,
I am using this plugin v0.15.0 to install updates during a fresh Windows 2022 build.
I'm including Important updates only, with the following syntax.
It finds new Updates and seems to carry out the install, but consistently fails when trying to exit Windows Modules Installer...
sample output log looks like...
2024/05/09 14:33:10 ui: hyperv-iso.appbase: Waiting for the Windows Modules Installer to exit...
2024/05/09 14:33:56 ui: hyperv-iso.appbase: Waiting for operation to complete (system performance: 4% cpu; 13% memory)...
memory)...
2024/05/09 14:41:05 ui: hyperv-iso.appbase: Waiting for operation to complete (system performance: 1% cpu; 13% memory)...
2024/05/09 14:41:55 packer-plugin-hyperv_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/05/09 14:41:55 [ERROR] Remote command exited with '1': PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-elevated.ps1
2024/05/09 14:41:55 packer-plugin-hyperv_v1.1.3_x5.0_windows_amd64.exe plugin: 2024/05/09 14:41:55 [INFO] RPC endpoint: Communicator ended with: 1
2024/05/09 14:41:55 [INFO] 3047 bytes written for 'stdout'
2024/05/09 14:41:55 [INFO] 0 bytes written for 'stderr'
2024/05/09 14:41:55 [INFO] RPC client: Communicator ended with: 1
2024/05/09 14:41:55 [INFO] RPC endpoint: Communicator ended with: 1
2024/05/09 14:41:55 packer-plugin-windows-update_v0.15.0_x5.0_windows_amd64.exe plugin: 2024/05/09 14:41:55 [INFO] 0 bytes written for 'stderr'
2024/05/09 14:41:55 packer-plugin-windows-update_v0.15.0_x5.0_windows_amd64.exe plugin: 2024/05/09 14:41:55 [INFO] 3047 bytes written for 'stdout'
2024/05/09 14:41:55 packer-plugin-windows-update_v0.15.0_x5.0_windows_amd64.exe plugin: 2024/05/09 14:41:55 [INFO] RPC client: Communicator ended with: 1
2024/05/09 14:41:55 packer-plugin-windows-update_v0.15.0_x5.0_windows_amd64.exe plugin: 2024/05/09 14:41:55 Retryable error: Windows update script exited with non-zero exit status: 1
As its "retryable" - it repeats this 4 more times, until :
retry count exhausted. Last err: Windows update script exited with non-zero exit status
then the packer process exits and server build is removed.
I've tried various things with repeating calls to the provisioner, and the max_retries setting.
When I manually restart the server while this is happening, it seems to break out of the deadlock and the packer process continues.
But that is not realistic when building a stack of new servers.
Any suggestions about how to get over this issue?
Looking back over Open issues, feels like this error has been a problem for a while.....will it be fixed?
Many thanks!
The text was updated successfully, but these errors were encountered: