Skip to content
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

Add Retry to script upload and update functions #103

Merged
merged 3 commits into from
Aug 1, 2021
Merged

Conversation

feiyushi
Copy link
Contributor

@feiyushi feiyushi commented Jul 31, 2021

This change attempts to address issues seen in #101, #87, #78, #65, #22.

@feiyushi
Copy link
Contributor Author

We are testing the changes and please also review the approach for adding max retries for update function. @rgl

@feiyushi
Copy link
Contributor Author

feiyushi commented Jul 31, 2021

We are testing the changes and please also review the approach for adding max retries for update function. @rgl

A log snippet shows retry on update exit code 16001 works.

PACKER OUT ==> azure-arm: Running Windows update...
PACKER ERR 2021/07/31 21:18:07 packer-builder-azure-arm plugin: [INFO] RPC endpoint: Communicator ended with: 0
PACKER ERR 2021/07/31 21:18:07 [INFO] RPC client: Communicator ended with: 0
PACKER ERR 2021/07/31 21:18:07 [INFO] RPC endpoint: Communicator ended with: 0
PACKER ERR 2021/07/31 21:18:07 packer-provisioner-windows-update plugin: 2021/07/31 21:18:07 [INFO] 28 bytes written for 'stdout'
PACKER ERR 2021/07/31 21:18:07 packer-provisioner-windows-update plugin: 2021/07/31 21:18:07 [INFO] 0 bytes written for 'stderr'
PACKER ERR 2021/07/31 21:18:07 packer-provisioner-windows-update plugin: 2021/07/31 21:18:07 [INFO] RPC client: Communicator ended with: 0
PACKER ERR 2021/07/31 21:18:07 packer-builder-azure-arm plugin: [INFO] starting remote command: PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-elevated.ps1
PACKER OUT     azure-arm: Searching for Windows updates...
PACKER ERR 2021/07/31 21:18:37 packer-builder-azure-arm plugin: [INFO] command 'PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-elevated.ps1' exited with code: 16001
PACKER ERR 2021/07/31 21:18:37 packer-builder-azure-arm plugin: [INFO] RPC endpoint: Communicator ended with: 16001
PACKER ERR 2021/07/31 21:18:37 [INFO] 34 bytes written for 'stdout'
PACKER ERR 2021/07/31 21:18:37 [INFO] 0 bytes written for 'stderr'
PACKER ERR 2021/07/31 21:18:37 [INFO] RPC client: Communicator ended with: 16001
PACKER ERR 2021/07/31 21:18:37 [INFO] RPC endpoint: Communicator ended with: 16001
PACKER ERR 2021/07/31 21:18:37 packer-provisioner-windows-update plugin: 2021/07/31 21:18:37 [INFO] 34 bytes written for 'stdout'
PACKER ERR 2021/07/31 21:18:37 packer-provisioner-windows-update plugin: 2021/07/31 21:18:37 [INFO] 0 bytes written for 'stderr'
PACKER ERR 2021/07/31 21:18:37 packer-provisioner-windows-update plugin: 2021/07/31 21:18:37 [INFO] RPC client: Communicator ended with: 16001
PACKER ERR 2021/07/31 21:18:37 packer-provisioner-windows-update plugin: 2021/07/31 21:18:37 Retryable error: Windows update script exited with non-zero exit status: 16001
PACKER ERR 2021/07/31 21:18:42 packer-builder-azure-arm plugin: [INFO] starting remote command: PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-elevated.ps1
PACKER OUT     azure-arm: Searching for Windows updates...
PACKER ERR 2021/07/31 21:18:57 packer-builder-azure-arm plugin: [INFO] command 'PowerShell -ExecutionPolicy Bypass -OutputFormat Text -File C:/Windows/Temp/packer-windows-update-elevated.ps1' exited with code: 0
PACKER OUT     azure-arm: No Windows updates found
PACKER ERR 2021/07/31 21:18:57 packer-builder-azure-arm plugin: [INFO] RPC endpoint: Communicator ended with: 0
PACKER OUT ==> azure-arm: Provisioning with Powershell...
PACKER ERR 2021/07/31 21:18:57 [INFO] 60 bytes written for 'stdout'
PACKER OUT ==> azure-arm: Provisioning with powershell script: /tmp/powershell-provisioner657462132
PACKER ERR 2021/07/31 21:18:57 [INFO] 0 bytes written for 'stderr'
PACKER ERR 2021/07/31 21:18:57 [INFO] RPC client: Communicator ended with: 0
PACKER ERR 2021/07/31 21:18:57 [INFO] RPC endpoint: Communicator ended with: 0
PACKER ERR 2021/07/31 21:18:57 packer-provisioner-windows-update plugin: 2021/07/31 21:18:57 [INFO] 60 bytes written for 'stdout'
PACKER ERR 2021/07/31 21:18:57 packer-provisioner-windows-update plugin: 2021/07/31 21:18:57 [INFO] 0 bytes written for 'stderr'
PACKER ERR 2021/07/31 21:18:57 packer-provisioner-windows-update plugin: 2021/07/31 21:18:57 [INFO] RPC client: Communicator ended with: 0
PACKER ERR 2021/07/31 21:18:57 [INFO] (telemetry) ending windows-update

@feiyushi feiyushi marked this pull request as ready for review July 31, 2021 21:44
@rgl rgl merged commit 77685b6 into rgl:master Aug 1, 2021
@rgl
Copy link
Owner

rgl commented Aug 1, 2021

@feiyushi feiyushi deleted the retry branch August 1, 2021 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants