rgeniesse / sensu-pushbullet-handler

A Sensu handler plugin for sending notifications via Pushbullet
MIT License
0 stars 0 forks source link

Handler crashes when no devices are configured in Pushbullet #10

Open rgeniesse opened 5 years ago

rgeniesse commented 5 years ago

Error:

panic: The param 'device_iden' has an invalid value.

goroutine 1 [running]:
main.notifyPushbullet(0xc0001426c0, 0x0, 0x0)
    /Users/rgeniesse/go/src/sensu-pushbullet-handler/main.go:95 +0x329
main.run(0xc00017b680, 0xc0000bd500, 0x0, 0x2, 0x0, 0x0)
    /Users/rgeniesse/go/src/sensu-pushbullet-handler/main.go:80 +0x2a0
sensu-pushbullet-handler/vendor/github.com/spf13/cobra.(*Command).execute(0xc00017b680, 0xc0000b4190, 0x2, 0x2, 0xc00017b680, 0xc0000b4190)
    /Users/rgeniesse/go/src/sensu-pushbullet-handler/vendor/github.com/spf13/cobra/command.go:762 +0x473
sensu-pushbullet-handler/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc00017b680, 0x47, 0xc00017b680, 0xc0001c4300)
    /Users/rgeniesse/go/src/sensu-pushbullet-handler/vendor/github.com/spf13/cobra/command.go:852 +0x2fd
sensu-pushbullet-handler/vendor/github.com/spf13/cobra.(*Command).Execute(0xc00017b680, 0x105ea4d, 0xc000189f88)
    /Users/rgeniesse/go/src/sensu-pushbullet-handler/vendor/github.com/spf13/cobra/command.go:800 +0x2b
main.main()
    /Users/rgeniesse/go/src/sensu-pushbullet-handler/main.go:24 +0x2b
rgeniesse commented 5 years ago

This happens when an old device that use to be associated with Pushbullet has a note pushed to it. Pushbullet for some reason hangs onto them.

If you don't attempt a push, you can loop over them without causing an issue.

Fix would probably need to happen in the Go library used in this handler.