weaveworks / launcher

Weave Cloud Launcher
Apache License 2.0
10 stars 13 forks source link

Agent fails to get active or latest replica set #44

Closed aaron7 closed 6 years ago

aaron7 commented 6 years ago

Happended once locally with minikube.

Agent paniced:

time="2018-02-01T12:12:57Z" level=info msg="kubernetes: targeting api server https://10.0.0.1:443"
time="2018-02-01T12:12:57Z" level=info msg="Updating self from https://get.dev.weave.works/k8s/agent.yaml"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xd85485]

goroutine 21 [running]:
github.com/weaveworks/launcher/vendor/k8s.io/api/extensions/v1beta1.(*ReplicaSet).GetAnnotations(0x0, 0x0)
        <autogenerated>:1 +0x5
github.com/weaveworks/launcher/vendor/k8s.io/kubernetes/pkg/controller/deployment/util.Revision(0x1a11380, 0x0, 0x1, 0x1, 0x0)
        /go/src/github.com/weaveworks/launcher/vendor/k8s.io/kubernetes/pkg/controller/deployment/util/deployment_util.go:236 +0x69
github.com/weaveworks/launcher/pkg/k8s.GetDeploymentReplicaSetRevision(0xc4203362d0, 0x12051ed, 0x5, 0x1208ed7, 0xb, 0x0, 0x0, 0x0)
        /go/src/github.com/weaveworks/launcher/pkg/k8s/deployments.go:26 +0x29f
main.updateAgents(0x7fff6cedae02, 0x2a, 0xc4200e4100, 0x3b, 0x1204223, 0x3, 0x7fff6cedae37, 0x6, 0xc4203362d0, 0xc42005a480)
        /go/src/github.com/weaveworks/launcher/agent/main.go:61 +0x128
main.main.func1(0x0, 0x0)
        /go/src/github.com/weaveworks/launcher/agent/main.go:166 +0xe0
github.com/weaveworks/launcher/vendor/github.com/oklog/run.(*Group).Run.func1(0xc420050ae0, 0xc420050a20, 0xc42028dfb0)
        /go/src/github.com/weaveworks/launcher/vendor/github.com/oklog/run/group.go:38 +0x27
created by github.com/weaveworks/launcher/vendor/github.com/oklog/run.(*Group).Run
        /go/src/github.com/weaveworks/launcher/vendor/github.com/oklog/run/group.go:37 +0xa8

Instead of panic, error instead - PR: https://github.com/weaveworks/launcher/pull/45