Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Pagerduty Provider Issue: Warning: Invalid argument supplied for foreach() #67

Open
kotowick opened this issue Oct 2, 2017 · 1 comment

Comments

@kotowick
Copy link

kotowick commented Oct 2, 2017

Hi there,

I am receiving this error from the Pagerduty provider.

PHP Warning:  Invalid argument supplied for foreach() in /var/www/opsweekly/providers/oncall/pagerduty.php on line 109, referer: http://localhost/add.php

I don't think the returned JSON data has this key: 'trigger_summary_data'.

Steps to reproduce:

  • go to opsweekly
  • click Add at the top nav
  • click "I was on call"
  • tail the opsweekly.error.log

Config settings:
$pagerduty_api_key='SOME_API_KEY'
// Note: I tried both version of the APIS (v1 and 2, same error).
$pagerduty_base_url='https://api.pagerduty.com'

$teams = array( $hostname => array( "root_url" => ".", "display_name" => "Ops", "email_report_to" => $email_report_to, "database" => "opsweekly", "event_versioning" => "off", "oncall" => array( "provider" => "pagerduty", "provider_options" => array( "pagerduty_service_id" => array('OUR_ACTUAL_SERVICE_ID'), ), "timezone" => "America/New_York", "start" => "friday 18:00", "end" => "friday 18:00", ), "weekly_hints" => array(), "irc_channel" => "#ops" ), );
$oncall_providers = array( "pagerduty" => array( "display_name" => "Pagerduty", "lib" => "providers/oncall/pagerduty.php", "options" => array( "base_url" => $pagerduty_base_url, "apikey" => $pagerduty_api_key, ), ), );

@wacaldwell
Copy link

wacaldwell commented Oct 17, 2018

I'm getting this error as well, but it's happening when I'm trying to set two headers, and I don't seem to be able to figure out the correct way of doing a php array that sets two headers. Upon further inspection I don't even think that's my real issue, it appears that the 3rd party service (pagerduty) has changed their endpoints and now opsweekly will stop working with it after tomorrow, since PD is deprecating their V1 api.

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

No branches or pull requests

2 participants