Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packer crash while uploading to vsphere #2595

Closed
m1ndful opened this issue Aug 13, 2015 · 20 comments
Closed

Packer crash while uploading to vsphere #2595

m1ndful opened this issue Aug 13, 2015 · 20 comments

Comments

@m1ndful
Copy link

m1ndful commented Aug 13, 2015

Crashed during uploading to vSphere.
==> vmware-iso: Running post-processor: vsphere vmware-iso (vsphere): Uploading output-vmware-iso/packer-vmware-iso.vmx to vSphere panic: runtime error: invalid memory address or nil pointer dereference [signal 0xb code=0x1 addr=0x0 pc=0x4ae2c0]

@m1ndful
Copy link
Author

m1ndful commented Aug 13, 2015

Gist with details: https://gist.github.com/m1ndful/02d34bc9950d62789b9a

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.5 LTS
Release:    12.04
Codename:   precise
$ packer version
Packer v0.8.5
$ vmware --version
VMware Workstation 11.1.2 build-2780323
$ ovftool --version
VMware ovftool 4.0.0 (build-2670985)
$ uname -a
Linux hostname 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

@cbednarski
Copy link
Contributor

Thanks for the report! Your crash log says fatal error: runtime: out of memory. How much memory is on the machine running packer? Do you have virtual memory turned off or anything like that?

@m1ndful
Copy link
Author

m1ndful commented Aug 13, 2015

12GB memory and 2 CPUs. Machine is VM inside vSphere cloud.

@cbednarski
Copy link
Contributor

Adding another log from #2656

https://gist.github.com/cbednarski/ebf88aeb239f246e2f49

@ubailb1
Copy link

ubailb1 commented Aug 22, 2015

The machine that is doing the build is.
Mac Mini
3.0GHz Dual-Core Intel Core i7 (Turbo Boost up to 3.5GHz)
16GB 1600MHz LPDDR3 SDRAM
1TB Fusion Drive

@ubailb1
Copy link

ubailb1 commented Aug 23, 2015

It is funny that I am getting this error given that the machine is a physical machine with 16gb of ram but the log says I am using 64gb.

@cbednarski
Copy link
Contributor

It is funny that I am getting this error given that the machine is a physical machine with 16gb of ram but the log says I am using 64gb.

Yeah I agree. It could be using swap or virtual memory, but I'm guessing there's some kind of memory leak or a loop that doesn't terminate correctly. On an internals note, I'm not exactly sure how the go runtime allocates heap -- perhaps in fixed-size blocks or by doubling current usage, etc. However, it looks like it is failing on a malloc call to allocate 64gb, but may not have actually used that much yet.

@cbednarski
Copy link
Contributor

I looked at the logs and I don't see anything particularly exciting. The build crashes from malloc fail just as it tries to run the ovftool. You can see this in the second go routine which fails malloc while trying to make the exec call. This is a fairly boring part of code since most of the work here happens in another program.

I noticed some go routines are hanging around with msgpack calls. These look suspicious. I have not yet confirmed by my guesses at this point:

  • There is a bug in msgpack
  • Some other part of the packer run prior to this call has consumed a lot of memory, but we don't crash until the exec code is invoked (no idea why this happens consistently at that point)

The pointer offsets look to be very similar in both stack traces but I don't see a significant spread in any of the go routines, so I'm curious whether the offending go routine has exited already but the memory has not been garbage collected for some reason (that would suggest a leak).

@ubailb1
Copy link

ubailb1 commented Sep 1, 2015

Another Debug using Fusion 8 Pro which allows for direct push to vSphere . But still not working as designed.

2015/09/01 10:16:25 ui: ==> vmware-vmx: Running post-processor: vsphere
==> vmware-vmx: Running post-processor: vsphere
2015/09/01 10:16:25 ui:     vmware-vmx (vsphere): Uploading output-vmware-vmx/packer-vmware-vmx-{{timestamp}}.vmx to vSphere
2015/09/01 10:16:25 packer-post-processor-vsphere: 2015/09/01 10:16:25 Starting ovftool with parameters: --noSSLVerify=false --acceptAllEulas --name=Mac OSX 10.10.5 --datastore=ESXI HDD 12 --diskMode=thin --network=VM_Network --vmFolder=  output-vmware-vmx/packer-vmware-vmx-{{timestamp}}.vmx vi://ben.bailey:Nev%40eh01@10.25.197.40/DevOps/host/Mac Mini Lab
    vmware-vmx (vsphere): Uploading output-vmware-vmx/packer-vmware-vmx-{{timestamp}}.vmx to vSphere
2015/09/01 10:48:41 packer-post-processor-vsphere: runtime: out of memory: cannot allocate 68719476736-byte block (68721573888 in use)
2015/09/01 10:48:41 packer-post-processor-vsphere: fatal error: out of memory
2015/09/01 10:48:41 packer-post-processor-vsphere: 
2015/09/01 10:48:41 packer-post-processor-vsphere: runtime stack:
2015/09/01 10:48:41 packer-post-processor-vsphere: runtime.throw(0x67d64a)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/runtime/panic.go:491 +0xad
2015/09/01 10:48:41 packer-post-processor-vsphere: runtime.largeAlloc_m()
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/runtime/malloc.c:390 +0xee
2015/09/01 10:48:41 packer-post-processor-vsphere: runtime.onM(0xc208015600)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s:257 +0x68
2015/09/01 10:48:41 packer-post-processor-vsphere: runtime.mstart()
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/runtime/proc.c:818
2015/09/01 10:48:41 packer-post-processor-vsphere: 
2015/09/01 10:48:41 packer-post-processor-vsphere: goroutine 34 [running]:
2015/09/01 10:48:41 packer-post-processor-vsphere: runtime.switchtoM()
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s:198 fp=0xc2080f7470 sp=0xc2080f7468
2015/09/01 10:48:41 packer-post-processor-vsphere: runtime.mallocgc(0xffffffe00, 0x3288c0, 0x1, 0x14)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/runtime/malloc.go:199 +0x9f3 fp=0xc2080f7520 sp=0xc2080f7470
2015/09/01 10:48:41 packer-post-processor-vsphere: runtime.newarray(0x3288c0, 0xffffffe00, 0xc2080de000)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/runtime/malloc.go:365 +0xc1 fp=0xc2080f7558 sp=0xc2080f7520
2015/09/01 10:48:41 packer-post-processor-vsphere: runtime.makeslice(0x3186a0, 0xffffffe00, 0xffffffe00, 0x0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/runtime/slice.go:32 +0x15c fp=0xc2080f75a0 sp=0xc2080f7558
2015/09/01 10:48:41 packer-post-processor-vsphere: bytes.makeSlice(0xffffffe00, 0x0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/bytes/buffer.go:191 +0x6a fp=0xc2080f75f0 sp=0xc2080f75a0
2015/09/01 10:48:41 packer-post-processor-vsphere: bytes.(_Buffer).ReadFrom(0xc2080104d0, 0x779080, 0xc2080ee040, 0x7fffffc02, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/bytes/buffer.go:163 +0xda fp=0xc2080f7688 sp=0xc2080f75f0
2015/09/01 10:48:41 packer-post-processor-vsphere: io.Copy(0x771808, 0xc2080104d0, 0x779080, 0xc2080ee040, 0x0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/io/io.go:358 +0x13d fp=0xc2080f7740 sp=0xc2080f7688
2015/09/01 10:48:41 packer-post-processor-vsphere: os/exec.func·003(0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/os/exec/exec.go:221 +0x7d fp=0xc2080f77a0 sp=0xc2080f7740
2015/09/01 10:48:41 packer-post-processor-vsphere: os/exec.func·004(0xc20812e1a0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/os/exec/exec.go:328 +0x2d fp=0xc2080f77d8 sp=0xc2080f77a0
2015/09/01 10:48:41 packer-post-processor-vsphere: runtime.goexit()
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc2080f77e0 sp=0xc2080f77d8
2015/09/01 10:48:41 packer-post-processor-vsphere: created by os/exec.(_Cmd).Start
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/os/exec/exec.go:329 +0xb6d
2015/09/01 10:48:41 packer-post-processor-vsphere: 
2015/09/01 10:48:41 packer-post-processor-vsphere: goroutine 1 [select, 32 minutes]:
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/yamux.(_Stream).Read(0xc20810e140, 0xc208133000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/yamux/stream.go:125 +0x3ab
2015/09/01 10:48:41 packer-post-processor-vsphere: bufio.(_Reader).fill(0xc20811c2a0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/bufio/bufio.go:97 +0x1ce
2015/09/01 10:48:41 packer-post-processor-vsphere: bufio.(_Reader).ReadByte(0xc20811c2a0, 0x82, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/bufio/bufio.go:196 +0x86
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/go-msgpack/codec.(_ioDecReader).readn1(0xc2081140c0, 0x16)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/go-msgpack/codec/decode.go:90 +0x45
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/go-msgpack/codec.(_msgpackDecDriver).initReadNext(0xc2081100a0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/go-msgpack/codec/msgpack.go:540 +0x48
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/go-msgpack/codec.(_Decoder).decode(0xc20811c300, 0x30cc40, 0xc2081100c0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/go-msgpack/codec/decode.go:635 +0x59
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/go-msgpack/codec.(_Decoder).Decode(0xc20811c300, 0x30cc40, 0xc2081100c0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/go-msgpack/codec/decode.go:630 +0x7f
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/go-msgpack/codec.(_rpcCodec).read(0xc2080f8300, 0x30cc40, 0xc2081100c0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/go-msgpack/codec/rpc.go:88 +0xd9
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/go-msgpack/codec.(_goRpcCodec).ReadRequestHeader(0xc2080f8300, 0xc2081100c0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/go-msgpack/codec/rpc.go:127 +0x61
2015/09/01 10:48:41 packer-post-processor-vsphere: net/rpc.(_Server).readRequestHeader(0xc208039bc0, 0x771cd8, 0xc2080f8300, 0x0, 0x0, 0xc2081100c0, 0x0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/net/rpc/server.go:575 +0x97
2015/09/01 10:48:41 packer-post-processor-vsphere: net/rpc.(_Server).readRequest(0xc208039bc0, 0x771cd8, 0xc2080f8300, 0xc208118080, 0xc20812e260, 0x3287c0, 0x0, 0x0, 0x0, 0x0, ...)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/net/rpc/server.go:542 +0xa2
2015/09/01 10:48:41 packer-post-processor-vsphere: net/rpc.(_Server).ServeCodec(0xc208039bc0, 0x771cd8, 0xc2080f8300)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/net/rpc/server.go:461 +0x6d
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/mitchellh/packer/packer/rpc.(_Server).Serve(0xc20801f380)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/mitchellh/packer/packer/rpc/server.go:141 +0x26f
2015/09/01 10:48:41 packer-post-processor-vsphere: main.main()
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/mitchellh/packer/plugin/post-processor-vsphere/main.go:14 +0xc7
2015/09/01 10:48:41 packer-post-processor-vsphere: 
2015/09/01 10:48:41 packer-post-processor-vsphere: goroutine 5 [syscall, 34 minutes]:
2015/09/01 10:48:41 packer-post-processor-vsphere: os/signal.loop()
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/os/signal/signal_unix.go:21 +0x1f
2015/09/01 10:48:41 packer-post-processor-vsphere: created by os/signal.init·1
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/os/signal/signal_unix.go:27 +0x35
2015/09/01 10:48:41 packer-post-processor-vsphere: 
2015/09/01 10:48:41 packer-post-processor-vsphere: goroutine 7 [chan receive, 34 minutes]:
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/mitchellh/packer/packer/plugin.func·017()
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/mitchellh/packer/packer/plugin/server.go:92 +0x69
2015/09/01 10:48:41 packer-post-processor-vsphere: created by github.com/mitchellh/packer/packer/plugin.Server
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/mitchellh/packer/packer/plugin/server.go:96 +0xcca
2015/09/01 10:48:41 packer-post-processor-vsphere: 
2015/09/01 10:48:41 packer-post-processor-vsphere: goroutine 8 [IO wait]:
2015/09/01 10:48:41 packer-post-processor-vsphere: net.(_pollDesc).Wait(0xc20807e1b0, 0x72, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/net/fd_poll_runtime.go:84 +0x47
2015/09/01 10:48:41 packer-post-processor-vsphere: net.(_pollDesc).WaitRead(0xc20807e1b0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/net/fd_poll_runtime.go:89 +0x43
2015/09/01 10:48:41 packer-post-processor-vsphere: net.(_netFD).Read(0xc20807e150, 0xc208059000, 0x1000, 0x1000, 0x0, 0x76ff90, 0xc2080da030)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/net/fd_unix.go:242 +0x40f
2015/09/01 10:48:41 packer-post-processor-vsphere: net.(_conn).Read(0xc20802a080, 0xc208059000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/net/net.go:121 +0xdc
2015/09/01 10:48:41 packer-post-processor-vsphere: bufio.(_Reader).fill(0xc20802e2a0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/bufio/bufio.go:97 +0x1ce
2015/09/01 10:48:41 packer-post-processor-vsphere: bufio.(_Reader).Read(0xc20802e2a0, 0xc208116000, 0xc, 0xc, 0xc, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/bufio/bufio.go:174 +0x26c
2015/09/01 10:48:41 packer-post-processor-vsphere: io.ReadAtLeast(0x7717b8, 0xc20802e2a0, 0xc208116000, 0xc, 0xc, 0xc, 0x0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/io/io.go:298 +0xf1
2015/09/01 10:48:41 packer-post-processor-vsphere: io.ReadFull(0x7717b8, 0xc20802e2a0, 0xc208116000, 0xc, 0xc, 0xc, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/io/io.go:316 +0x6d
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/yamux.(_Session).recvLoop(0xc208031550, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/yamux/session.go:373 +0x10d
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/yamux.(_Session).recv(0xc208031550)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/yamux/session.go:361 +0x28
2015/09/01 10:48:41 packer-post-processor-vsphere: created by github.com/hashicorp/yamux.newSession
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/yamux/session.go:104 +0x499
2015/09/01 10:48:41 packer-post-processor-vsphere: 
2015/09/01 10:48:41 packer-post-processor-vsphere: goroutine 9 [select]:
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/yamux.(_Session).send(0xc208031550)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/yamux/session.go:323 +0x554
2015/09/01 10:48:41 packer-post-processor-vsphere: created by github.com/hashicorp/yamux.newSession
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/yamux/session.go:105 +0x4b3
2015/09/01 10:48:41 packer-post-processor-vsphere: 
2015/09/01 10:48:41 packer-post-processor-vsphere: goroutine 10 [select]:
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/yamux.(_Session).keepalive(0xc208031550)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/yamux/session.go:279 +0x106
2015/09/01 10:48:41 packer-post-processor-vsphere: created by github.com/hashicorp/yamux.newSession
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/yamux/session.go:107 +0x4de
2015/09/01 10:48:41 packer-post-processor-vsphere: 
2015/09/01 10:48:41 packer-post-processor-vsphere: goroutine 11 [select, 34 minutes]:
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/yamux.(_Session).AcceptStream(0xc208031550, 0xc200000000, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/yamux/session.go:183 +0x1a8
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/mitchellh/packer/packer/rpc.(_muxBroker).Run(0xc20801f360)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/mitchellh/packer/packer/rpc/mux_broker.go:126 +0x37
2015/09/01 10:48:41 packer-post-processor-vsphere: created by github.com/mitchellh/packer/packer/rpc.NewServer
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/mitchellh/packer/packer/rpc/server.go:42 +0x7a
2015/09/01 10:48:41 packer-post-processor-vsphere: 
2015/09/01 10:48:41 packer-post-processor-vsphere: goroutine 13 [select, 32 minutes]:
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/yamux.(_Stream).Read(0xc20810e280, 0xc2080a1000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/yamux/stream.go:125 +0x3ab
2015/09/01 10:48:41 packer-post-processor-vsphere: bufio.(_Reader).fill(0xc20812c180)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/bufio/bufio.go:97 +0x1ce
2015/09/01 10:48:41 packer-post-processor-vsphere: bufio.(_Reader).ReadByte(0xc20812c180, 0x14c965, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/bufio/bufio.go:196 +0x86
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/go-msgpack/codec.(_ioDecReader).readn1(0xc20814e030, 0x308500)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/go-msgpack/codec/decode.go:90 +0x45
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/go-msgpack/codec.(_msgpackDecDriver).initReadNext(0xc208110140)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/go-msgpack/codec/msgpack.go:540 +0x48
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/go-msgpack/codec.(_Decoder).decode(0xc20812c1e0, 0x30cca0, 0xc20803be30)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/go-msgpack/codec/decode.go:635 +0x59
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/go-msgpack/codec.(_Decoder).Decode(0xc20812c1e0, 0x30cca0, 0xc20803be30, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/go-msgpack/codec/decode.go:630 +0x7f
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/go-msgpack/codec.(_rpcCodec).read(0xc2080dc1c0, 0x30cca0, 0xc20803be30, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/go-msgpack/codec/rpc.go:88 +0xd9
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/hashicorp/go-msgpack/codec.(_goRpcCodec).ReadResponseHeader(0xc2080dc1c0, 0xc20803be30, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/hashicorp/go-msgpack/codec/rpc.go:123 +0x61
2015/09/01 10:48:41 packer-post-processor-vsphere: net/rpc.(_Client).input(0xc20812c240)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/net/rpc/client.go:109 +0xb6
2015/09/01 10:48:41 packer-post-processor-vsphere: created by net/rpc.NewClientWithCodec
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/net/rpc/client.go:201 +0xd0
2015/09/01 10:48:41 packer-post-processor-vsphere: 
2015/09/01 10:48:41 packer-post-processor-vsphere: goroutine 97 [syscall, 32 minutes]:
2015/09/01 10:48:41 packer-post-processor-vsphere: syscall.Syscall6(0x7, 0x3cf, 0xc2080a53dc, 0x0, 0xc2080e0090, 0x0, 0x0, 0xc20802e4e0, 0x3b01, 0xc20802e500)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/syscall/asm_darwin_amd64.s:44 +0x5
2015/09/01 10:48:41 packer-post-processor-vsphere: syscall.wait4(0x3cf, 0xc2080a53dc, 0x0, 0xc2080e0090, 0x90, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/syscall/zsyscall_darwin_amd64.go:32 +0x79
2015/09/01 10:48:41 packer-post-processor-vsphere: syscall.Wait4(0x3cf, 0xc2080a5424, 0x0, 0xc2080e0090, 0x0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/syscall/syscall_bsd.go:162 +0x60
2015/09/01 10:48:41 packer-post-processor-vsphere: os.(_Process).wait(0xc20812e4c0, 0x0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/os/exec_unix.go:22 +0x103
2015/09/01 10:48:41 packer-post-processor-vsphere: os.(_Process).Wait(0xc20812e4c0, 0xc208064000, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/os/doc.go:45 +0x3a
2015/09/01 10:48:41 packer-post-processor-vsphere: os/exec.(_Cmd).Wait(0xc20804c280, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/os/exec/exec.go:364 +0x23c
2015/09/01 10:48:41 packer-post-processor-vsphere: os/exec.(_Cmd).Run(0xc20804c280, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/os/exec/exec.go:246 +0x71
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/mitchellh/packer/post-processor/vsphere.(_PostProcessor).PostProcess(0xc20810e000, 0x778fc0, 0xc208110180, 0x779008, 0xc2081101a0, 0x0, 0x0, 0x0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/mitchellh/packer/post-processor/vsphere/post-processor.go:138 +0x1557
2015/09/01 10:48:41 packer-post-processor-vsphere: github.com/mitchellh/packer/packer/rpc.(_PostProcessorServer).PostProcess(0xc208110000, 0x0, 0xc20800a600, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /private/tmp/packer20150722-94575-5htlfs/src/github.com/mitchellh/packer/packer/rpc/post_processor.go:83 +0x30e
2015/09/01 10:48:41 packer-post-processor-vsphere: reflect.Value.call(0x3a1d40, 0x3dde30, 0x13, 0x459310, 0x4, 0xc2080a5f28, 0x3, 0x3, 0x0, 0x0, ...)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/reflect/value.go:419 +0x10e5
2015/09/01 10:48:41 packer-post-processor-vsphere: reflect.Value.Call(0x3a1d40, 0x3dde30, 0x13, 0xc2080a5f28, 0x3, 0x3, 0x0, 0x0, 0x0)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/reflect/value.go:296 +0xbc
2015/09/01 10:48:41 packer-post-processor-vsphere: net/rpc.(_service).call(0xc2080f8140, 0xc208039bc0, 0xc20811e0a8, 0xc208118080, 0xc20812e260, 0x3287c0, 0xc20800a368, 0xca, 0x3078a0, 0xc20800a600, ...)
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/net/rpc/server.go:382 +0x1f7
2015/09/01 10:48:41 packer-post-processor-vsphere: created by net/rpc.(*Server).ServeCodec
2015/09/01 10:48:41 packer-post-processor-vsphere:  /usr/local/Cellar/go/1.4.2/libexec/src/net/rpc/server.go:476 +0x44a
2015/09/01 10:48:42 Deleting original artifact for build 'vmware-vmx'
2015/09/01 10:48:42 /usr/local/bin/packer-post-processor-vsphere: plugin process exited
2015/09/01 10:48:43 ui error: Build 'vmware-vmx' errored: 1 error(s) occurred:
- Post-processor failed: unexpected EOF
  2015/09/01 10:48:43 Builds completed. Waiting on interrupt barrier...
  2015/09/01 10:48:43 machine readable: error-count []string{"1"}
  2015/09/01 10:48:43 ui error: 
  ==> Some builds didn't complete successfully and had errors:
  2015/09/01 10:48:43 machine readable: vmware-vmx,error []string{"1 error(s) occurred:\n\n\* Post-processor failed: unexpected EOF"}
  2015/09/01 10:48:43 ui error: --> vmware-vmx: 1 error(s) occurred:
- Post-processor failed: unexpected EOF
  2015/09/01 10:48:43 ui: 
  ==> Builds finished but no artifacts were created.
  2015/09/01 10:48:43 waiting for all plugin processes to complete...
  Build 'vmware-vmx' errored: 1 error(s) occurred:
- Post-processor failed: unexpected EOF

==> Some builds didn't complete successfully and had errors:
--> vmware-vmx: 1 error(s) occurred:
- Post-processor failed: unexpected EOF

==> Builds finished but no artifacts were created.
2015/09/01 10:48:43 /usr/local/bin/packer-builder-vmware-vmx: plugin process exited
benjamins-mbp:packer benjaminbailey$ 

@dhoer
Copy link

dhoer commented Sep 8, 2015

+1 on getting this issue resolved

@ubailb1
Copy link

ubailb1 commented Sep 8, 2015

I would agree.

Thanks
Ben

@chriswvu
Copy link

Any updates on this issue ? I'm getting same out of memory error when using the vsphere post-processor.
Thanks

@ubailb1
Copy link

ubailb1 commented Sep 21, 2015

Any update on this issue?

@cbednarski
Copy link
Contributor

I have not dug into this or repro'd yet, but we have changed the msgpack implementation and fixed a lot of race conditions here. I'm curious if this might be incidentally fixed now.

We will be fixing this for sure by 0.9. Sorry to keep you waiting!

@markpeek
Copy link
Collaborator

markpeek commented Nov 5, 2015

Looking at this we'll need to bring up a full vsphere to repro. But looking at the code the output of the ovftool run does get buffered into memory. It's not clear how that could account for GB of data to run the process out of memory but it does mesh with the call stacks. @m1ndful you might want to try running that ovftool command (with the exact command line) and see what is output. Something like this:

ovftool --noSSLVerify=false --acceptAllEulas --name=vm_name --datastore= --diskMode=thick --network= --vmFolder="Folder/Internal Resources" output-vmware-iso/packer-vmware-iso.vmx "vi://domain%login:pass@host.domain/datacenter/host/vSphere Cluster/Resources/vSphere Cluster/Development"

@rvalente
Copy link

Have you verified that the account you're using with packer/ovftool does indeed have all the permissions it needs as well as it can login cleanly?

@m1ndful What version of vSphere vCenter do you have running?

Make sure you are using username@vsphere.local if its a local account or else the login will hang with an EOF error.

@emopinata
Copy link

I just ran into this myself the other day, getting ready to try using the ovftool as mentioned by @markpeek

@emopinata
Copy link

Ok, so digging into it it looks like --network is getting added to the ovftool call, and at least in my instance I wasn't defining that in the template file, so once I added a valid vm_network it worked fine. @m1ndful, I looked at your gist and it looks like you have the same situation I did, so try adding that value. The documentation says that vm_network is optional, but for whatever reason it's getting added to the ovftool execution with no value and I suspect vSphere doesn't like that. If you run the ovftool parameters from the Packer debug log without vm_network defined, the ovftool gives an error with output stating a valid network is required and what the options are for your target. Maybe Packer could capture that response and provide that useful information instead?

Looking at the debug output from @ubailb1 I notice that he's trying to push a Mac OS VM to vSphere, are you running ESXi on that Mac Mini?

@emopinata
Copy link

There is definitely an issue with the vsphere post-processor and eating up memory if the ovftool does something it doesn't expect.

For example, I tried running the same build as before (with vm_network defined) on my Mac, the post-processor started eating memory and would have continued if I didn't kill the process.

Taking the ovftool parameters from the debug logs and running it manually prompted me to accept the SSL fingerprint. Once I did that and re-ran the build it uploaded to vsphere just fine.

@rickard-von-essen rickard-von-essen removed this from the v0.9.0 milestone Mar 26, 2016
@mwhooker
Copy link
Contributor

mwhooker commented Feb 3, 2017

I think this got fixed as part of #3321

Please open a new issue if you continue to encounter this

@mwhooker mwhooker closed this as completed Feb 3, 2017
@hashicorp hashicorp locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants