terraform-provider-scaleway icon indicating copy to clipboard operation
terraform-provider-scaleway copied to clipboard

Getting error when destroying rdb_privilege

Open maarous opened this issue 3 years ago • 1 comments
trafficstars

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

v1.1.5

Affected Resource(s)

scaleway_rdb_privilege

Terraform Configuration Files

resource "scaleway_rdb_privilege" "permission" {
  for_each = var.permissions

  instance_id   = scaleway_rdb_instance.main.id

  user_name     = each.value.user_name
  database_name = each.value.database_name
  permission    = each.value.permission

  depends_on = [scaleway_rdb_user.user, scaleway_rdb_database.databases]
}

with this variables:

permissions = {
  "application-default" = {
    user_name = "application"
    database_name = "default"
    permission = "all"
  },
  "application-core" = {
    user_name = "application"
    database_name = "core"
    permission = "all"
  },
  "user-core" = {
    user_name = "user"
    database_name = "core"
    permission = "readonly"
  }
}

Debug Output

scaleway_rdb_privilege.permission["user-core"]: Destroying... [id=fr-par/67611c41-39eb-43a5-92cb-ae739c317c54]
scaleway_rdb_privilege.permission["application-default"]: Destroying... [id=fr-par/67611c41-39eb-43a5-92cb-ae739c317c54]
scaleway_rdb_privilege.permission["application-core"]: Destroying... [id=fr-par/67611c41-39eb-43a5-92cb-ae739c317c54]
scaleway_rdb_privilege.permission["application-core"]: Destruction complete after 1s
scaleway_rdb_privilege.permission["application-default"]: Destruction complete after 1s
╷
│ Error: scaleway-sdk-go: http error 409 Conflict: tuple concurrently updated

Expected Behavior

All rdb_privileges get destroyed without any errors.

Actual Behavior

Some rdb_privileges get destroyed the terraform output an error. It needs another terraform destroy execution to destroy all the other rdb_privileges.

maarous avatar Feb 12 '22 13:02 maarous

Blocked by https://github.com/hashicorp/terraform-plugin-sdk/issues/536

remyleone avatar May 11 '22 14:05 remyleone

Already fixed after version V2.2.1. The fix here #1057

Monitob avatar Nov 14 '22 14:11 Monitob