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 when the consul-alerts/reminders/ is empty #248

Open
moadqassem opened this issue Feb 15, 2019 · 1 comment
Open

Panic when the consul-alerts/reminders/ is empty #248

moadqassem opened this issue Feb 15, 2019 · 1 comment

Comments

@moadqassem
Copy link
Contributor

Go version: go.11.1
OS: MacOS Mojave
Consul Version: 1.4.2
Consul-Alerts Version: 0.5.0

Description:

When a user creates manually an empty reminder folder (e.g: consul-alerts/reminders/ ), the consul-alerts binary simply panics and that panic doesn't recover which would kill the watching process.

The reason for the panic is, there is no check to see if the reminders folder has some subfolders or not.

panic: runtime error: index out of range

goroutine 1 [running]:
github.com/AcalephStorage/consul-alerts/consul.(*ConsulAlertClient).UpdateCheckData(0xc420290000)
	/go/src/github.com/AcalephStorage/consul-alerts/consul/client.go:306 +0xe98
github.com/AcalephStorage/consul-alerts/consul.NewClient(0xc4200cc30e, 0xe, 0xc4200cc3fd, 0x3, 0xc42002653c, 0x2, 0x1b, 0xc420143c88, 0x40d0e5)
	/go/src/github.com/AcalephStorage/consul-alerts/consul/client.go:63 +0x28f
main.daemonMode(0xc4201c0e10)
	/go/src/github.com/AcalephStorage/consul-alerts/consul-alerts.go:144 +0x66e
main.main()
	/go/src/github.com/AcalephStorage/consul-alerts/consul-alerts.go:58 +0xf4
@moadqassem
Copy link
Contributor Author

Here is the PR which solves the issue: #250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant