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

Retry for upload windows-update script

Open garimakhulbe02 opened this issue 4 years ago • 2 comments

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?

garimakhulbe02 avatar Jul 29 '21 05:07 garimakhulbe02

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 avatar Jul 29 '21 06:07 rgl

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

rgl avatar Aug 01 '21 14:08 rgl