terraform-provider-gitlab
terraform-provider-gitlab copied to clipboard
Group creation results in "Root resource was present, but now absent"
Terraform Version
terraform version == 1.0.3 (also 1.0.0)
Affected Resource(s)
Please list the resources as a list, for example:
- gitlab_group
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
terraform {
required_providers {
gitlab = {
source = "gitlabhq/gitlab"
version = "3.7.0"
}
}
}
provider "gitlab" {
base_url = "https://gitlab.domain/"
token = "tokenGoesHere"
insecure = true
}
variable "gitlab_token" {
default = []
}
resource "gitlab_group" "tfgroup" {
name = "tfgroup"
path = "tfgroup"
description = "An example group"
}
Debug Output
Panic Output
N/A
Expected Behavior
GitLab Terraform provider creates the group, then successfully reads the group to confirm the state change.
Actual Behavior
The GitLab Terraform provider will create the group, but then will immediately attempt to read the state of the created group. The group itself is created through GitLab, however, GitLab cannot create the group quickly enough for the provider to read the state of the group from the API. Eventually, this will succeed, but on first pass the group creation will fail.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
-
terraform apply
to create the group
Important Factoids
GitLab EE v14.0.0
References
N/A
+1 Using self hosted gitlab instance, same problem with creating groups.
We could probably easily fix this if some waiting conditions / retry logic.
However, I think it's best to get some details on how the Group API is supposed to work. I've created https://gitlab.com/gitlab-org/gitlab/-/issues/352299 for that.
Let's see ...
I've created another upstream issue to tackle these kind of issues: https://gitlab.com/gitlab-org/gitlab/-/issues/365055