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

404 error finding datadog_integration_pagerduty_service_object #299

Closed
ryanisnan opened this issue Aug 22, 2019 · 4 comments · Fixed by #304
Closed

404 error finding datadog_integration_pagerduty_service_object #299

ryanisnan opened this issue Aug 22, 2019 · 4 comments · Fixed by #304

Comments

@ryanisnan
Copy link

Hello,

I am encountering an issue with the datadog pagerduty integration, specifically, the datadog_integration_pagerduty_service_object resource.

Initial creation of the resource works via terraform plan / apply.

Subsequent updates fail with:

Error: Error refreshing state: 1 error occurred:
	* module.main_monolith_dd_monitors.datadog_integration_pagerduty_service_object.datadog_pd_integration: 1 error occurred:
	* module.main_monolith_dd_monitors.datadog_integration_pagerduty_service_object.datadog_pd_integration: datadog_integration_pagerduty_service_object.datadog_pd_integration: API error 404 Not Found: {"errors": ["Service not found"]}

The configuration for the resource is:

resource "datadog_integration_pagerduty_service_object" "datadog_pd_integration" {
  depends_on   = ["datadog_integration_pagerduty.pd"]
  service_name = "${var.pd_service_name}"
  service_key  = "${var.pd_service_key}"
}

The variable pd_service_name or pd_service_key do not change between the initial creation and subsequent updates.

An odd workaround I've found is to remove the datadog_integration_pagerduty_service_object from state manually, and re-plan/applying.

Terraform Version

➜ production git:(master) ✗ terraform -v
Terraform v0.11.14

  • provider.aws v1.60.0
  • provider.datadog v2.2.0
  • provider.grafana v1.5.0
  • provider.pagerduty v1.3.1
  • provider.random v2.2.0
  • provider.sentry (unversioned)
  • provider.template v2.1.2

Affected Resource(s)

  • datadog_integration_pagerduty_service_object

Expected Behavior

I would expect my module to be updated.

Actual Behavior

The module does not get updated, as the datadog_integration_pagerduty_service_object is not found.

Steps to Reproduce

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

  1. terraform apply

Important Factoids

There are two modules at play here. 1 module creates the pagerduty_service and the pagerduty_service_integration to datadog.

The other module is the one that implements the datadog_integration_pagerduty_service_object as well as several monitors. The second module is where the failure is occurring.

@yongzhang
Copy link

I have the same issue

@bkabrda
Copy link
Contributor

bkabrda commented Aug 23, 2019

Hey @ryanisnan thanks for the report. Did you add individual_services = true to the datadog_integration_pagerduty resource as documented in [1]? If so, could you also post what terraform shows as plan on the terraform apply run that makes this fail?

[1] https://www.terraform.io/docs/providers/datadog/r/integration_pagerduty.html#example-usage

@alekhrycaiko
Copy link

alekhrycaiko commented Aug 27, 2019

@bkabrda I have set individual_services=true to datadog_integration_pagerduty and run into the error documented above. The terraform plan itself, just refreshes state and then fails with the documented error.

In order to get this error, I created a plan and applied it which resulted in removing a datadog monitor. Later on, I realized that this was unnecessary and plan/applied to re-add the monitor and resulted in the failure mentioned above.

@bkabrda
Copy link
Contributor

bkabrda commented Aug 28, 2019

Thanks for the additional information @alekhrycaiko, I have reproduced the error and I think I know where the issue is. I'll try to push a fix today.

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

Successfully merging a pull request may close this issue.

4 participants