Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The iso_checksum_url and iso_urls generates "no checksum found" error in latest packer #8774

Closed
ruzickap opened this issue Feb 20, 2020 · 7 comments
Assignees
Labels
bug core Core components of Packer
Milestone

Comments

@ruzickap
Copy link
Contributor

Overview of the Issue

I'm getting no checksum found error when using proper values in iso_checksum_url and iso_urls generates

Reproduction Steps

...
  "builders": [
    {
      "iso_checksum_type": "sha256",
      "iso_checksum_url": "http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/SHA256SUMS",
      "iso_urls": "http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/netboot/mini.iso",
...

Packer version

$ packer version
Packer v1.5.4

Simplified Packer Buildfile

{
  "builders": [
    {
      "vm_name": "test",
      "type": "qemu",
      "ssh_username": "root",
      "iso_checksum_type": "sha256",
      "iso_checksum_url": "http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/SHA256SUMS",
      "iso_urls": "http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/netboot/mini.iso"
    }
  ]
}

Operating system and Environment details

Fedora 31

Log Fragments and crash.log files

$ PACKER_LOG=1 packer validate bug.json
2020/02/20 13:50:32 [INFO] Packer version: 1.5.4 [go1.13.7 linux amd64]
2020/02/20 13:50:32 Checking 'PACKER_CONFIG' for a config file path
2020/02/20 13:50:32 'PACKER_CONFIG' not set; checking the default config file path
2020/02/20 13:50:32 Attempting to open config file: /home/pruzicka/.packerconfig
2020/02/20 13:50:32 [WARN] Config file doesn't exist: /home/pruzicka/.packerconfig
2020/02/20 13:50:32 Setting cache directory: /home/pruzicka/git/packer-templates/packer_cache
2020/02/20 13:50:32 Creating plugin client for path: /usr/local/bin/packer
2020/02/20 13:50:32 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-builder-qemu"}
2020/02/20 13:50:32 Waiting for RPC address for: /usr/local/bin/packer
2020/02/20 13:50:32 packer-builder-qemu plugin: [INFO] Packer version: 1.5.4 [go1.13.7 linux amd64]
2020/02/20 13:50:32 packer-builder-qemu plugin: Checking 'PACKER_CONFIG' for a config file path
2020/02/20 13:50:32 packer-builder-qemu plugin: 'PACKER_CONFIG' not set; checking the default config file path
2020/02/20 13:50:32 packer-builder-qemu plugin: Attempting to open config file: /home/pruzicka/.packerconfig
2020/02/20 13:50:32 packer-builder-qemu plugin: [WARN] Config file doesn't exist: /home/pruzicka/.packerconfig
2020/02/20 13:50:32 packer-builder-qemu plugin: Setting cache directory: /home/pruzicka/git/packer-templates/packer_cache
2020/02/20 13:50:32 packer-builder-qemu plugin: args: []string{"packer-builder-qemu"}
2020/02/20 13:50:32 packer-builder-qemu plugin: Plugin address: unix /tmp/packer-plugin872047162
2020/02/20 13:50:32 packer-builder-qemu plugin: Waiting for connection...
2020/02/20 13:50:32 Received unix RPC address for /usr/local/bin/packer: addr is /tmp/packer-plugin872047162
2020/02/20 13:50:32 packer-builder-qemu plugin: Serving a plugin connection...
2020/02/20 13:50:32 Preparing build: qemu
2020/02/20 13:50:32 packer-builder-qemu plugin: use detected accelerator: kvm
2020/02/20 13:50:32 packer-builder-qemu plugin: MemorySize 0 is too small, using default: 512
2020/02/20 13:50:32 packer-builder-qemu plugin: CpuCount 0 too small, using default: 1
2020/02/20 13:50:33 Build 'qemu' prepare failure: 1 error(s) occurred:

* Couldn't extract checksum from checksum file: no checksum found in: http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/SHA256SUMS

* Couldn't extract checksum from checksum file: no checksum found in: http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/SHA256SUMS
2020/02/20 13:50:33 [INFO] (telemetry) Finalizing.
Template validation failed. Errors are shown below.

Errors validating build 'qemu'. 1 error(s) occurred:

* Couldn't extract checksum from checksum file: no checksum found in: http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/SHA256SUMS
2020/02/20 13:50:33 waiting for all plugin processes to complete...
2020/02/20 13:50:33 /usr/local/bin/packer: plugin process exited

When I use packer 1.5.1 everything is working fine:

$ PACKER_LOG=1 /tmp/packer validate bug.json
2020/02/20 13:55:40 [INFO] Packer version: 1.5.1 [go1.13.5 linux amd64]
2020/02/20 13:55:40 Attempting to open config file: /home/pruzicka/.packerconfig
2020/02/20 13:55:40 [WARN] Config file doesn't exist: /home/pruzicka/.packerconfig
2020/02/20 13:55:40 Setting cache directory: /home/pruzicka/git/packer-templates/packer_cache
2020/02/20 13:55:40 Plugin could not be found at /tmp/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-qemu (exec: "/tmp/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-qemu": stat /tmp/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-qemu: no such file or directory). Checking same directory as executable.
2020/02/20 13:55:40 Current exe path: /tmp/packer
2020/02/20 13:55:40 Creating plugin client for path: /tmp/packer
2020/02/20 13:55:40 Starting plugin: /tmp/packer []string{"/tmp/packer", "plugin", "packer-builder-qemu"}
2020/02/20 13:55:40 Waiting for RPC address for: /tmp/packer
2020/02/20 13:55:40 packer-builder-qemu plugin: [INFO] Packer version: 1.5.1 [go1.13.5 linux amd64]
2020/02/20 13:55:40 packer-builder-qemu plugin: Attempting to open config file: /home/pruzicka/.packerconfig
2020/02/20 13:55:40 packer-builder-qemu plugin: [WARN] Config file doesn't exist: /home/pruzicka/.packerconfig
2020/02/20 13:55:40 packer-builder-qemu plugin: Setting cache directory: /home/pruzicka/git/packer-templates/packer_cache
2020/02/20 13:55:40 packer-builder-qemu plugin: args: []string{"packer-builder-qemu"}
2020/02/20 13:55:40 packer-builder-qemu plugin: Plugin address: unix /tmp/packer-plugin603693202
2020/02/20 13:55:40 packer-builder-qemu plugin: Waiting for connection...
2020/02/20 13:55:40 Received unix RPC address for /tmp/packer: addr is /tmp/packer-plugin603693202
2020/02/20 13:55:40 packer-builder-qemu plugin: Serving a plugin connection...
2020/02/20 13:55:40 Preparing build: qemu
2020/02/20 13:55:40 packer-builder-qemu plugin: use detected accelerator: kvm
2020/02/20 13:55:40 packer-builder-qemu plugin: MemorySize 0 is too small, using default: 512
2020/02/20 13:55:40 packer-builder-qemu plugin: CpuCount 0 too small, using default: 1
2020/02/20 13:55:40 [INFO] (telemetry) Finalizing.
Template validated successfully.
2020/02/20 13:55:41 waiting for all plugin processes to complete...
2020/02/20 13:55:41 /tmp/packer: plugin process exited
@ruzickap ruzickap added the bug label Feb 20, 2020
@sylviamoss sylviamoss added the core Core components of Packer label Feb 20, 2020
@azr
Copy link
Contributor

azr commented Feb 21, 2020

@ruzickap, thanks for opening, and sorry to hear that, what happens if you remove the iso_checksum_type part ?

@ruzickap
Copy link
Contributor Author

Let me try it using these commands:

cat > bug.json << EOF
{
  "builders": [
    {
      "vm_name": "test",
      "type": "qemu",
      "ssh_username": "root",
      "iso_checksum_url": "http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/SHA256SUMS",
      "iso_urls": "http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/netboot/mini.iso"
    }
  ]
}
EOF

wget https://releases.hashicorp.com/packer/1.5.4/packer_1.5.4_linux_amd64.zip

unzip packer_1.5.4_linux_amd64.zip

./packer validate ./bug.json

Output:

Template validation failed. Errors are shown below.

Errors validating build 'qemu'. 1 error(s) occurred:

* Couldn't extract checksum from checksum file: no checksum found in: http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/SHA256SUMS

When using "older" packer it's fine:

$ packer --version
1.5.1

$ packer validate ./bug.json
Template validated successfully.

@azr
Copy link
Contributor

azr commented Feb 21, 2020

Welp, this sounds like a bug and we will investigate !

@ruzickap
Copy link
Contributor Author

Ok.
Thanks s lot for looking at it...

@sylviamoss
Copy link
Member

Closed by #8897
This will be on 1.5.5 release :)

@ruzickap
Copy link
Contributor Author

ruzickap commented Mar 26, 2020

Hello.

Thanks a lot for fixing it...

It looks like this issue was partially fixed. The example above, when I'm using the iso_checksum_url as https://..., was fixed :-)

But if I use iso_checksum_url pointing to local file as described in the Packer documentation (https://packer.io/docs/builders/qemu.html#iso-configuration) - it is not working:

wget -c http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/SHA256SUMS
cat > bug.json << EOF
{
  "builders": [
    {
      "vm_name": "test",
      "type": "qemu",
      "ssh_username": "root",
      "iso_checksum_url": "./SHA256SUMS",
      "iso_urls": "http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/netboot/mini.iso"
    }
  ]
}
EOF

wget -c https://releases.hashicorp.com/packer/1.5.5/packer_1.5.5_linux_amd64.zip

unzip packer_1.5.5_linux_amd64.zip

PACKER_LOG=1 ./packer validate ./bug.json

The error output:

...
2020/03/27 09:50:34 Received unix RPC address for /tmp/a/packer: addr is /tmp/packer-plugin997301603
2020/03/27 09:50:34 packer-builder-qemu plugin: Serving a plugin connection...
2020/03/27 09:50:34 Preparing build: qemu
2020/03/27 09:50:34 packer-builder-qemu plugin: use detected accelerator: kvm
2020/03/27 09:50:34 packer-builder-qemu plugin: MemorySize 0 is too small, using default: 512
2020/03/27 09:50:34 packer-builder-qemu plugin: CpuCount 0 too small, using default: 1
Template validation failed. Errors are shown below.
2020/03/27 09:50:34 Build 'qemu' prepare failure: 1 error(s) occurred:

* Couldn't extract checksum from checksum file: Error downloading checksum file: relative paths require a module with a pwd

* Couldn't extract checksum from checksum file: Error downloading checksum file: relative paths require a module with a pwd
2020/03/27 09:50:34 [INFO] (telemetry) Finalizing.

Errors validating build 'qemu'. 1 error(s) occurred:

* Couldn't extract checksum from checksum file: Error downloading checksum file: relative paths require a module with a pwd
2020/03/27 09:50:34 waiting for all plugin processes to complete...
2020/03/27 09:50:34 /tmp/a/packer: plugin process exited

Thanks a lot for your help...

PetrR

@ghost
Copy link

ghost commented Apr 23, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug core Core components of Packer
Projects
None yet
Development

No branches or pull requests

4 participants