Packer: `Failed to open file for checksum` on every vmware-iso ISO upload (go-getter issue)

Created on 18 Jun 2020  ·  12Comments  ·  Source: hashicorp/packer

Overview of the Issue

vmware-iso builder uploads ISO everytime.

Reproduction Steps

Standard vmware-iso build

Packer version

1.6.0

Simplified Packer Buildfile

      "iso_url": "http://ftp.heanet.ie/pub/centos/{{user `os_version`}}/isos/x86_64/CentOS-{{user `os_version`}}-x86_64-netinstall.iso",
      "iso_checksum": "sha256:56f7b078a3b443095ba006cdc85319c691251cda98c5d73d12ef6db7aff6b4c1",

FYI I don't think the correct hash is chosen from the asc file if given, when used it seems to use the first one (DVD1), but thats a separate issue.

Operating system and Environment details

Win10 host, ESXi 6.7u3, centos guest.

Log Fragments and crash.log files

2020/06/18 15:18:58 packer_windows_amd64.exe plugin: [DEBUG] starting remote command: mkdir -p "/vmfs/volumes/datastore/packer_cache"
2020/06/18 15:18:58 packer_windows_amd64.exe plugin: Verifying checksum of /vmfs/volumes/datastore/packer_cache/783d75aff46bac5e427882b658299a57cbc26eb1.iso
2020/06/18 15:18:58 packer_windows_amd64.exe plugin: Failed to open file for checksum: open /vmfs/volumes/datastore/packer_cache/783d75aff46bac5e427882b658299a57cbc26eb1.iso: The system cannot find the path specified.

I can see Failed to open file for checksum is from go-getter. I can confirm that the path does exist, and root user has rw access.

bug core regression track-internal

All 12 comments

I can confirm this problem too, even if I set the datastore to the uuid, without using the symbolic link to the default datastore

As a workaround I'm using "iso_checksum": "none", to skip the check.

Hello there, thanks for opening ! Sorry this happened, we need to add more unit testing for that part of the code ! I'm on this issue. 🙂

Hello, just to give an update here, this is not happening on my mac; so I think it's a windows only issue; I'm still on it.

I'm not running Windows but linux, so it may not be a Windows issue :)

Do you have a simplified buildfile I could try on ?

`` { "builders": [ { "boot_command": [ "<up><wait5s><tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{userks_path}}<wait10s><enter><wait>" ], "boot_wait": "20s", "cpus": "{{ usercpus}}", "guest_os_type": "centos-64", "http_directory": "{{userhttp_directory}}", "headless": true, "iso_checksum": "{{ useriso_checksum}}", "iso_url": "{{usermirror}}/{{usermirror_directory}}/{{useriso_name}}", "memory": "{{ usermemory}}", "output_directory": "{{ userbuild_directory}}/packer-{{usertemplate}}-vmware", "shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p", "ssh_password": "vagrant", "ssh_port": 22, "ssh_timeout": "10000s", "ssh_username": "vagrant", "disk_size": "{{userdisk_size}}", "type": "vmware-iso", "skip_validate_credentials": true, "vnc_disable_password": true, "vm_name": "{{ usertemplate}}", "vmx_data": { "cpuid.coresPerSocket": "1" }, "vmx_remove_ethernet_interfaces": true } ], "variables": { "box_basename": "bluemind-centos-8", "build_directory": "builds", "build_timestamp": "{{isotime \"20060102150405\"}}", "cpus": "1", "disk_size": "20000", "git_revision": "__unknown_git_revision__", "guest_additions_url": "", "headless": "", "http_directory": "{{template_dir}}/http", "http_proxy": "{{envhttp_proxy}}", "https_proxy": "{{envhttps_proxy}}", "iso_checksum": "sha256:c87a2d81d67bbaeaf646aea5bedd70990078ec252fc52f5a7d65ff609871e255", "iso_name": "CentOS-8.2.2004-x86_64-dvd1.iso", "ks_path": "ks-8.cfg", "memory": "5000", "mirror": "http://mirrors.kernel.org/centos", "mirror_directory": "8.2.2004/isos/x86_64", "name": "centos-8.2", "no_proxy": "{{envno_proxy`}}",
"template": "centos-8.2-x86_64",
"version": "TIMESTAMP",
"vsphere_host": "192.168.0.223",
"vsphere_password": ":azerty:1!",
"vsphere_user": "root"
}
}

you don't need the provisioning files & so on because with the checksum it will not go that far

Deleted my previous message: I have a repro !

Hello there, I have a fix in #9570, if you scroll down to store_artifacts at the bottom of the PR it links to a circle-ci page that allows to download binaries to try this out. It worked for me -- please tell me if it fixes it for you --.

I'm currently working on adding acceptance testing to prevent regressions.

@azr I've just tried the binary, works for me.

```
2020/07/15 12:17:15 packer_beta plugin: No floppy files specified. Floppy disk will not be made.
2020/07/15 12:17:15 packer_beta plugin: running: c87a2d81d67bbaeaf646aea5bedd70990078ec252fc52f5a7d65ff609871e255 /vmfs/volumes/datastore1/packer_cache/86bcc09c077051f764790d7805b0b17a5648d79c.iso | [sha256sum -c]
2020/07/15 12:17:15 packer_beta plugin: [DEBUG] Opening new ssh session
2020/07/15 12:17:15 packer_beta plugin: [DEBUG] starting remote command: sha256sum -c
==> vmware-iso: Remote cache was verified skipping remote upload...

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings