I accidentally left out the default value for "proxmox_username" below, which results in packer crashing with a segmentation fault.
Run the attached build file with the mentioned packer config
Packer v1.5.3-dev
(https://github.com/hashicorp/packer/commit/23fa3107a3f1cd8a3b330c32b8030fad6f9ddb57)
puppetmaster.pkr.hcl
variable "proxmox_url" {
default = "https://192.168.122.58:8006/api2/json" // PROXMOX_URL
}
variable "proxmox_username" {
type = string
}
variable "proxmox_password" {
default = "not-the-"
}
build {
sources = [
"source.proxmox.puppetmaster",
]
provisioner "shell" {
inline = [
"sleep 5"
]
}
post-processor "shell-local" {
inline = [
"sleep 5"
]
}
}
source "proxmox" "puppetmaster" {
proxmox_url = "${var.proxmox_url}"
username = "${var.proxmox_username}"
password = "${var.proxmox_password}"
}
OpenSuSE Leap 15.1, amd64
crash.log
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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/hcldec/decode.go:21 +0x118
github.com/hashicorp/hcl/v2/hcldec.Decode(...)
/go/pkg/mod/github.com/hashicorp/hcl/[email protected]/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/[email protected]/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
Hey @phaer awesome, thanks for bubbling this up ! 🙏 Fixing this now
Hello there I think I have a fix with one of our upstream libraries https://github.com/zclconf/go-cty/issues/44 and hopefully this is the correct fix and we'll get a patch real soon.
Hello there ! Turns out my fix was the wrong one and I just opened #8837 to fix this. Please tell me if this fixes the bug for you; binaries can be found here
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.
Most helpful comment
Hey @phaer awesome, thanks for bubbling this up ! 🙏 Fixing this now