Vsphere-iso buid fails with 404 Not Found

Hi all,

I’m new to packer, but I’m trying to create a debian 10 template using the vsphere-iso builder.

I’m using version 1.8.2. I have the debian iso locally on my host where packer is running. When I try to run the build it fails with the following:

$ ../packer build -var-file variables.json ./debian10_new.json vsphere-iso: output will be in this color.

==> vsphere-iso: Retrieving ISO
==> vsphere-iso: Trying /opt/packer/debian-10/debian.iso
==> vsphere-iso: Trying /opt/packer/debian-10/debian.iso?checksum=sha256%3A7d39e6d9ee2d63e2f93424224596413dc2ff937894c05cfdfdb7a8a50b775bf1
==> vsphere-iso: /opt/packer/debian-10/debian.iso?checksum=sha256%3A7d39e6d9ee2d63e2f93424224596413dc2ff937894c05cfdfdb7a8a50b775bf1 => /opt/packer/debian-10/debian.iso
==> vsphere-iso: Uploading debian.iso to packer_cache/debian.iso
Build ‘vsphere-iso’ errored after 14 seconds 590 milliseconds: 404 Not Found

==> Wait completed after 14 seconds 590 milliseconds

==> Some builds didn’t complete successfully and had errors:
→ vsphere-iso: 404 Not Found

==> Builds finished but no artifacts were created.

This error message is not very useful so I tried to enable logging to see if there is anything more interesting, I have this in the logs:

2022/07/11 18:16:19 Running builder: vsphere-iso 2022/07/11 18:16:19 [INFO] (telemetry) Starting builder vsphere-iso 2022/07/11 18:16:20 ui: ^[[1;32m==> vsphere-iso: Retrieving ISO^[[0m 2022/07/11 18:16:20 ui: ^[[1;32m==> vsphere-iso: Trying /opt/packer/debian-10/debian.iso^[[0m 2022/07/11 18:16:20 packer-builder-vsphere-iso plugin: Acquiring lock for: /opt/packer/debian-10/debian.iso?checksum=sha256%3A7d39e6d9ee2d63e2f93424224596413dc2ff937894c05cfdfdb7a8a50b775bf1 (7028c8342f7e6bbb45ddbebd67853e0594686938.iso.lock) 2022/07/11 18:16:20 ui: ^[[1;32m==> vsphere-iso: Trying /opt/packer/debian-10/debian.iso?checksum=sha256%3A7d39e6d9ee2d63e2f93424224596413dc2ff937894c05cfdfdb7a8a50b775bf1^[[0m 2022/07/11 18:16:22 [ERR] Checkpoint error: Get "https://checkpoint-api.hashicorp.com/v1/check/packer?arch=amd64&os=linux&signature=cdba85af-2fc3-b194-ed4a-bc3e5fde6886&version=1.8.2": context deadline exceeded (Client.Timeout exceeded while awaiting headers) 2022/07/11 18:16:22 packer-builder-vsphere-iso plugin: [ERR] Checkpoint error: Get "https://checkpoint-api.hashicorp.com/v1/check/packer?arch=amd64&os=linux&signature=cdba85af-2fc3-b194-ed4a-bc3e5fde6886&version=1.8.2": context deadline exceeded (Client.Timeout exceeded while awaiting headers) 2022/07/11 18:16:22 packer-provisioner-shell plugin: [ERR] Checkpoint error: Get "https://checkpoint-api.hashicorp.com/v1/check/packer?arch=amd64&os=linux&signature=cdba85af-2fc3-b194-ed4a-bc3e5fde6886&version=1.8.2": context deadline exceeded (Client.Timeout exceeded while awaiting headers) 2022/07/11 18:16:33 ui: ^[[1;32m==> vsphere-iso: /opt/packer/debian-10/debian.iso?checksum=sha256%3A7d39e6d9ee2d63e2f93424224596413dc2ff937894c05cfdfdb7a8a50b775bf1 => /opt/packer/debian-10/debian.iso^[[0m 2022/07/11 18:16:33 packer-builder-vsphere-iso plugin: Leaving retrieve loop for ISO 2022/07/11 18:16:33 packer-builder-vsphere-iso plugin: No CD files specified. CD disk will not be made. 2022/07/11 18:16:33 ui: ^[[1;32m==> vsphere-iso: Uploading debian.iso to packer_cache/debian.iso^[[0m 2022/07/11 18:16:33 [INFO] (telemetry) ending vsphere-iso 2022/07/11 18:16:33 ui error: ^[[1;31mBuild 'vsphere-iso' errored after 14 seconds 590 milliseconds: 404 Not Found^[[0m 2022/07/11 18:16:33 ui: ==> Wait completed after 14 seconds 590 milliseconds 2022/07/11 18:16:33 machine readable: error-count []string{"1"} 2022/07/11 18:16:33 ui error: ==> Some builds didn't complete successfully and had errors: 2022/07/11 18:16:33 machine readable: vsphere-iso,error []string{"404 Not Found"} 2022/07/11 18:16:33 ui error: --> vsphere-iso: 404 Not Found 2022/07/11 18:16:33 ui: ==> Builds finished but no artifacts were created. 2022/07/11 18:16:33 [INFO] (telemetry) Finalizing. 2022/07/11 18:16:35 [WARN] (telemetry) Error finalizing report. This is safe to ignore. Post "https://checkpoint-api.hashicorp.com/v1/telemetry/packer": context deadline exceeded 2022/07/11 18:16:35 waiting for all plugin processes to complete... 2022/07/11 18:16:35 /opt/packer/packer: plugin process exited 2022/07/11 18:16:35 /opt/packer/packer: plugin process exited

I can access the vsphere client directly, but to go to the internet I need a proxy.

In this case the build fails because packer cannot retrieve that file from hashicorp.com? If yes, how can i define a proxy to be used by packer to go to the internet?

If it does not fail because of the retrieval issue, then why? I can see that packer can connect to my vsphere client and the packer_cache is created on the datastore, so packer can access the builder infra.

Any idea what is missing here?

Thx in advance!
ddtf