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

Backend crash with metrics using a handler with the not_silenced filter #1472

Closed
palourde opened this issue May 7, 2018 · 0 comments
Closed
Assignees
Labels

Comments

@palourde
Copy link
Contributor

palourde commented May 7, 2018

Expected Behavior

The backend shouldn't crash!

Current Behavior

If I have a handler, say slack, that use the not_silenced filter, and I use this handler as --statsd-event-handlers on the agent, sensu-backend will crash:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x180 pc=0x1ac953f]
goroutine 184 [running]:
github.com/sensu/sensu-go/types.(*Event).IsSilenced(...)
    /Users/splourde/golang/src/github.com/sensu/sensu-go/types/event.go:137
github.com/sensu/sensu-go/backend/pipelined.(*Pipelined).filterEvent(0xc4202f3420, 0xc4290809c0, 0xc429396140, 0xc42932acf0)
    /Users/splourde/golang/src/github.com/sensu/sensu-go/backend/pipelined/filter.go:110 +0x4ff
github.com/sensu/sensu-go/backend/pipelined.(*Pipelined).handleEvent(0xc4202f3420, 0xc429396140, 0xc42918af20, 0x0)
    /Users/splourde/golang/src/github.com/sensu/sensu-go/backend/pipelined/handle.go:55 +0x3ce
github.com/sensu/sensu-go/backend/pipelined.(*Pipelined).createPipelines.func1(0xc4202f3420, 0xc429087860)
    /Users/splourde/golang/src/github.com/sensu/sensu-go/backend/pipelined/pipelined.go:129 +0x155
created by github.com/sensu/sensu-go/backend/pipelined.(*Pipelined).createPipelines
    /Users/splourde/golang/src/github.com/sensu/sensu-go/backend/pipelined/pipelined.go:117 +0x70

Possible Solution

The event.IsSilenced() method should ensure a check exists!

Steps to Reproduce (for bugs)

Context

Your Environment

  • Sensu version used (sensuctl, sensu-backend, and/or sensu-agent): master at this time
  • Installation method (packages, binaries, docker etc.): manually
  • Operating System and version (e.g. Ubuntu 14.04): macOS latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant