-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
GCP SA key creation with "new value: Root resource was present, but now absent" #17332
GCP SA key creation with "new value: Root resource was present, but now absent" #17332
Comments
It looks similar to the issue #13364 so maybe you can try adding more time between the google_service_account and google_service_account_key or try with a google_cloud_scheduler_job https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_scheduler_job |
Is the delay to account for eventual consistency on the Google Cloud Platform side? Our team has encountered this a couple of times but I noticed the resourceGoogleServiceAccountKeyCreate uses a tail call to resourceGoogleServiceAccountKeyRead. It seems like that tail call read could be the issue with the eventually consistency which ends up removing the key from our state file. I think a delay in the provider would be needed in that case as adding a delay as suggested would be too late and not help. Perhaps better yet would to be remove the tail call resourceGoogleServiceAccountKeyRead entirely and let any delay or validation happen for whatever reads the value later. |
@edwardmedia Can you take a look at this issue considering your delay suggestions from #13364? It seems like something that needs to be addressed by the provider if my rudimentary understanding of Terraform and Go is correct. |
we are also experiencing this intermittently when it fails, it fails in similar way as OP
—
|
I've got new facts: it's happening for sure, when you delete old and create a new key for the service account.
This log presents the plan portion and later on the error message:
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
to expedite investigation and resolution of this issue.
Terraform Version
Affected Resource(s)
google_service_account_key
Terraform Configuration
Debug Output
This issue occurs randomly, so I won't be pasting the code here.
Just run the script and it will output error - for me it did at the first run:
Expected Behavior
SA key rotated without and error
Actual Behavior
Randomly an error occurs
Steps to reproduce
Important Factoids
Error occurs randomly, possibly when you make a lot of operations on the SA or SA keys.
References
Definitely can relate to this issue: #13364
b/327622972
The text was updated successfully, but these errors were encountered: