Packer: 'azure-arm' errored: unexpected EOF (Packer v.1.4.2)

Created on 29 Jun 2019  ยท  23Comments  ยท  Source: hashicorp/packer

I am trying to build a Linux Managed Image in Azure. I use the following setup:

buildeazure need-more-info regression

Most helpful comment

Binaries that should fix this can be found here: https://circleci.com/gh/hashicorp/packer/6821#artifacts/containers/0

Would love confirmation that this merged PR will fix things.

All 23 comments

Hmm. I can't reproduce. Can you give me the full logs? your gistfile seems to only contain the first 90 lines.

I am also seeing this error for Windows 2012R2- it crashes during this phase every time.

2019/07/01 17:41:36 ui: ==> azure-arm: Deleting the temporary OS disk ...
2019/07/01 17:41:36 ui: ==> azure-arm: -> OS Disk : skipping, managed disk was used...
2019/07/01 17:41:36 ui: ==> azure-arm: Deleting the temporary Additional disk ...
2019/07/01 17:41:36 ui: ==> azure-arm: -> Additional Disk : skipping, managed disk was used...
2019/07/01 17:41:36 packer.exe: panic: interface conversion: interface {} is nil, not string
2019/07/01 17:41:36 packer.exe:
2019/07/01 17:41:36 packer.exe: goroutine 111 [running]:
2019/07/01 17:41:36 packer.exe: github.com/hashicorp/packer/builder/azure/arm.(Builder).Run(0xc000376a50, 0x3d01f80, 0xc000319040, 0x3d1a040, 0xc0004578c0, 0x3ca1600, 0xc000188d40, 0x0, 0x0, 0x0, ...)
2019/07/01 17:41:36 packer.exe: /Users/mmarsh/Projects/packer/builder/azure/arm/builder.go:305 +0x438b
2019/07/01 17:41:36 packer.exe: github.com/hashicorp/packer/packer/rpc.(
BuilderServer).Run(0xc000377980, 0x1, 0xc000434030, 0x0, 0x0)
2019/07/01 17:41:36 packer.exe: /Users/mmarsh/Projects/packer/packer/rpc/builder.go:109 +0x238
2019/07/01 17:41:36 packer.exe: reflect.Value.call(0xc00027ac60, 0xc000324330, 0x13, 0x374d0d9, 0x4, 0xc00021bf18, 0x3, 0x3, 0xc000272100, 0xc00021bee8, ...)
2019/07/01 17:41:36 packer.exe: /usr/local/go/src/reflect/value.go:447 +0x468
2019/07/01 17:41:36 packer.exe: reflect.Value.Call(0xc00027ac60, 0xc000324330, 0x13, 0xc00021bf18, 0x3, 0x3, 0xc0000a6c60, 0xc00021bf30, 0x404c55)
2019/07/01 17:41:36 packer.exe: /usr/local/go/src/reflect/value.go:308 +0xab
2019/07/01 17:41:36 packer.exe: net/rpc.(service).call(0xc000072e00, 0xc000330460, 0xc00041b3a8, 0xc00041b3b0, 0xc00032c780, 0xc000274440, 0x2d283e0, 0xc00043402c, 0x18a, 0x2c84600, ...)
2019/07/01 17:41:36 packer.exe: /usr/local/go/src/net/rpc/server.go:384 +0x155
2019/07/01 17:41:36 packer.exe: created by net/rpc.(
Server).ServeCodec
2019/07/01 17:41:36 packer.exe: /usr/local/go/src/net/rpc/server.go:481 +0x432
2019/07/01 17:41:36 [INFO] (telemetry) ending azure-arm
2019/07/01 17:41:36 ui error: Build 'azure-arm' errored: unexpected EOF
2019/07/01 17:41:36 machine readable: error-count []string{"1"}
2019/07/01 17:41:36 ui error:
==> Some builds didn't complete successfully and had errors:
2019/07/01 17:41:36 machine readable: azure-arm,error []string{"unexpected EOF"}
2019/07/01 17:41:36 ui error: --> azure-arm: unexpected EOF
2019/07/01 17:41:36 ui:
==> Builds finished but no artifacts were created.
2019/07/01 17:41:36 [INFO] (telemetry) Finalizing.
2019/07/01 17:41:36 C:\Packer\packer.exe: plugin process exited
2019/07/01 17:41:36 waiting for all plugin processes to complete...
2019/07/01 17:41:36 C:\Packer\packer.exe: plugin process exited
2019/07/01 17:41:36 C:\Packer\packer.exe: plugin process exited
2019/07/01 17:41:36 C:\Packer\packer.exe: plugin process exited

@amydutta Can you take a look? Based on these logs it looks like it was introduced in 85036231c4 . (it references like 305 of the azure builder)

macOS Mojave 10.14.5
Packer v1.4.2


==> azure-arm: Deleting the temporary OS disk ...
==> azure-arm: -> OS Disk : skipping, managed disk was used...
==> azure-arm: Deleting the temporary Additional disk ...
==> azure-arm: -> Additional Disk : skipping, managed disk was used...
Build 'azure-arm' errored: unexpected EOF

==> Some builds didn't complete successfully and had errors:
--> azure-arm: unexpected EOF

==> Builds finished but no artifacts were created.
2019/07/01 17:51:39 packer: panic: interface conversion: interface {} is nil, not string
2019/07/01 17:51:39 packer:
2019/07/01 17:51:39 packer: goroutine 35 [running]:
2019/07/01 17:51:39 packer: github.com/hashicorp/packer/builder/azure/arm.(Builder).Run(0xc0003f7aa0, 0x48619c0, 0xc0000f2280, 0x487a140, 0xc00000e420, 0x48013a0, 0xc0001ba6f0, 0x0, 0x0, 0x0, ...)
2019/07/01 17:51:39 packer: /Users/mmarsh/Projects/packer/builder/azure/arm/builder.go:305 +0x4384
2019/07/01 17:51:39 packer: github.com/hashicorp/packer/packer/rpc.(
BuilderServer).Run(0xc0003f76e0, 0x1, 0xc000056150, 0x0, 0x0)
2019/07/01 17:51:39 packer: /Users/mmarsh/Projects/packer/packer/rpc/builder.go:109 +0x231
2019/07/01 17:51:39 packer: reflect.Value.call(0xc000060840, 0xc0001d64b0, 0x13, 0x42afb37, 0x4, 0xc000097f18, 0x3, 0x3, 0xc00011e640, 0xc000492028, ...)
2019/07/01 17:51:39 packer: /usr/local/go/src/reflect/value.go:447 +0x461
2019/07/01 17:51:39 packer: reflect.Value.Call(0xc000060840, 0xc0001d64b0, 0x13, 0xc000080f18, 0x3, 0x3, 0xc000492000, 0xc000080f10, 0xc000080fb8)
2019/07/01 17:51:39 packer: /usr/local/go/src/reflect/value.go:308 +0xa4
2019/07/01 17:51:39 packer: net/rpc.(service).call(0xc0001b6700, 0xc0001c8050, 0xc0001b8050, 0xc0001b8060, 0xc0001e2180, 0xc0004ca320, 0x3887f20, 0xc00005614c, 0x18a, 0x37e36e0, ...)
2019/07/01 17:51:39 packer: /usr/local/go/src/net/rpc/server.go:384 +0x14e
2019/07/01 17:51:39 packer: created by net/rpc.(
Server).ServeCodec
2019/07/01 17:51:39 packer: /usr/local/go/src/net/rpc/server.go:481 +0x42b
2019/07/01 17:51:39 /usr/local/bin/packer: plugin process exited
2019/07/01 17:51:39 [INFO] (telemetry) ending azure-arm
2019/07/01 17:51:39 ui error: Build 'azure-arm' errored: unexpected EOF
2019/07/01 17:51:39 machine readable: error-count []string{"1"}
2019/07/01 17:51:39 ui error:
==> Some builds didn't complete successfully and had errors:
2019/07/01 17:51:39 machine readable: azure-arm,error []string{"unexpected EOF"}
2019/07/01 17:51:39 ui error: --> azure-arm: unexpected EOF
==> Builds finished but no artifacts were created.
2019/07/01 17:51:39 [INFO] (telemetry) Finalizing.
2019/07/01 17:51:40 waiting for all plugin processes to complete...

@SwampDragons yes I will take a look sometime today or tomorrow, thanks for bringing this to my attention

No problem! :)

packer 1.4.2, macOS Mojave, 10.14.5
I'm seeing this too:

azure-arm: [info] MLD customization writing took 73.334 seconds
azure-arm: [info] Graph writing took 38.4014 seconds
azure-arm: [info] RAM: peak bytes used: 166659239936
azure-arm: [Wed Jul 3 19:20:03 UTC 2019] osrm-customize complete! Done!
azure-arm: deregister with waagent...
azure-arm: WARNING! The waagent service will be stopped.
azure-arm: WARNING! Cached DHCP leases will be deleted.
azure-arm: WARNING! root password will be disabled. You will not be able to login as root.
azure-arm: WARNING! /etc/resolvconf/resolv.conf.d/tail and /etc/resolvconf/resolv.conf.d/original will be deleted.
azure-arm: WARNING! packer account and entire home directory will be deleted.

==> azure-arm: Querying the machine's properties ...
==> azure-arm: -> ResourceGroupName : 'packer-Resource-Group-2vw7jrt8km'
==> azure-arm: -> ComputeName : 'pkrvm2vw7jrt8km'
==> azure-arm: -> Managed OS Disk : '/subscriptions/30e95a3d-74e7-489c-a2ba-2a39d9c772ec/resourceGroups/packer-Resource-Group-2vw7jrt8km/providers/Microsoft.Compute/disks/pkros2vw7jrt8km'
==> azure-arm: Querying the machine's additional disks properties ...
==> azure-arm: -> ResourceGroupName : 'packer-Resource-Group-2vw7jrt8km'
==> azure-arm: -> ComputeName : 'pkrvm2vw7jrt8km'
==> azure-arm: -> Managed Additional Disk 1 : '/subscriptions/30e95a3d-74e7-489c-a2ba-2a39d9c772ec/resourceGroups/packer-Resource-Group-2vw7jrt8km/providers/Microsoft.Compute/disks/datadisk-1'
==> azure-arm: -> Managed Additional Disk 2 : '/subscriptions/30e95a3d-74e7-489c-a2ba-2a39d9c772ec/resourceGroups/packer-Resource-Group-2vw7jrt8km/providers/Microsoft.Compute/disks/datadisk-2'
==> azure-arm: Powering off machine ...
==> azure-arm: -> ResourceGroupName : 'packer-Resource-Group-2vw7jrt8km'
==> azure-arm: -> ComputeName : 'pkrvm2vw7jrt8km'
==> azure-arm: Capturing image ...
==> azure-arm: -> Compute ResourceGroupName : 'packer-Resource-Group-2vw7jrt8km'
==> azure-arm: -> Compute Name : 'pkrvm2vw7jrt8km'
==> azure-arm: -> Compute Location : 'East US 2'
==> azure-arm: -> Image ResourceGroupName : 'packerwork'
==> azure-arm: -> Image Name : 'osrm-v5.22.0'
==> azure-arm: -> Image Location : 'eastus2'
==> azure-arm: Deleting resource group ...
==> azure-arm: -> ResourceGroupName : 'packer-Resource-Group-2vw7jrt8km'
==> azure-arm:
==> azure-arm: The resource group was created by Packer, deleting ...
==> azure-arm: Deleting the temporary OS disk ...
==> azure-arm: -> OS Disk : skipping, managed disk was used...
==> azure-arm: Deleting the temporary Additional disk ...
==> azure-arm: -> Additional Disk : skipping, managed disk was used...
Build 'azure-arm' errored: unexpected EOF

(there is 5.5 hours of OSRM build log before this)

I have run it again but with PACKER_LOG=1, and this is the last part of the build. Hopefully it would be helpful:

2019/07/01 23:44:24 ui: ==> azure-arm: Deleting the temporary OS disk ...
2019/07/01 23:44:24 ui: ==> azure-arm: -> OS Disk : skipping, managed disk was used...
2019/07/01 23:44:24 ui: ==> azure-arm: Deleting the temporary Additional disk ...
2019/07/01 23:44:24 ui: ==> azure-arm: -> Additional Disk : skipping, managed disk was used...
2019/07/01 23:44:24 packer: panic: interface conversion: interface {} is nil, not string
2019/07/01 23:44:24 packer:
2019/07/01 23:44:24 packer: goroutine 75 [running]:
2019/07/01 23:44:24 packer: github.com/hashicorp/packer/builder/azure/arm.(Builder).Run(0xc0000ed020, 0x48619c0, 0xc0000a9380, 0x487a140, 0xc0001cf7c0, 0x48013a0, 0xc0000cca30, 0x0, 0x0, 0x0, ...)
2019/07/01 23:44:24 packer: /Users/mmarsh/Projects/packer/builder/azure/arm/builder.go:305 +0x4384
2019/07/01 23:44:24 packer: github.com/hashicorp/packer/packer/rpc.(
BuilderServer).Run(0xc0000ed380, 0x1, 0xc000472060, 0x0, 0x0)
2019/07/01 23:44:24 packer: /Users/mmarsh/Projects/packer/packer/rpc/builder.go:109 +0x231
2019/07/01 23:44:24 packer: reflect.Value.call(0xc00005d5c0, 0xc0000105c0, 0x13, 0x42afb37, 0x4, 0xc00008ef18, 0x3, 0x3, 0xc0000a9980, 0xc0003ce098, ...)
2019/07/01 23:44:24 packer: /usr/local/go/src/reflect/value.go:447 +0x461
2019/07/01 23:44:24 packer: reflect.Value.Call(0xc00005d5c0, 0xc0000105c0, 0x13, 0xc000165f18, 0x3, 0x3, 0xc0003ce070, 0xc000165f10, 0xc000165fb8)
2019/07/01 23:44:24 packer: /usr/local/go/src/reflect/value.go:308 +0xa4
2019/07/01 23:44:24 packer: net/rpc.(service).call(0xc0000a9a00, 0xc0000f00a0, 0xc0004c2000, 0xc0004c2010, 0xc00040c500, 0xc00000f700, 0x3887f20, 0xc00047205c, 0x18a, 0x37e36e0, ...)
2019/07/01 23:44:24 packer: /usr/local/go/src/net/rpc/server.go:384 +0x14e
2019/07/01 23:44:24 packer: created by net/rpc.(
Server).ServeCodec
2019/07/01 23:44:24 packer: /usr/local/go/src/net/rpc/server.go:481 +0x42b
2019/07/01 23:44:24 /usr/local/bin/packer: plugin process exited
2019/07/01 23:44:24 [INFO] (telemetry) ending azure-arm
2019/07/01 23:44:24 ui error: Build 'azure-arm' errored: unexpected EOF
2019/07/01 23:44:24 machine readable: error-count []string{"1"}
2019/07/01 23:44:24 ui error:
==> Some builds didn't complete successfully and had errors:
2019/07/01 23:44:24 machine readable: azure-arm,error []string{"unexpected EOF"}
2019/07/01 23:44:24 ui error: --> azure-arm: unexpected EOF
2019/07/01 23:44:24 ui:
==> Builds finished but no artifacts were created.
2019/07/01 23:44:24 [INFO] (telemetry) Finalizing.
2019/07/01 23:44:25 waiting for all plugin processes to complete...
2019/07/01 23:44:25 /usr/local/bin/packer: plugin process exited

I have also the same error for packer 1.4.2 which runs on Windows 10 OS. I tried create managed image on azure. For unmanaged it works fine.

Build 'azure-arm' errored: unexpected EOF

==> Some builds didn't complete successfully and had errors:
--> azure-arm: unexpected EOF

==> Builds finished but no artifacts were created.
panic: interface conversion: interface {} is nil, not string
2019/07/08 14:39:42 packer.exe:
2019/07/08 14:39:42 packer.exe: goroutine 98 [running]:
2019/07/08 14:39:42 packer.exe: github.com/hashicorp/packer/builder/azure/arm.(Builder).Run(0xc000234240, 0x3d01f80, 0xc000358100, 0x3d1a040, 0xc000004b60, 0x3ca1600, 0xc000081df0, 0x0, 0x0, 0x0, ...)
2019/07/08 14:39:42 packer.exe: /Users/mmarsh/Projects/packer/builder/azure/arm/builder.go:305 +0x438b
2019/07/08 14:39:42 packer.exe: github.com/hashicorp/packer/packer/rpc.(
BuilderServer).Run(0xc000340a80, 0x1, 0xc00004a0a0, 0x0, 0x0)
2019/07/08 14:39:42 packer.exe: /Users/mmarsh/Projects/packer/packer/rpc/builder.go:109 +0x238
2019/07/08 14:39:42 packer.exe: reflect.Value.call(0xc00010a600, 0xc000352090, 0x13, 0x374d0d9, 0x4, 0xc0000b3f18, 0x3, 0x3, 0xc00032f700, 0x3, ...)
2019/07/08 14:39:42 packer.exe: /usr/local/go/src/reflect/value.go:447 +0x468
2019/07/08 14:39:42 packer.exe: reflect.Value.Call(0xc00010a600, 0xc000352090, 0x13, 0xc0000b3f18, 0x3, 0x3, 0xc00056c180, 0xc0000b3f30, 0x404c55)
2019/07/08 14:39:42 packer.exe: /usr/local/go/src/reflect/value.go:308 +0xab
2019/07/08 14:39:42 packer.exe: net/rpc.(service).call(0xc000090400, 0xc0004f00a0, 0xc000414008, 0xc000414010, 0xc00011a200, 0xc0003307c0, 0x2d283e0, 0xc00004a09c, 0x18a, 0x2c84600, ...)
2019/07/08 14:39:42 packer.exe: /usr/local/go/src/net/rpc/server.go:384 +0x155
2019/07/08 14:39:42 packer.exe: created by net/rpc.(
Server).ServeCodec
2019/07/08 14:39:42 packer.exe: /usr/local/go/src/net/rpc/server.go:481 +0x432
2019/07/08 14:39:42 [INFO] (telemetry) ending azure-arm
2019/07/08 14:39:42 ui error: Build 'azure-arm' errored: unexpected EOF
2019/07/08 14:39:42 machine readable: error-count []string{"1"}
2019/07/08 14:39:42 ui error:
==> Some builds didn't complete successfully and had errors:
2019/07/08 14:39:42 machine readable: azure-arm,error []string{"unexpected EOF"}

Binaries that should fix this can be found here: https://circleci.com/gh/hashicorp/packer/6821#artifacts/containers/0

Would love confirmation that this merged PR will fix things.

@SwampDragons this fixed the issue for me.

was getting "packer Build 'azure-arm' errored: unexpected EOF", but the error went and all builds complete successfully with the new binaries.

I have tested it on Mac OS High Sierra 10.13.6 and it worked. Tomorrow I will test it on CentOS 7.6 and let you know

The bugfix isn't OS dependent so I'd be shocked if it doesn't work; I'll reopen if it turns out to be an issue.

I have run it on CentOS 7.6 and worked as expected. Thank you

This fixed the issue for me. Thank you!!

This fixed the issue for me. Thank you!!

Hey @JerryMSFT, what worked for you? I think I'm having the exact same issue.

@jzuchora87 Try the patched version of Packer linked here: https://circleci.com/gh/hashicorp/packer/6821#artifacts/containers/0

@jzuchora87 Try the patched version of Packer linked here: https://circleci.com/gh/hashicorp/packer/6821#artifacts/containers/0

Rerunning now and will report back in a few hours! Thanks!

@jzuchora87 Try the patched version of Packer linked here: https://circleci.com/gh/hashicorp/packer/6821#artifacts/containers/0

That worked!

Just adding, I was seeing unexpected EOF errors when building CentOS and Ubuntu images with openstack (packer 1.4.4) - the linked binary fixed this issue for me too. Will this be included in an official release any time soon @SwampDragons ?

@mancdaz I suspect you're actually seeing https://github.com/hashicorp/packer/issues/8197. That issue links the nightly build which contains its patch, so you can try that one out and see if it works.

We'll be releasing 1.4.5 on Monday :)

@SwampDragons thank you - that was indeed the issue I was seeing, and 1.4.5 does indeed fix it!

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

Related issues

znerd picture znerd  ยท  3Comments

jesse-c picture jesse-c  ยท  3Comments

DanielBo picture DanielBo  ยท  3Comments

craigsimon picture craigsimon  ยท  3Comments

wduncanfraser picture wduncanfraser  ยท  3Comments