-
Notifications
You must be signed in to change notification settings - Fork 212
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
pagerduty_service_event_rule is unreliable, 404 Not Found during apply #428
Comments
I noticed the same thing and that the position was not really being stable either, one workaround I found was to make each service event rule depend on the pervious one so that they are created in the correct order. |
Thanks, that would help making sure you don't have to apply multiple times to get the order of rules correct. However, it doesn't solve the race condition where terraform thinks something has been deployed and adds it to the state file and PD API doesn't know about the resources and returns a 404 |
@idsvandermolen very true, the a release may have fixed the race condition. As I'm no longer seeing these errors & the PR you linked to has been merged. |
@jjm Running the terraform apply with TF_LOG=debug show that API acknowledge resource creation. In my opinion, this is more an Pagerduty API bug than a Terraform provider one. |
👋
I'm currently setting up the workaround. |
Hello! I have connected with the Engineering team and can confirm that they recommended slowing down the requests for creating rules, as @jbfavre mentioned above. An approach I just tested with the code above is to add a Here's an example of using the
|
Fix Service Event Rules Tests...and Updated the Version of TF SDK
Rules are being deprecated and replaced |
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.Affected Resource(s)
Please list the resources as a list, for example:
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Code
We have a
service
module withmain.tf
like this:And then call the module like this:
Expected Behavior
When deploying larger changes we expect them to succeed.
Actual Behavior
What actually happened?
During first
apply
we see messages about resources still being created, then it fails with a 404 Not Found:If you try to run the
terraform plan
, the refreshing fails with the same error (404 Not Found). The work-around is to delete these "not found" resources from terraform state withterraform state rm <resource>
and try again.Note: we create the
pagerduty_service
and the accompanyingservice_event_rule
s in the sameterraform apply
. There might be a race condition where the terraform pagerduty provider does not processservice
=>service_event_rule
dependency correctlySteps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
The text was updated successfully, but these errors were encountered: