rgl / packer-plugin-windows-update

Packer plugin for installing Windows updates
Mozilla Public License 2.0
299 stars 71 forks source link

Retry for upload windows-update script #101

Open garimakhulbe02 opened 3 years ago

garimakhulbe02 commented 3 years ago

The packer builds are failing at windows-update script upload.

2021/07/22 13:54:29 machine readable: azure-arm,error []string{"Error uploading file to $env:TEMP\\winrmcp---.tmp: Couldn't create shell: unknown error Post \"https://-------/wsman\": EOF"}
PACKER ERR ==> Builds finished but no artifacts were created.
PACKER OUT --> azure-arm: Error uploading file to $env:TEMP\winrmcp--------.tmp: Couldn't create shell: unknown error Post "https://-------/wsman": EOF
PACKER ERR 2021/07/22 13:54:29 [INFO] (telemetry) Finalizing.

I suspect reason is /tmp script gets deleted during multiple windows restart or updates. Upload does not have retry so it failed after trying once if I understood correctly. Check here - packer-windows-update/provisioner.go.

I saw similar errors for powershell provisioner but it is retryable so it started upload again. This also gets confirm from packer-powershell/provisioner.go, where both upload and run are retryable.

We need to add similar retry for upload in packer-windows-update. What do you think?

rgl commented 3 years ago

I never say windows delete anything from temp before. Did the update plugin do a windows restart before you saw that error?

Having the retry would be welcome indeed 🙂

rgl commented 3 years ago

Please try v0.14.0 and let us known how it goes.