-
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_team_membership can not be deleted when user is in use in pagerduty_schedule #292
Comments
Thanks for reporting this, Dom! It looks like the retry logic is a little greedy. I'll put his on the list to address. |
This is still an issue in |
Hi! I'm using provider version I tries to delete the I have tried to explicit the dependency in the schedule resource: resource "pagerduty_schedule" "primary" {
[...]
depends_on = [pagerduty_user.users, pagerduty_team_membership.team_membership] But it didn't work and I'm still getting the error below pagerduty_team_membership.team_membership[0]: Destroying... [id=PO21JXJ:P2A6JL1]
pagerduty_team_membership.team_membership[0]: Still destroying... [id=PO21JXJ:P2A6JL1, 10s elapsed]
pagerduty_team_membership.team_membership[0]: Still destroying... [id=PO21JXJ:P2A6JL1, 20s elapsed]
[...]
pagerduty_team_membership.team_membership[0]: Still destroying... [id=PO21JXJ:P2A6JL1, 2m0s elapsed]
Error: DELETE API call to https://api.pagerduty.com/teams/P2A6JL1/users/PO21JXJ failed 400 Bad Request. Code: 2001, Errors: [User cannot be removed as they belong to an escalation policy on this team], Message: Invalid Input Provided |
The same behaviour is still happening on version
The call above only returns users set explicitly on the escalation policy and users which are currently on-call according to the set schedule. This can be fixed by setting: agerduty.ListOnCallOptions{UserIds: []string{userID}, Since: "Today", Until: "90d from today"} |
Stills relevant |
Hi all, I discovered something rather un-smooth and wanted to share. Maybe the fix is straight-forward for you.
What I report makes totally sense of course. Yet the error handling of the provider or the API is very misleading.
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Before
After
Before
Panic Output
To reflect the change above TF must replace:
In words
I wanted to replace one user with another. For that I just changed the team membership (replace one member with another).
But, in the schedule the old member was still used.
Expected Behavior
The API/Provider should output, that the object can not be destroyed because it is referenced in a schedule, or even in which schedule.
Can not destroy pagerduty_team_membership.TMTMTM, entity is in use in schedule pagerduty_schedule.EEE
Actual Behavior
See output. Destroy ends in an endless position (or at least I did not wait long enough).
Steps to Reproduce
Described above.
Best regards, Dom
The text was updated successfully, but these errors were encountered: