Packer: virtualbox-vm build fails

Created on 5 Nov 2019  ·  6Comments  ·  Source: hashicorp/packer

console output:
PS C:\Users\smaes\git-local\vm-image-building\ntc_win2k12r2_vm_smaes> packer.exe build -force -var-file="win2k12r2.json" .\ntc_win2k12r2_vm_smaes_edit.json
virtualbox-vm output will be in this color.

unexpected EOF
panic: runtime error: index out of range [1] with length 0
2019/11/05 12:07:39 packer.exe:
2019/11/05 12:07:39 packer.exe: goroutine 14 [running]:
2019/11/05 12:07:39 packer.exe: github.com/hashicorp/packer/builder/virtualbox/common.ParseSnapshotData(0xc00040a3c0, 0x129, 0x4, 0x4, 0xc00040a3c0)
2019/11/05 12:07:39 packer.exe: /Users/azr/go/src/github.com/hashicorp/packer/builder/virtualbox/common/snapshot.go:38 +0x7cc
2019/11/05 12:07:39 packer.exe: github.com/hashicorp/packer/builder/virtualbox/common.(VBox42Driver).LoadSnapshots(0xc0006d3a60, 0xc00047ef00, 0x2d, 0x0, 0x1, 0xc0006e04e0)
2019/11/05 12:07:39 packer.exe: /Users/azr/go/src/github.com/hashicorp/packer/builder/virtualbox/common/driver_4_2.go:276 +0x160
2019/11/05 12:07:39 packer.exe: github.com/hashicorp/packer/builder/virtualbox/vm.NewConfig(0xc0000052e0, 0x2, 0x2, 0xc00004c688, 0x0, 0x0, 0x0, 0x0, 0x0)
2019/11/05 12:07:39 packer.exe: /Users/azr/go/src/github.com/hashicorp/packer/builder/virtualbox/vm/config.go:143 +0x98a
2019/11/05 12:07:39 packer.exe: github.com/hashicorp/packer/builder/virtualbox/vm.(
Builder).Prepare(0xc000308680, 0xc0000052e0, 0x2, 0x2, 0x314cf00, 0x314cf00, 0x1, 0x28, 0xc0002201e0)
2019/11/05 12:07:39 packer.exe: /Users/azr/go/src/github.com/hashicorp/packer/builder/virtualbox/vm/builder.go:24 +0x4a
2019/11/05 12:07:39 packer.exe: github.com/hashicorp/packer/packer/rpc.(BuilderServer).Prepare(0xc0003830e0, 0xc0000052a0, 0xc000005300, 0x0, 0x0)
2019/11/05 12:07:39 packer.exe: /Users/azr/go/src/github.com/hashicorp/packer/packer/rpc/builder.go:90 +0x64
2019/11/05 12:07:39 packer.exe: reflect.Value.call(0xc000374660, 0xc00029e080, 0x13, 0x3e7fa39, 0x4, 0xc000229f18, 0x3, 0x3, 0x0, 0x203030203020302, ...)
2019/11/05 12:07:39 packer.exe: /usr/local/Cellar/go/1.13.4/libexec/src/reflect/value.go:460 +0x5fd
2019/11/05 12:07:39 packer.exe: reflect.Value.Call(0xc000374660, 0xc00029e080, 0x13, 0xc000229f18, 0x3, 0x3, 0x0, 0x0, 0x0)
2019/11/05 12:07:39 packer.exe: /usr/local/Cellar/go/1.13.4/libexec/src/reflect/value.go:321 +0xbb
2019/11/05 12:07:39 packer.exe: net/rpc.(
service).call(0xc00038c940, 0xc0003982d0, 0xc00004c098, 0xc00004c0a0, 0xc0000d8480, 0xc000005220, 0x314cec0, 0xc0000052a0, 0x16, 0x314cf00, ...)
2019/11/05 12:07:39 packer.exe: /usr/local/Cellar/go/1.13.4/libexec/src/net/rpc/server.go:377 +0x176
2019/11/05 12:07:39 packer.exe: created by net/rpc.(*Server).ServeCodec
2019/11/05 12:07:39 packer.exe: /usr/local/Cellar/go/1.13.4/libexec/src/net/rpc/server.go:474 +0x432
2019/11/05 12:07:39 Build 'virtualbox-vm' prepare failure: unexpected EOF
2019/11/05 12:07:39 ui error: unexpected EOF
2019/11/05 12:07:39 [INFO] (telemetry) Finalizing.
2019/11/05 12:07:39 C:\Program Files\Packer\packer.exe: plugin process exited
2019/11/05 12:07:40 waiting for all plugin processes to complete...
2019/11/05 12:07:40 C:\Program Files\Packer\packer.exe: plugin process exited

!!!!!!!!!!!!!!!!!!!!!!!!!!! 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.

!!!!!!!!!!!!!!!!!!!!!!!!!!! PACKER CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

crash.log in attachment
crash.log

buildevirtualbox crash

All 6 comments

Hello @stijnmaes1992, thanks for opening and sorry this happened to you; the crash log pinpoints exactly where this happens and I'll come with a fix asap.

Hey @stijnmaes1992, I have created #8329, to fix your issue please tell me wether binaries found here fix this issue for you.

next panic now:
packer.exe validate .\ntc_win2k12r2_vm_smaes_edit.json
Template validation failed. Errors are shown below.

Errors validating build 'virtualbox-vm'. unexpected EOF
panic: runtime error: index out of range [1] with length 0
2019/11/06 08:59:25 packer.exe:
2019/11/06 08:59:25 packer.exe: goroutine 57 [running]:
2019/11/06 08:59:25 packer.exe: github.com/hashicorp/packer/builder/virtualbox/common.ParseSnapshotData(0xc000204140, 0x129, 0x4, 0x4, 0xc000204140)
2019/11/06 08:59:25 packer.exe: /go/src/github.com/hashicorp/packer/builder/virtualbox/common/snapshot.go:63 +0x7ad
2019/11/06 08:59:25 packer.exe: github.com/hashicorp/packer/builder/virtualbox/common.(VBox42Driver).LoadSnapshots(0xc0003c6450, 0xc00051adb0, 0x2d, 0x0, 0x1, 0xc0003c5260)
2019/11/06 08:59:25 packer.exe: /go/src/github.com/hashicorp/packer/builder/virtualbox/common/driver_4_2.go:276 +0x160
2019/11/06 08:59:25 packer.exe: github.com/hashicorp/packer/builder/virtualbox/vm.NewConfig(0xc0005537a0, 0x2, 0x2, 0xc0003bc6c8, 0x0, 0x0, 0x0, 0x0, 0x0)
2019/11/06 08:59:25 packer.exe: /go/src/github.com/hashicorp/packer/builder/virtualbox/vm/config.go:143 +0x98a
2019/11/06 08:59:25 packer.exe: github.com/hashicorp/packer/builder/virtualbox/vm.(
Builder).Prepare(0xc000552f20, 0xc0005537a0, 0x2, 0x2, 0x314cea0, 0x314cea0, 0x1, 0x28, 0xc0000f1710)
2019/11/06 08:59:25 packer.exe: /go/src/github.com/hashicorp/packer/builder/virtualbox/vm/builder.go:24 +0x4a
2019/11/06 08:59:25 packer.exe: github.com/hashicorp/packer/packer/rpc.(BuilderServer).Prepare(0xc0000f1320, 0xc000553760, 0xc0005537c0, 0x0, 0x0)
2019/11/06 08:59:25 packer.exe: /go/src/github.com/hashicorp/packer/packer/rpc/builder.go:90 +0x64
2019/11/06 08:59:25 packer.exe: reflect.Value.call(0xc000092900, 0xc0000d80b8, 0x13, 0x3e7f7bd, 0x4, 0xc000637f18, 0x3, 0x3, 0x0, 0x0, ...)
2019/11/06 08:59:25 packer.exe: /usr/local/go/src/reflect/value.go:460 +0x5fd
2019/11/06 08:59:25 packer.exe: reflect.Value.Call(0xc000092900, 0xc0000d80b8, 0x13, 0xc000637f18, 0x3, 0x3, 0x0, 0x0, 0x0)
2019/11/06 08:59:25 packer.exe: /usr/local/go/src/reflect/value.go:321 +0xbb
2019/11/06 08:59:25 packer.exe: net/rpc.(
service).call(0xc0002926c0, 0xc0000f83c0, 0xc0003bc560, 0xc0003bc570, 0xc0000f6280, 0xc000553700, 0x314ce60, 0xc000553760, 0x16, 0x314cea0, ...)
2019/11/06 08:59:25 packer.exe: /usr/local/go/src/net/rpc/server.go:377 +0x176
2019/11/06 08:59:25 packer.exe: created by net/rpc.(*Server).ServeCodec
2019/11/06 08:59:25 packer.exe: /usr/local/go/src/net/rpc/server.go:474 +0x432
2019/11/06 08:59:25 Build 'virtualbox-vm' prepare failure: unexpected EOF
2019/11/06 08:59:25 ui error: Template validation failed. Errors are shown below.
2019/11/06 08:59:25 ui error: Errors validating build 'virtualbox-vm'. unexpected EOF
2019/11/06 08:59:25 [INFO] (telemetry) Finalizing.
2019/11/06 08:59:25 C:\Program Files\Packer\packer.exe: plugin process exited
2019/11/06 08:59:26 waiting for all plugin processes to complete...
2019/11/06 08:59:26 C:\Program Files\Packer\packer.exe: plugin process exited

!!!!!!!!!!!!!!!!!!!!!!!!!!! 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.

!!!!!!!!!!!!!!!!!!!!!!!!!!! PACKER CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

I did download the packer_windows_amd64.zip from https://circleci.com/gh/hashicorp/packer/19849#artifacts/containers/0
Extracted it in C:\Program Files\Packer and renamed the "previous" packer.exe there to packer1.exe . I am guessing this is right? Pretty new at this so..

crash.log

Ah ! I opened a new PR (#8336) with some malformed snapshot data added in the tests too.

Please tell me if the new binary fixes it for you 🙂.

Works fine now, tysm!

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.

Was this page helpful?
0 / 5 - 0 ratings