Open hc-github-team-packer opened 2 years ago
I reproduced the same error !
2 points:
Please note that if you are using the Vagrant builder, then the Vagrant post-processor is unnecessary because the output of the Vagrant builder is already a Vagrant box; using this post-processor with the Vagrant builder will cause your build to fail.
+1
I am running a vagrant-libvirt
post-processor for an azure-arm
source.
source "azure-arm" "win22s" {
// azure settings
}
build {
sources = ["sources.azure-arm.win22s"]
provisioner "file" {
// file provisioners
}
provisioner "powershell" {
// powershell provisioners
}
provisioner "windows-restart" {}
provisioner "powershell" {
// required vm preperation
}
post-processors {
post-processor "vagrant" {
keep_input_artifact = true
provider_override = "libvirt"
}
}
}
Resulting in the following .log
:
==> azure-arm.win22s (vagrant): Creating a dummy Vagrant box to ensure the host system can create one correctly
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: Turning dir into box: /var/folders/vn/7nt3vs6d22bf_53xf12kvllr0000gn/T/packer1148182668 => /var/folders/vn/7nt3vs6d22bf_53xf12kvllr0000gn/T/box-2991777212.box
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: Compressing with gzip compression level: -1
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: Skipping directory '/var/folders/vn/7nt3vs6d22bf_53xf12kvllr0000gn/T/packer1148182668' for box '/var/folders/vn/7nt3vs6d22bf_53xf12kvllr0000gn/T/box-2991777212.box'
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: Box add: '/var/folders/vn/7nt3vs6d22bf_53xf12kvllr0000gn/T/packer1148182668/metadata.json' to '/var/folders/vn/7nt3vs6d22bf_53xf12kvllr0000gn/T/box-2991777212.box'
==> azure-arm.win22s (vagrant): Creating Vagrant box for 'libvirt' provider
Build 'azure-arm.win22s' errored after 20 minutes 43 seconds: 1 error(s) occurred:
* Post-processor failed: unexpected EOF
==> Wait completed after 20 minutes 43 seconds
==> Some builds didn't complete successfully and had errors:
--> azure-arm.win22s: 1 error(s) occurred:
* Post-processor failed: unexpected EOF
==> Builds finished but no artifacts were created.
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: panic: interface conversion: interface {} is nil, not string
2022/04/22 11:46:08 packer-post-processor-vagrant plugin:
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: goroutine 202 [running]:
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: github.com/hashicorp/packer-plugin-vagrant/post-processor/vagrant.(*LibVirtProvider).Process(0x5e655e0, {0x66285d8, 0xc000d8b0b0}, {0x6628620, 0xc0000cb2a0}, {0xc00012afa0, 0x41})
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: /Users/runner/go/pkg/mod/github.com/hashicorp/packer-plugin-vagrant@v1.0.1/post-processor/vagrant/libvirt.go:67 +0x69b
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: github.com/hashicorp/packer-plugin-vagrant/post-processor/vagrant.(*PostProcessor).PostProcessProvider(0x10000c00040e770, {0xc000079a98, 0x28}, {0x65d0bb0, 0x9f6aac0}, {0x66285d8, 0xc000d8b0b0}, {0x6628620, 0xc0000cb2a0})
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: /Users/runner/go/pkg/mod/github.com/hashicorp/packer-plugin-vagrant@v1.0.1/post-processor/vagrant/post-processor.go:158 +0x706
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: github.com/hashicorp/packer-plugin-vagrant/post-processor/vagrant.(*PostProcessor).PostProcess(0xc000b2edc0, {0xc0000780f0, 0x0}, {0x66285d8, 0xc000d8b0b0}, {0x6628620, 0xc0000cb2a0})
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: /Users/runner/go/pkg/mod/github.com/hashicorp/packer-plugin-vagrant@v1.0.1/post-processor/vagrant/post-processor.go:230 +0x49a
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: github.com/hashicorp/packer-plugin-sdk/rpc.(*PostProcessorServer).PostProcess(0xc000d9a040, 0x79c70, 0xc0000df4c0)
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: /Users/runner/go/pkg/mod/github.com/hashicorp/packer-plugin-sdk@v0.2.12-0.20220216103740-f7d4bf877a45/rpc/post_processor.go:108 +0x18c
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: reflect.Value.call({0xc0005b6840, 0xc00000e948, 0x13}, {0x5e612c7, 0x4}, {0xc000791ef8, 0x3, 0x3})
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: /Users/runner/hostedtoolcache/go/1.17.8/x64/src/reflect/value.go:556 +0x845
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: reflect.Value.Call({0xc0005b6840, 0xc00000e948, 0x0}, {0xc000646ef8, 0x3, 0x3})
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: /Users/runner/hostedtoolcache/go/1.17.8/x64/src/reflect/value.go:339 +0xc5
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: net/rpc.(*service).call(0xc000d9a080, 0x0, 0x0, 0xc000079010, 0xc00049e480, 0x0, {0x4df1220, 0xc000079c50, 0x0}, {0x4c2a1a0, ...}, ...)
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: /Users/runner/hostedtoolcache/go/1.17.8/x64/src/net/rpc/server.go:377 +0x239
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: created by net/rpc.(*Server).ServeCodec
2022/04/22 11:46:08 packer-post-processor-vagrant plugin: /Users/runner/hostedtoolcache/go/1.17.8/x64/src/net/rpc/server.go:474 +0x405
2022/04/22 11:46:08 [INFO] (telemetry) ending vagrant
2022/04/22 11:46:08 /usr/local/bin/packer: plugin process exited
2022/04/22 11:46:08 Deleting original artifact for build 'azure-arm.win22s'
* Post-processor failed: unexpected EOF
==> Wait completed after 20 minutes 43 seconds
2022/04/22 11:46:08 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2022/04/22 11:46:08 machine readable: azure-arm.win22s,error []string{"1 error(s) occurred:\n\n* Post-processor failed: unexpected EOF"}
* Post-processor failed: unexpected EOF
==> Builds finished but no artifacts were created.
2022/04/22 11:46:08 [INFO] (telemetry) Finalizing.
2022/04/22 11:46:09 waiting for all plugin processes to complete...
2022/04/22 11:46:09 /usr/local/bin/packer: plugin process exited
2022/04/22 11:46:09 /usr/local/bin/packer: plugin process exited
2022/04/22 11:46:09 /usr/local/bin/packer: plugin process exited
2022/04/22 11:46:09 /usr/local/bin/packer: plugin process exited
2022/04/22 11:46:09 [ERR] Error decoding response stream 19: EOF
2022/04/22 11:46:09 /usr/local/bin/packer: plugin process exited
EDIT:
I have tried to execute this script on MacOS 12.3.1
and on Ubuntu 20.04
both running Packer 1.8.0
.
Same here in 2024, running packer 1.10.1
with vagrant plugins v1.1.2
on Arch.
This issue was originally opened by @vadorovsky in https://github.com/hashicorp/packer/issues/11148 and has been migrated to this repository. The original issue description is below.
Overview of the Issue
I'm trying to build my own vagrant-libvirt box based on this one:
https://app.vagrantup.com/opensuse/boxes/Tumbleweed.x86_64
Here is the buildfile I'm using:
https://github.com/rancher-sandbox/enclave/blob/vagrant-workers/contrib/packer/control-plane-libvirt.json
Reproduction Steps
Do
on the following buildfile: https://github.com/rancher-sandbox/enclave/blob/vagrant-workers/contrib/packer/control-plane-libvirt.json
Packer version
Packer v1.7.3
Simplified Packer Buildfile
https://github.com/rancher-sandbox/enclave/blob/vagrant-workers/contrib/packer/control-plane-libvirt.json
Operating system and Environment details
openSUSE Tumbleweed x86_64 kernel 5.13.0-1-default libvirt 7.5.0
Log Fragments and crash.log files
(Probably) the most important fragment:
crash.log: https://gist.github.com/vadorovsky/797599ab4c3df4ebce6514a274dd5b6f