Skip to content

Instantly share code, notes, and snippets.

@aidan-mundy
Created June 30, 2023 16:44
Show Gist options
  • Save aidan-mundy/0a7c1a6a653b7235ae0ad1d584fe59ba to your computer and use it in GitHub Desktop.
Save aidan-mundy/0a7c1a6a653b7235ae0ad1d584fe59ba to your computer and use it in GitHub Desktop.
Packer Label Crash in Invalid Location
panic: BlockListSpec used in non-block context
goroutine 1 [running]:
github.com/hashicorp/hcl/v2/hcldec.(*BlockLabelSpec).decode(0x14000d9e168?, 0x14000d9e138?, {0x0?, 0x13?, 0x14000d9e0e8?}, 0x14000123de8?)
github.com/hashicorp/hcl/v2@v2.14.1/hcldec/spec.go:1354 +0xb0
github.com/hashicorp/hcl/v2/hcldec.ObjectSpec.decode(0x1400057f3b0, 0x1400057f3b0?, {0x0, 0x0, 0x0}, 0x0?)
github.com/hashicorp/hcl/v2@v2.14.1/hcldec/spec.go:85 +0x174
github.com/hashicorp/hcl/v2/hcldec.decode({0x107e46858, 0x14000451590}, {0x0, 0x0, 0x0}, 0x105539d8c?, {0x107e47ea8, 0x1400057f3b0}, 0x0)
github.com/hashicorp/hcl/v2@v2.14.1/hcldec/decode.go:21 +0xd0
github.com/hashicorp/hcl/v2/hcldec.Decode(...)
github.com/hashicorp/hcl/v2@v2.14.1/hcldec/public.go:15
github.com/hashicorp/packer/hcl2template.decodeHCL2Spec({0x107e46858, 0x14000451590}, 0x14000d9e4a8?, {0x13189d718?, 0x14000d12078?})
github.com/hashicorp/packer/hcl2template/decode.go:20 +0x64
github.com/hashicorp/packer/hcl2template.(*HCL2Provisioner).HCL2Prepare(0x14000ae1aa0, 0x14000ae1a70?)
github.com/hashicorp/packer/hcl2template/types.hcl_provisioner.go:54 +0x334
github.com/hashicorp/packer/hcl2template.(*PackerConfig).startProvisioner(0x14000534780, {{{0x14000202cc7, 0x6}, {0x14000202cce, 0x6}}, {0x0, 0x0}, {0x107e46858, 0x14000450480}}, 0x14000463320, ...)
github.com/hashicorp/packer/hcl2template/types.build.provisioners.go:202 +0x5bc
github.com/hashicorp/packer/hcl2template.(*PackerConfig).getCoreBuildProvisioner(0x0?, {{{0x14000202cc7, 0x6}, {0x14000202cce, 0x6}}, {0x0, 0x0}, {0x107e46858, 0x14000450480}}, 0x14000463320, ...)
github.com/hashicorp/packer/hcl2template/types.packer_config.go:492 +0x88
github.com/hashicorp/packer/hcl2template.(*PackerConfig).getCoreBuildProvisioners(0x14000534780?, {{{0x14000202cc7, 0x6}, {0x14000202cce, 0x6}}, {0x0, 0x0}, {0x107e46858, 0x14000450480}}, {0x140000108a8, ...}, ...)
github.com/hashicorp/packer/hcl2template/types.packer_config.go:480 +0x178
github.com/hashicorp/packer/hcl2template.(*PackerConfig).GetBuilds(0x14000534780, {{0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x0, 0x0, {0x0, ...}, ...})
github.com/hashicorp/packer/hcl2template/types.packer_config.go:690 +0x1250
github.com/hashicorp/packer/command.(*BuildCommand).RunContext(0x1400057e4e0, {0x107e46158?, 0x140000be0a0}, 0x140004dc090)
github.com/hashicorp/packer/command/build.go:115 +0x1f4
github.com/hashicorp/packer/command.(*BuildCommand).Run(0x1400057e4e0, {0x1400011a1a0, 0x1, 0x1})
github.com/hashicorp/packer/command/build.go:41 +0xac
github.com/mitchellh/cli.(*CLI).Run(0x14000534000)
github.com/mitchellh/cli@v1.1.2/cli.go:262 +0x4a8
main.wrappedMain()
github.com/hashicorp/packer/main.go:265 +0xb40
main.realMain()
github.com/hashicorp/packer/main.go:52 +0xb8
main.main()
github.com/hashicorp/packer/main.go:38 +0x1c
!!!!!!!!!!!!!!!!!!!!!!!!!!! PACKER CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Packer crashed! This is always indicative of a bug within Packer.
A crash log has been placed at "crash.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Packer[1] so that we can fix this.
[1]: https://github.com/hashicorp/packer/issues
!!!!!!!!!!!!!!!!!!!!!!!!!!! PACKER CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment