thegreenrobot / pagerduty_dashing

A Dashing dashboard for PagerDuty Services & Schedules
MIT License
44 stars 23 forks source link

pagerduty_oncall crashing #18

Closed rhoml closed 9 years ago

rhoml commented 9 years ago

After a while running I see this errors

I have 5 on call schedules so I have 5 boxes on my dashing, the first one shows the information properly but the others just crash. Not sure if Pagerduty has some kind of rate limiting.

2014-11-10T08:40:37.832533+00:00 app[web.1]: ================================================================================
2014-11-10T08:40:37.832542+00:00 app[web.1]: scheduler caught exception:
2014-11-10T08:40:37.832561+00:00 app[web.1]: /app/jobs/pagerduty_oncall.rb:29:in `block (2 levels) in <top (required)>'
2014-11-10T08:40:37.832543+00:00 app[web.1]: undefined method `[]' for nil:NilClass
2014-11-10T08:40:37.832569+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:230:in `call'
2014-11-10T08:40:37.832562+00:00 app[web.1]: /app/jobs/pagerduty_oncall.rb:16:in `each'
2014-11-10T08:40:37.832572+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:230:in `trigger_block'
2014-11-10T08:40:37.832575+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:204:in `block in trigger'
2014-11-10T08:40:37.832578+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/rufus-scheduler-2.0.24/lib/rufus/sc/scheduler.rb:430:in `call'
2014-11-10T08:40:37.832566+00:00 app[web.1]: /app/jobs/pagerduty_oncall.rb:16:in `block in <top (required)>'
2014-11-10T08:40:37.832581+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/rufus-scheduler-2.0.24/lib/rufus/sc/scheduler.rb:430:in `block in trigger_job'
2014-11-10T08:40:37.832594+00:00 app[web.1]: ================================================================================
thegreenrobot commented 9 years ago

Hi there.

A couple of questions:

  1. What happens when you run this locally? All of the Heroku config vars can be created as environment variables and then you can run dashing start from your local dashing directory.
  2. The pagerduty.erb dashboard is just an example. If you are wanting to run a dashboard with 5 on-call schedules you would need to modify the pagerduty-erb template so that the data-id of the box matches the names you are defining in your schedule JSON.
  3. I haven't seen this error but it looks like there's an issue with your schedules hash.
rhoml commented 9 years ago

Hi, yes I develop things first locally.

  1. Happens the same on local.
  2. The dashboards are ok, they where working during the weekend.
  3. PAGERDUTY_SCHEDULES: {"schedules": { "schedule1": "SFSDFDS", "schedule2": "SDFSDFSDF", "schedule3": "AFSDFS", "schedule4": "SDFSDF" }}
thegreenrobot commented 9 years ago

Right on.

So based on the example schedule json you provided, you would have needed to modify the pagerduty.erb template so each "box" has a data-id value like <div data-id="schedule1-name".

Each schedule key in the PAGERDUTY_SCHEDULES hash needs to correspond to a "box" in the pagerduty template.

Also, if you're trying to test this on Heroku for your fork, you'd have to update the app.json and README as it has the URL baked in.

thegreenrobot commented 9 years ago

Closing out this issue. If you are still having problems feel free to reopen.

Thanks, Matt