-
Notifications
You must be signed in to change notification settings - Fork 15
Go crashed on container startup #12
Copy link
Copy link
Open
Description
When I start the container by docker-compose up with the following configuration:
dns:
container_name: dns_server
image: iverberk/docker-spy
ports:
- "53:53/udp"
- "53:53"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DNS_DOMAIN=devthe container terminates with the errors below:
2016/04/17 15:57:26 Starting DNS server...
2016/04/17 15:57:26 Listening for container events...
2016/04/17 15:57:26 Binding UDP listener to 0.0.0.0:53
2016/04/17 15:57:26 Binding TCP listener to 0.0.0.0:53
2016/04/17 15:57:26 Adding record for 9db0f62a0bc6..
2016/04/17 15:57:26 Adding record for a6d9002dd3c5..
panic: runtime error: slice bounds out of range
goroutine 25 [running]:
runtime.panic(0x7c6f00, 0xa2e6cf)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/panic.c:279 +0xf5
main.(*Spy).mutateContainerInCache(0xc2080003b0, 0x0, 0x0, 0x0, 0x0)
/Users/Ivo/Projects/Go/src/github.com/iverberk/docker-spy/spy.go:45 +0x168
main.(*Spy).readEventStream(0xc2080003b0, 0xc208004960)
/Users/Ivo/Projects/Go/src/github.com/iverberk/docker-spy/spy.go:37 +0x96
created by main.(*Spy).Watch
/Users/Ivo/Projects/Go/src/github.com/iverberk/docker-spy/spy.go:22 +0x7d
goroutine 16 [chan receive]:
main.main()
/Users/Ivo/Projects/Go/src/github.com/iverberk/docker-spy/main.go:67 +0x5b6
goroutine 19 [finalizer wait]:
runtime.park(0x416800, 0xa32740, 0xa30969)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0xa32740, 0xa30969)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/proc.c:1445
goroutine 20 [syscall]:
os/signal.loop()
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/os/signal/signal_unix.go:21 +0x1e
created by os/signal.init·1
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/os/signal/signal_unix.go:27 +0x32
goroutine 21 [syscall]:
syscall.Syscall(0x2f, 0x5, 0x7f9e253d2a40, 0x0, 0x7cca20, 0x1, 0x5d66c5)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/syscall/asm_linux_amd64.s:21 +0x5
syscall.recvmsg(0x5, 0x7f9e253d2a40, 0x0, 0xc208038340, 0x0, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/syscall/zsyscall_linux_amd64.go:1902 +0x56
syscall.Recvmsg(0x5, 0xc208052000, 0x200, 0x200, 0xc208021290, 0x28, 0x28, 0x0, 0x806ee0, 0x0, ...)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/syscall/syscall_linux.go:517 +0x193
net.(*netFD).readMsg(0xc2080263f0, 0xc208052000, 0x200, 0x200, 0xc208021290, 0x28, 0x28, 0x0, 0x0, 0x0, ...)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/fd_unix.go:292 +0x37e
net.(*UDPConn).ReadMsgUDP(0xc20803a038, 0xc208052000, 0x200, 0x200, 0xc208021290, 0x28, 0x28, 0x1, 0x42798a, 0x70b820, ...)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/udpsock_posix.go:96 +0x18a
github.com/miekg/dns.readFromSessionUDP(0xc20803a038, 0xc208052000, 0x200, 0x200, 0x200, 0x200, 0x0, 0x0)
/Users/Ivo/Projects/Go/src/github.com/miekg/dns/udp.go:44 +0xcb
github.com/miekg/dns.(*Server).readUDP(0xc208024a90, 0xc20803a038, 0x77359400, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/Ivo/Projects/Go/src/github.com/miekg/dns/server.go:530 +0x15b
github.com/miekg/dns.(*Server).serveUDP(0xc208024a90, 0xc20803a038, 0x0, 0x0)
/Users/Ivo/Projects/Go/src/github.com/miekg/dns/server.go:411 +0x102
github.com/miekg/dns.(*Server).ListenAndServe(0xc208024a90, 0x0, 0x0)
/Users/Ivo/Projects/Go/src/github.com/miekg/dns/server.go:274 +0x63e
main.func·001()
/Users/Ivo/Projects/Go/src/github.com/iverberk/docker-spy/dns.go:44 +0xdb
created by main.(*DNS).Run
/Users/Ivo/Projects/Go/src/github.com/iverberk/docker-spy/dns.go:48 +0x3b4
goroutine 22 [IO wait]:
net.runtime_pollWait(0x7f9e2555e740, 0x72, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/netpoll.goc:146 +0x66
net.(*pollDesc).Wait(0xc2080264c0, 0x72, 0x0, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/fd_poll_runtime.go:84 +0x46
net.(*pollDesc).WaitRead(0xc2080264c0, 0x0, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/fd_poll_runtime.go:89 +0x42
net.(*netFD).accept(0xc208026460, 0x8d5f88, 0x0, 0x7f9e2555d4b0, 0xb)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/fd_unix.go:419 +0x343
net.(*TCPListener).AcceptTCP(0xc20803a060, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/tcpsock_posix.go:234 +0x5d
github.com/miekg/dns.(*Server).serveTCP(0xc208024ea0, 0xc20803a060, 0x0, 0x0)
/Users/Ivo/Projects/Go/src/github.com/miekg/dns/server.go:380 +0xe0
github.com/miekg/dns.(*Server).ListenAndServe(0xc208024ea0, 0x0, 0x0)
/Users/Ivo/Projects/Go/src/github.com/miekg/dns/server.go:261 +0x37f
main.func·002()
/Users/Ivo/Projects/Go/src/github.com/iverberk/docker-spy/dns.go:53 +0xdb
created by main.(*DNS).Run
/Users/Ivo/Projects/Go/src/github.com/iverberk/docker-spy/dns.go:57 +0x3ea
goroutine 24 [select]:
github.com/fsouza/go-dockerclient.(*eventMonitoringState).monitorEvents(0xc2080260e0, 0xc20804c080)
/Users/Ivo/Projects/Go/src/github.com/fsouza/go-dockerclient/event.go:175 +0x380
created by github.com/fsouza/go-dockerclient.(*eventMonitoringState).enableEventMonitoring
/Users/Ivo/Projects/Go/src/github.com/fsouza/go-dockerclient/event.go:148 +0x113
goroutine 26 [IO wait]:
net.runtime_pollWait(0x7f9e2555e8a0, 0x72, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/runtime/netpoll.goc:146 +0x66
net.(*pollDesc).Wait(0xc2080279c0, 0x72, 0x0, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/fd_poll_runtime.go:84 +0x46
net.(*pollDesc).WaitRead(0xc2080279c0, 0x0, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/fd_poll_runtime.go:89 +0x42
net.(*netFD).Read(0xc208027960, 0xc2080a9000, 0x1000, 0x1000, 0x0, 0x7f9e2555d4b0, 0xb)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/fd_unix.go:242 +0x34c
net.(*conn).Read(0xc20803a0d0, 0xc2080a9000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/net.go:122 +0xe7
bufio.(*Reader).fill(0xc208004a20)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/bufio/bufio.go:97 +0x1b3
bufio.(*Reader).ReadSlice(0xc208004a20, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/bufio/bufio.go:298 +0x22c
net/http.readLine(0xc208004a20, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/http/chunked.go:111 +0x59
net/http.(*chunkedReader).beginChunk(0xc20809b620)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/http/chunked.go:48 +0x45
net/http.(*chunkedReader).Read(0xc20809b620, 0xc20802b201, 0x5ff, 0x5ff, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/http/chunked.go:78 +0xc0
net/http.(*body).readLocked(0xc208038c40, 0xc20802b201, 0x5ff, 0x5ff, 0x6fb360, 0x0, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/http/transfer.go:577 +0x81
net/http.(*body).Read(0xc208038c40, 0xc20802b201, 0x5ff, 0x5ff, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/net/http/transfer.go:572 +0x11a
encoding/json.(*Decoder).readValue(0xc208029040, 0x35, 0x0, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/encoding/json/stream.go:124 +0x557
encoding/json.(*Decoder).Decode(0xc208029040, 0x6ed3e0, 0xc208038d40, 0x0, 0x0)
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/encoding/json/stream.go:44 +0x7a
github.com/fsouza/go-dockerclient.func·004(0xc20804a630, 0xc20803c4d0)
/Users/Ivo/Projects/Go/src/github.com/fsouza/go-dockerclient/event.go:289 +0x18b
created by github.com/fsouza/go-dockerclient.(*Client).eventHijack
/Users/Ivo/Projects/Go/src/github.com/fsouza/go-dockerclient/event.go:307 +0x4a6
Update: I recompiled the docker-spy binary with go 1.6.1 and re-created the Docker image. Now the issue has gone away.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels