Overview of the Issue
When I add the hcp_packer_registry
block to my builds block I see that my build instantly fails when reaching the hcp_packer_registry
block. When I do not add the hcp_packer_registry
block I am able to successfully create my Ubuntu image with no issues, I just cant push it to HCP Registry. I have logged into HCP cloud and was able to see that my build is being queued to hcp registry, but always results in failed status because of the issue Im being faced with. All of my parameters from my hcp_packer_registry
block are making being sent to hcp successfully but my image is not for some reason. Ive even tried removing all parameters with the exception of bucket_name
but still results in this block failing 100% of the time on multiple systems. Assistance would be greatly appreciated.
Reproduction Steps
- Add the
HCP_CLIENT_ID
andHCP_CLIENT_SECRET
env vars - Add the
hcp_packer_registry
block to your build block in your hcl2 file - Run
PACKER_LOG=1 packer build ubuntu.pkr.hcl
Packer errors out after post-processors end and returns the error:
==> qemu.ubuntu: Running post-processor:
* Post-processor failed: [TRACE] failed to update Packer registry with image artifacts for "qemu.ubuntu": setting a build to DONE with no published images is not currently supported.
Build 'qemu.ubuntu' errored after 7 minutes 44 seconds: 1 error(s) occurred:
==> Wait completed after 7 minutes 44 seconds
2022/11/26 16:38:51 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2022/11/26 16:38:51 machine readable: qemu.ubuntu,error []string{"1 error(s) occurred:\n\n* Post-processor failed: [TRACE] failed to update Packer registry with image artifacts for \"qemu.ubuntu\": setting a build to DONE with no published images is not currently supported."}
* Post-processor failed: [TRACE] failed to update Packer registry with image artifacts for "qemu.ubuntu": setting a build to DONE with no published images is not currently supported.
==> Builds finished but no artifacts were created.
* Post-processor failed: [TRACE] failed to update Packer registry with image artifacts for "qemu.ubuntu": setting a build to DONE with no published images is not currently supported.
==> Wait completed after 7 minutes 44 seconds
2022/11/26 16:38:51 [INFO] (telemetry) Finalizing.
==> Some builds didn't complete successfully and had errors:
--> qemu.ubuntu: 1 error(s) occurred:
* Post-processor failed: [TRACE] failed to update Packer registry with image artifacts for "qemu.ubuntu": setting a build to DONE with no published images is not currently supported.
==> Builds finished but no artifacts were created.
2022/11/26 16:38:51 waiting for all plugin processes to complete...
2022/11/26 16:38:51 /usr/local/bin/github.com/hashicorp/qemu/packer-plugin-qemu_v1.0.6_x5.0_darwin_amd64: plugin process exited
Packer version
Packer v1.8.4
Simplified Packer Template
packer {
required_plugins {
qemu = {
version = ">= 1.0.6"
source = "github.com/hashicorp/qemu"
}
}
}
source "qemu" "ubuntu" {
accelerator = "tcg"
boot_command = [
"c<wait3s>",
"set gfxpayload=keep<enter>",
"linux /casper/vmlinuz autoinstall \"ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/\" ",
"hostname={{.Name}} boot=casper fsck.mode=skip auto=true noprompt noeject<enter>",
"initrd /casper/initrd<enter>",
"boot<enter>"
]
boot_wait = "10s"
communicator = "ssh"
cpus = var.cpus
disk_size = var.disk_size
format = "qcow2"
headless = true
http_directory = "./cidata"
iso_checksum = var.iso_checksum
iso_url = var.iso_url
memory = var.memory
output_directory = "./build"
skip_compaction = true
shutdown_command = "echo 'ubuntu' | sudo -S -E shutdown -P +1"
ssh_clear_authorized_keys = false
ssh_password = "ubuntu"
ssh_port = 22
ssh_timeout = "4h"
ssh_username = "ubuntu"
vm_name = var.vm_name
}
build {
hcp_packer_registry {
bucket_name = "ubuntu"
description = "ubuntu base image"
bucket_labels = {
"os" = "ubuntu",
"ubuntu-version" = "22.04",
"image" = "ubuntu"
}
build_labels = {
"build-time" = timestamp()
"build-source" = "${var.iso_url}"
}
}
sources = ["source.qemu.ubuntu"]
}
Operating system and Environment details
- x64 - Windows 10 & 11 -
whpx
accelerator - x64 - Mac OS Monteray 12.0.1 -
hvf
accelerator