You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
If a network connection is interrupted during an ISO download (via HTTP/HTTPS) packer doesn't abort, it just sort of hangs indefinitely (from what I could tell, it would hang until the ETA is exhausted).
If a network connection is restored the download doesn't appear to resume either... so it's not retrying.
To simulate this I would start a download, and then stop/restart my VPN. I also tried simulating the issue by replacing the default route with one that would return a 'Destination Net Prohibited' error. There didn't appear to be a difference in either case.
Use Case(s)
If a network issue, or remote server interrupts a download, I'd like to control how quickly packer fails, and moves onto downloading the next ISO. My scripts will then retry the download failures at the end.
In that same vein, it would be nice if packer used a different exit code for ISO download failures, as opposed to always returning 1. For example returning a 5 if the download/checksum fails. That would make it easier to detect download issues, and differentiate them from syntax/build/post-processor errors.... perhaps leaving 1 for when multiple builds are being processed and they fail at different stages.
If your worried about backwards compatibility, this feature could be enabled via a CLI option and/or environment variable, such as -extend-exit-codes or PACKER_EXTEND_CODES ...
Just to clarify, this "timeout" should happen when no data if a download hasn't received any data for X amount of time. It should not be applied as a total time limit...
Also, in a perfect world we could also configure a minimum speed threshold for timeouts... like the 'cURL' options --speed-time and --speed-limit ...
Hi @ladar thanks for opening up this request. The downloading of ISOs is handled by an upstream library hashicorp/go-getter so I have labelled this as an upstream request. I don't know that we will be able to get to this request soon but you are more than welcome to open a PR against go-getter if you would like to work on adding the feature.
Community Note
Description
If a network connection is interrupted during an ISO download (via HTTP/HTTPS)
packer
doesn't abort, it just sort of hangs indefinitely (from what I could tell, it would hang until the ETA is exhausted).If a network connection is restored the download doesn't appear to resume either... so it's not retrying.
To simulate this I would start a download, and then stop/restart my VPN. I also tried simulating the issue by replacing the default route with one that would return a 'Destination Net Prohibited' error. There didn't appear to be a difference in either case.
Use Case(s)
If a network issue, or remote server interrupts a download, I'd like to control how quickly
packer
fails, and moves onto downloading the next ISO. My scripts will then retry the download failures at the end.In that same vein, it would be nice if
packer
used a different exit code for ISO download failures, as opposed to always returning 1. For example returning a 5 if the download/checksum fails. That would make it easier to detect download issues, and differentiate them from syntax/build/post-processor errors.... perhaps leaving1
for when multiple builds are being processed and they fail at different stages.If your worried about backwards compatibility, this feature could be enabled via a CLI option and/or environment variable, such as
-extend-exit-codes
orPACKER_EXTEND_CODES
...Potential configuration
The text was updated successfully, but these errors were encountered: