hashicorp / hashicorp/packer-plugin-vagrant

vagrant-libvirt post processor: Cannot build vagrant-libvirt box from an another vagrant-libvirt box, unexpected EOF

Open
#25 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
16
Forks
28
PR merge metrics
No merged PRs in 30d

Description

_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

```
packer build -force control-plane-libvirt.json
```

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:

```
2021/07/14 19:16:05 ui: ==> vagrant (vagrant): Creating a dummy Vagrant box to ensure the host system can create one correctly
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: Turning dir into box: /tmp/packer006449265 => /tmp/box-601523484.box
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: Compressing with gzip compression level: -1
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: Skipping directory '/tmp/packer006449265' for box '/tmp/box-601523484.box'
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: Box add: '/tmp/packer006449265/metadata.json' to '/tmp/box-601523484.box'
2021/07/14 19:16:05 ui: ==> vagrant (vagrant): Creating Vagrant box for 'libvirt' provider
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: panic: interface conversion: interface {} is nil, not string
2021/07/14 19:16:05 packer-post-processor-vagrant plugin:
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: goroutine 94 [running]:
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: github.com/hashicorp/packer-plugin-vagrant/post-processor/vagrant.(*LibVirtProvider).Process(0x8e563c0, 0x5e66138, 0xc000048090, 0x5e66180, 0xc0000fe080, 0xc0007aa408, 0x14, 0x0, 0x5, 0x100, ...)
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: /home/circleci/go/pkg/mod/github.com/hashicorp/packer-plugin-vagrant@v1.0.0/post-processor/vagrant/libvirt.go:67 +0x918
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: github.com/hashicorp/packer-plugin-vagrant/post-processor/vagrant.(*PostProcessor).PostProcessProvider(0xc000e3f1e0, 0xc00053c560, 0x7, 0x5e24c90, 0x8e563c0, 0x5e66138, 0xc000048090, 0x5e66180, 0xc0000fe080, 0x0, ...)
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: /home/circleci/go/pkg/mod/github.com/hashicorp/packer-plugin-vagrant@v1.0.0/post-processor/vagrant/post-processor.go:158 +0x831
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: github.com/hashicorp/packer-plugin-vagrant/post-processor/vagrant.(*PostProcessor).PostProcess(0xc000e3f1e0, 0x5e4ce20, 0xc000278100, 0x5e66138, 0xc000048090, 0x5e66180, 0xc0000fe080, 0x5e27cb0, 0x203000, 0x5dbc5c0, ...)
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: /home/circleci/go/pkg/mod/github.com/hashicorp/packer-plugin-vagrant@v1.0.0/post-processor/vagrant/post-processor.go:230 +0x199
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: github.com/hashicorp/packer-plugin-sdk/rpc.(*PostProcessorServer).PostProcess(0xc00011e040, 0x1, 0xc00041a000, 0x0, 0x0)
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: /home/circleci/go/pkg/mod/github.com/hashicorp/packer-plugin-sdk@v0.2.3/rpc/post_processor.go:108 +0x19a
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: reflect.Value.call(0xc000100480, 0xc00000e3a8, 0x13, 0x56cc20d, 0x4, 0xc000041f08, 0x3, 0x3, 0xc00021e140, 0xc000219f68, ...)
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: /usr/local/go/src/reflect/value.go:476 +0x8e7
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: reflect.Value.Call(0xc000100480, 0xc00000e3a8, 0x13, 0xc000219f08, 0x3, 0x3, 0xc00021e140, 0x4aaf820, 0xc0005ae000)
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: /usr/local/go/src/reflect/value.go:337 +0xb9
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: net/rpc.(*service).call(0xc00053e2c0, 0xc0004fe190, 0xc0005ae310, 0xc0005ae320, 0xc00079a200, 0xc00047c160, 0x469d880, 0xc0005ae00c, 0x18a, 0x44d48a0, ...)
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: /usr/local/go/src/net/rpc/server.go:377 +0x189
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: created by net/rpc.(*Server).ServeCodec
2021/07/14 19:16:05 packer-post-processor-vagrant plugin: /usr/local/go/src/net/rpc/server.go:474 +0x44d
2021/07/14 19:16:05 [INFO] (telemetry) ending vagrant
2021/07/14 19:16:05 Deleting original artifact for build 'vagrant'
2021/07/14 19:16:05 /home/vadorovsky/bin/packer: plugin process exited
2021/07/14 19:16:05 ui error: Build 'vagrant' errored after 3 minutes 197 milliseconds: 1 error(s) occurred:
```

crash.log:
https://gist.github.com/vadorovsky/797599ab4c3df4ebce6514a274dd5b6f

Contributor guide

Open the contributing guide

Research direction

Start in post-processor/vagrant/libvirt.go at LibVirtProvider.Process, especially the location reported at line 67, and reproduce with the linked control-plane-libvirt.json using `packer build -force control-plane-libvirt.json`. Done means building a Vagrant box from another vagrant-libvirt box no longer panics with an interface conversion error or unexpected EOF.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.