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

Panic: Nil pointer dereference when mesh.peer is empty #687

Closed
mattbostock opened this issue Apr 3, 2017 · 0 comments
Closed

Panic: Nil pointer dereference when mesh.peer is empty #687

mattbostock opened this issue Apr 3, 2017 · 0 comments

Comments

@mattbostock
Copy link
Contributor

Found during my local testing with version 0.5.1. It appears that if -mesh.peer is set but empty, Alertmanager will panic:

docker-compose up
Starting alertmanager_peer_one_1
Starting alertmanager_peer_two_1
Attaching to alertmanager_peer_two_1, alertmanager_peer_one_1
peer_two_1  | + cd /alertmanager
peer_two_1  | + exec /usr/local/bin/reefer -t alertmanager.yml.tmpl:alertmanager.yml /alertmanager/alertmanager -log.level=debug -web.external-url=https://alertmanager.example.com -web.listen-address=:9094 -storage.path=data/ -mesh.listen-address=:10004 -mesh.peer=peer_one:10003
peer_one_1  | + cd /alertmanager
peer_one_1  | + exec /usr/local/bin/reefer -t alertmanager.yml.tmpl:alertmanager.yml /alertmanager/alertmanager -log.level=debug -web.external-url=https://alertmanager.example.com -web.listen-address=:9093 -storage.path=data/ -mesh.listen-address=:10003 -mesh.peer=
peer_two_1  | time="2017-04-03T13:05:04Z" level=info msg="Starting alertmanager (version=0.5.1, branch=HEAD, revision=0ea1cac51e6a620ec09d053f0484b97932b5c902)" source="main.go:101"
peer_two_1  | time="2017-04-03T13:05:04Z" level=info msg="Build context (go=go1.8, user=root@33842653d6db, date=20170323-13:45:34)" source="main.go:102"
peer_one_1  | time="2017-04-03T13:05:04Z" level=info msg="Starting alertmanager (version=0.5.1, branch=HEAD, revision=0ea1cac51e6a620ec09d053f0484b97932b5c902)" source="main.go:101"
peer_one_1  | time="2017-04-03T13:05:04Z" level=info msg="Build context (go=go1.8, user=root@33842653d6db, date=20170323-13:45:34)" source="main.go:102"
peer_two_1  | time="2017-04-03T13:05:04Z" level=info msg="Loading configuration file" file=alertmanager.yml source="main.go:195"
peer_two_1  | time="2017-04-03T13:05:04Z" level=info msg="Listening on :9094" source="main.go:250"
peer_one_1  | time="2017-04-03T13:05:04Z" level=info msg="Loading configuration file" file=alertmanager.yml source="main.go:195"
peer_one_1  | panic: runtime error: invalid memory address or nil pointer dereference
peer_one_1  | [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x8092fa]
peer_one_1  |
peer_one_1  | goroutine 14 [running]:
peer_one_1  | github.com/prometheus/alertmanager/vendor/github.com/weaveworks/mesh.(*connectionMaker).connectionTerminated.func1(0xc420036f40)
peer_one_1  | 	/go/src/github.com/prometheus/alertmanager/vendor/github.com/weaveworks/mesh/connection_maker.go:195 +0xfa
peer_one_1  | github.com/prometheus/alertmanager/vendor/github.com/weaveworks/mesh.(*connectionMaker).queryLoop(0xc420050f60, 0xc420050f00)
peer_one_1  | 	/go/src/github.com/prometheus/alertmanager/vendor/github.com/weaveworks/mesh/connection_maker.go:223 +0xf6
peer_one_1  | created by github.com/prometheus/alertmanager/vendor/github.com/weaveworks/mesh.newConnectionMaker
peer_one_1  | 	/go/src/github.com/prometheus/alertmanager/vendor/github.com/weaveworks/mesh/connection_maker.go:74 +0x21a
alertmanager_peer_one_1 exited with code 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants