-
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 update script exited with non-zero exit status: 259 #22
Comments
There is something strange going on while detecting if the machine completed the reboot (while the updates are installing the machine sometimes restarts multiple times and this provider is not detecting that). You could try with packer 1.2.5 (the restart provider stopped working after this version, but seems to be fixed in the unreleased 1.3.2) and change the winrm service startup to delayed-auto to see if that helps. |
Can you please try again with 0.6.0 and packer 1.2.5? |
Also do not set any options on the provision step, i.e. use: {
"provisioners": [
{
"type": "windows-update"
}
]
} |
Thanks for all the advice and apologies for the delay in getting back to you. Illness and then holiday got in the way. Version 1.2.5 was working without error for about the last 7 build runs but has started to fail with the same error code. I found packer 1.3.2_dev on hashicorp/packer#6733 and tried that. While I don’t get the intermittent exit (1115) errors on 1.3.2 I'm still getting exit 259 on every attempted run. I’ve noted your recommendation to remove the filters and just have the windows update line. So, just trying that and will let you know the outcome. To ensure I'm not the cause here is my provisioners prior to changing the filters.
Which produces build errors like this:
|
Can confirm that updating to 0.6 and using 1.3.2_dev has allowed for my build to complete for the first time today. I'll schedule more builds over the next 24 hours to confirm if the intermittentness of the fault has also gone. Thanks again for the help. |
Having the same issue on Windows Server 2016 using Packer v1.3.4 with windows-update v0.6.1. It's been 24 hours and windows-update is hung on "Waiting for the Windows Modules Installer to exit". Code appears to be waiting on TiWorker.exe to exit even though all updates completed installation. Eventually it failed exactly 24 hours later with "RPC endpoint: Communicator ended with: 259". I was able to reproduce this multiple times.
|
Please try v0.14.0 and let us known how it goes. |
First time using this provider but keep hitting a problem during everybuild.
Any suggestions please? Can see it also disscussed here but I've tried adding a reboot before and after the windows update provisioner. #3
Snipet from my build json file
Everything before this works fine.
{
"type": "windows-restart"
},
{
"type": "windows-update",
"filters": [
"exclude:$.Title -like 'Preview'",
"include:$.Title -like 'Cumulative Update for Windows'",
"include:$.Title -like 'Recommended'",
"include:$.AutoSelectOnWebSites"
]
},
{
"type": "windows-restart"
},
{
"type": "powershell",
"inline": [
"C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeDisks.ps1 -Schedule",
"C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 -Schedule",
"C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\SysprepInstance.ps1 -noshutdown"
]
}
]
20:35:11 ==> amazon-ebs: Uploading the Windows update elevated script...
20:35:14 ==> amazon-ebs: Uploading the Windows update script...
20:35:16 ==> amazon-ebs: Running Windows update...
20:35:18 amazon-ebs: #< CLIXML
20:35:18 amazon-ebs: Pending Reboot detected. Waiting for the Windows Modules Installer to exit...
20:35:33 amazon-ebs: Rebooting...
20:35:33 amazon-ebs: System.Management.Automation.PSCustomObjectSystem.Object1Preparing modules for first use.0-1-1Completed-1 2Preparing modules for first use.0-1-1Completed-1
20:35:33 ==> amazon-ebs: Waiting for machine to restart...
20:35:33 amazon-ebs: A system shutdown is in progress.(1115)
20:36:30 amazon-ebs: EC2AMAZ-8TNC0L4 restarted.
20:36:30 amazon-ebs: #< CLIXML
20:36:30 amazon-ebs: System.Management.Automation.PSCustomObjectSystem.Object1Preparing modules for first use.0-1-1Completed-1
20:36:30 ==> amazon-ebs: Machine successfully restarted, moving on
20:36:30 ==> amazon-ebs: Running Windows update...
20:36:33 amazon-ebs: #< CLIXML
20:36:34 amazon-ebs: Searching for Windows updates...
20:37:04 amazon-ebs: Found Windows update (2018-09-20; 1348.38 MB): 2018-09 Cumulative Update for Windows Server 2016 for x64-based Systems (KB4457127)
20:37:04 amazon-ebs: Found Windows update (2018-10-05; 74.93 MB): Definition Update for Windows Defender Antivirus - KB2267602 (Definition 1.277.663.0)
20:37:04 amazon-ebs: Downloading Windows updates...
20:37:49 amazon-ebs: Installing Windows updates...
21:19:34 amazon-ebs: Pending Reboot detected. Waiting for the Windows Modules Installer to exit...
21:21:45 amazon-ebs: Rebooting...
21:21:45 amazon-ebs: System.Management.Automation.PSCustomObjectSystem.Object1Preparing modules for first use.0-1-1Completed-1 2Preparing modules for first use.0-1-1Completed-1
21:21:45 ==> amazon-ebs: Waiting for machine to restart...
21:21:45 amazon-ebs: A system shutdown is in progress.(1115)
21:23:23 amazon-ebs: EC2AMAZ-8TNC0L4 restarted.
21:23:23 amazon-ebs: #< CLIXML
21:23:23 amazon-ebs: System.Management.Automation.PSCustomObjectSystem.Object1Preparing modules for first use.0-1-1Completed-1
21:23:23 ==> amazon-ebs: Machine successfully restarted, moving on
21:23:23 ==> amazon-ebs: Running Windows update...
21:23:26 amazon-ebs: #< CLIXML
21:23:29 amazon-ebs: Searching for Windows updates...
21:28:23 ==> amazon-ebs: Terminating the source AWS instance...
21:30:10 ==> amazon-ebs: Cleaning up any extra volumes...
21:30:10 ==> amazon-ebs: No volumes to clean up, skipping
21:30:10 ==> amazon-ebs: Deleting temporary security group...
21:30:11 ==> amazon-ebs: Deleting temporary keypair...
21:30:11 Build 'amazon-ebs' errored: Windows update script exited with non-zero exit status: 259
21:30:11
21:30:11 ==> Some builds didn't complete successfully and had errors:
21:30:11 --> amazon-ebs: Windows update script exited with non-zero exit status: 259
21:30:11
21:30:11 ==> Builds finished but no artifacts were created.
The text was updated successfully, but these errors were encountered: