Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Plugin crash when weave not running #1906

Closed
bboreham opened this issue Jan 17, 2016 · 1 comment
Closed

Plugin crash when weave not running #1906

bboreham opened this issue Jan 17, 2016 · 1 comment
Assignees
Milestone

Comments

@bboreham
Copy link
Contributor

If someone (e.g. the weave script) tries to create a network when the weave container is not running, the plugin crashes after failing to obtain the default subnet:

DEBU: 2016/01/17 15:32:49.723144 RequestPool weavelocal   map[]
DEBU: 2016/01/17 15:32:49.723190 Getting IP for container weave
DEBU: 2016/01/17 15:32:49.724726 Networks:  map[host:{ 0   0   }]
DEBU: 2016/01/17 15:32:49.724773 weave GET to http://127.0.0.1:6784/ipinfo/defaultsubnet with map[]
DEBU: 2016/01/17 15:32:49.724919 RequestPool returning  <nil> Get http://127.0.0.1:6784/ipinfo/defaultsubnet: dial tcp 127.0.0.1:6784: getsockopt: connection refused
2016/01/17 15:32:49 http: panic serving @: runtime error: invalid memory address or nil pointer dereference
goroutine 16 [running]:
net/http.(*conn).serve.func1(0xc82006a370, 0x7f72976b4a30, 0xc820022198)
    /usr/local/go/src/net/http/server.go:1287 +0xb5
net.networkNumberAndMask(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/ip.go:433 +0x42
net.(*IPNet).String(0x0, 0x0, 0x0)
    /usr/local/go/src/net/ip.go:483 +0x42
github.com/weaveworks/weave/plugin/ipam.(*ipam).RequestPool(0xc82009ce80, 0xc820107260, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40000000, 0x0, ...)
    /go/src/github.com/weaveworks/weave/plugin/ipam/driver.go:38 +0x4b8
github.com/weaveworks/weave/plugin/skel.(*listener).requestPool(0xc8200ac420, 0x7f72976b61e0, 0xc82006a630, 0xc82009a9a0)
    /go/src/github.com/weaveworks/weave/plugin/skel/listener.go:209 +0x13f
github.com/weaveworks/weave/plugin/skel.(*listener).(github.com/weaveworks/weave/plugin/skel.requestPool)-fm(0x7f72976b61e0, 0xc82006a630, 0xc82009a9a0)
    /go/src/github.com/weaveworks/weave/plugin/skel/listener.go:65 +0x3e
net/http.HandlerFunc.ServeHTTP(0xc8200bf9f0, 0x7f72976b61e0, 0xc82006a630, 0xc82009a9a0)
@bboreham
Copy link
Contributor Author

To reproduce:

$ weave stop
$ weave launch-plugin
$ docker logs weave-plugin

awh added a commit that referenced this issue Feb 2, 2016
Return an error when weave isn't running, on RequestPool
@awh awh closed this as completed Feb 2, 2016
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

2 participants