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

failed to create pagerduty escalation policy, #227

Open
AaronMuriel opened this issue May 14, 2020 · 4 comments
Open

failed to create pagerduty escalation policy, #227

AaronMuriel opened this issue May 14, 2020 · 4 comments

Comments

@AaronMuriel
Copy link

Error: POST API call to https://api.pagerduty.com/escalation_policies failed 404 Not Found. Code: 2100, Errors: , Message: Not Found

provider version = 1.7.1

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
terraform enterprise v0.12.23

Affected Resource(s)

Please list the resources as a list, for example:

  • pagerduty escalation policy

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "pagerduty_escalation_policy" "rds_policy" {
  name      = "Rds Policy Team"
  num_loops = 2
  teams     = ["${data.pagerduty_team.devops.id}"]

  rule {
    escalation_delay_in_minutes = 10
    target {
        ......
    }
    target {
        ......
    }  
    target {
        ......
    }

  }
  rule {
    escalation_delay_in_minutes = 10

    target {
        ......
    }
  }
}

Debug Output

Error: POST API call to https://api.pagerduty.com/escalation_policies failed 404 Not Found. Code: 2100, Errors: , Message: Not Found

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan
  2. terraform apply
@stmcallister
Copy link
Contributor

Hi @AaronMuriel ! I'm unable to reproduce this. Can you share some more context? Possibly the call to the API in the logs?

@erhudy
Copy link

erhudy commented Aug 25, 2020

I ran into this same problem and it turned out to be that it was because I was setting a schedule target but I did not specify type = "schedule" in the target.

@jakubjakubik
Copy link

@stmcallister to expand on the reproduction, I've ran into this (and took me way to long to debug).

To repro, use:

 target {
     type = "schedule_reference"
      id   = pagerduty_user.UserName.id
    }

Besides the PD api returning a 404 that doesn't really point to the issue, the plan actually works fine!
Is it possible to verify the references during plan to check if the given ID is actually a user or schedule ref?

@brenwhyte
Copy link
Contributor

I hit this issue (I think) today too.

I imported the pagerduty_escalation_policy but I found I had to use the actual ID of the schedule vs say using pagerduty_schedule.primary-schedule.id

  rule {
    escalation_delay_in_minutes = 180
    target {
      type = "schedule_reference"
      id   = "pagerduty_schedule.primary-schedule.id"
    }
  }

Error:
Error: PUT API call to https://api.pagerduty.com/escalation_policies/PY58QW9 failed 404 Not Found. Code: 2100, Errors: <nil>, Message: Not Found

  rule {
    escalation_delay_in_minutes = 180
    target {
      type = "schedule_reference"
      id   = "PF0KXXX"
    }
  }

^^ Working

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

5 participants