2020/02/13 19:38:52 [INFO] Packer version: 1.5.3-dev [go1.13.7 linux amd64]
2020/02/13 19:38:52 Checking 'PACKER_CONFIG' for a config file path
2020/02/13 19:38:52 'PACKER_CONFIG' not set; checking the default config file path
2020/02/13 19:38:52 Attempting to open config file: /home/phaer/.packerconfig
2020/02/13 19:38:52 [WARN] Config file doesn't exist: /home/phaer/.packerconfig
2020/02/13 19:38:52 Setting cache directory: /home/phaer/projects/diebin/cloud/packer/packer_cache
2020/02/13 19:38:52 Creating plugin client for path: /usr/local/bin/packer
2020/02/13 19:38:52 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-builder-proxmox"}
2020/02/13 19:38:52 Waiting for RPC address for: /usr/local/bin/packer
2020/02/13 19:38:52 packer-builder-proxmox plugin: [INFO] Packer version: 1.5.3-dev [go1.13.7 linux amd64]
2020/02/13 19:38:52 packer-builder-proxmox plugin: Checking 'PACKER_CONFIG' for a config file path
2020/02/13 19:38:52 packer-builder-proxmox plugin: 'PACKER_CONFIG' not set; checking the default config file path
2020/02/13 19:38:52 packer-builder-proxmox plugin: Attempting to open config file: /home/phaer/.packerconfig
2020/02/13 19:38:52 packer-builder-proxmox plugin: [WARN] Config file doesn't exist: /home/phaer/.packerconfig
2020/02/13 19:38:52 packer-builder-proxmox plugin: Setting cache directory: /home/phaer/projects/diebin/cloud/packer/packer_cache
2020/02/13 19:38:52 packer-builder-proxmox plugin: args: []string{"packer-builder-proxmox"}
2020/02/13 19:38:52 packer-builder-proxmox plugin: Plugin address: unix /tmp/packer-plugin709814317
2020/02/13 19:38:52 packer-builder-proxmox plugin: Waiting for connection...
2020/02/13 19:38:52 Received unix RPC address for /usr/local/bin/packer: addr is /tmp/packer-plugin709814317
2020/02/13 19:38:52 packer-builder-proxmox plugin: Serving a plugin connection...
2020/02/13 19:38:52 waiting for all plugin processes to complete...
2020/02/13 19:38:52 /usr/local/bin/packer: plugin process exited
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x7f39e6]
goroutine 1 [running]:
github.com/zclconf/go-cty/cty.Type.Equals(...)
/go/pkg/mod/github.com/azr/go-cty@v1.1.1-0.20200203143058-28fcda2fe0cc/cty/type.go:39
github.com/zclconf/go-cty/cty/convert.Convert(0x0, 0x0, 0x0, 0x0, 0x494f040, 0xc000467738, 0x0, 0x0, 0x0, 0xc0006bdfe0, ...)
/go/pkg/mod/github.com/azr/go-cty@v1.1.1-0.20200203143058-28fcda2fe0cc/cty/convert/public.go:43 +0x26
github.com/hashicorp/hcl/v2/hcldec.(*AttrSpec).decode(0xc00068e630, 0xc0004a4120, 0x0, 0x0, 0x0, 0xc0005ceac0, 0x0, 0x0, 0x0, 0x0, ...)
/go/pkg/mod/github.com/hashicorp/hcl/v2@v2.3.0/hcldec/spec.go:207 +0x312
github.com/hashicorp/hcl/v2/hcldec.ObjectSpec.decode(0xc0005ba0f0, 0xc0004a4120, 0x0, 0x0, 0x0, 0xc0005ceac0, 0xc0006f0df0, 0x42f2d1, 0x434d570, 0xc0006f0df0, ...)
/go/pkg/mod/github.com/hashicorp/hcl/v2@v2.3.0/hcldec/spec.go:79 +0x238
github.com/hashicorp/hcl/v2/hcldec.decode(0x494e280, 0xc0003d0a50, 0x0, 0x0, 0x0, 0xc0005ceac0, 0x494ef40, 0xc0005ba0f0, 0xde1d00, 0x492a000, ...)
/go/pkg/mod/github.com/hashicorp/hcl/v2@v2.3.0/hcldec/decode.go:21 +0x118
github.com/hashicorp/hcl/v2/hcldec.Decode(...)
/go/pkg/mod/github.com/hashicorp/hcl/v2@v2.3.0/hcldec/public.go:15
github.com/hashicorp/packer/hcl2template.decodeHCL2Spec(0x494e280, 0xc0003d0a50, 0xc0005ceac0, 0x7fa55c121300, 0xc00059c200, 0x0, 0x0, 0x0, 0xc000566000, 0x7fa561b08008, ...)
/home/circleci/project/hcl2template/decode.go:17 +0xa0
github.com/hashicorp/packer/hcl2template.(*Parser).startBuilder(0xc000627370, 0xc00044e570, 0xc0005ceac0, 0xc0003f43c8, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/circleci/project/hcl2template/types.source.go:54 +0x2e4
github.com/hashicorp/packer/hcl2template.(*Parser).getBuilds(0xc0006f1370, 0xc0005ae300, 0x0, 0x0, 0xc0005ae300, 0x0, 0x0, 0x0)
/home/circleci/project/hcl2template/types.packer_config.go:102 +0x1d5
github.com/hashicorp/packer/hcl2template.(*Parser).Parse(0xc000627370, 0x7ffcb01fefc5, 0x14, 0x0, 0xc0000dd138, 0xc0000dd1a8, 0x38, 0x40, 0xc0005ae080, 0xc000334fc0)
/home/circleci/project/hcl2template/types.packer_config.go:150 +0xd1
github.com/hashicorp/packer/command.(*BuildCommand).GetBuildsFromHCL(0xc000334f30, 0x7ffcb01fefc5, 0x14, 0x0, 0x0, 0xc000566000, 0x1)
/home/circleci/project/command/build.go:107 +0x123
github.com/hashicorp/packer/command.(*BuildCommand).GetBuilds(0xc000334f30, 0x7ffcb01fefc5, 0x14, 0x1, 0x1, 0x7fffffffffffffff, 0x0)
/home/circleci/project/command/build.go:136 +0x543
github.com/hashicorp/packer/command.(*BuildCommand).RunContext(0xc000334f30, 0x494dc00, 0xc0000c7c80, 0xc00004e1a0, 0x1, 0x1, 0xc0000c7c80)
/home/circleci/project/command/build.go:185 +0xca
github.com/hashicorp/packer/command.(*BuildCommand).Run(0xc000334f30, 0xc00004e1a0, 0x1, 0x1, 0x0)
/home/circleci/project/command/build.go:55 +0x201
github.com/mitchellh/cli.(*CLI).Run(0xc0002f6640, 0xc0002f6640, 0x1, 0x1)
/go/pkg/mod/github.com/mitchellh/cli@v1.0.0/cli.go:255 +0x1da
main.wrappedMain(0x0)
/home/circleci/project/main.go:238 +0x853
main.realMain(0x0)
/home/circleci/project/main.go:124 +0xbb
main.main()
/home/circleci/project/main.go:34 +0x22
Overview of the Issue
I accidentally left out the default value for "proxmox_username" below, which results in packer crashing with a segmentation fault.
Reproduction Steps
Run the attached build file with the mentioned packer config
Packer version
Packer v1.5.3-dev
(23fa310)
Simplified Packer Buildfile
puppetmaster.pkr.hcl
Operating system and Environment details
OpenSuSE Leap 15.1, amd64
Log Fragments and crash.log files
crash.log