-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
panic when variable used in dynamic blocks was requested before it was provided #35863
Comments
Hi @limakzi, thanks for filing this! Are you able to share the configuration around the In addition, it would be great if you run this again with the debug logs enabled: Without the above pieces of information it will be difficult for us to replicate and fix this. Thanks! |
@liamcervante, thank you for quick response. I have updated the issue with:
While the issue appears irregularly, (the exact same plan is executed many times during the day), I will try to put |
Just to add some more context here, The definitions of the provider are not relevant to the panic, the error is related to the evaluation of the The use of The linked issue was related to overrides, are there any other special considerations like that which may come into play here? The plan output also shows the resource as being imported during the plan, can you show how that is happening? |
terraform apply
crashes with properly defined providers
@jbardin Thank you for the context.
Partially. Before the first error report, we had two providers in the state:
Yup.
Unfortunately, I cannot confirm or deny that this problem occurs only during import. It seems, this crash does not occur when using version |
@jbardin Another update. a. Version constraint.
That certainly happened to be not true; it occurred many times since last update even in b. Star
I have changed the code a little bit since we want to use resource "github_repository" "this" {
name = var.name
description = var.description
# [redacted]
dynamic "template" {
for_each = var.template != null ? ["0"] : []
content {
owner = lookup(var.template, "owner", "owner")
repository = lookup(var.template, "repository", "repo")
}
}
# [redacted]
} And it seems like similar stack appeared today again:
|
Thanks for the extra info @limakzi, but I'm still not seeing how we get to the |
@jbardin I can confirm, this |
closing to use #36184 as the primary issue which has a more detailed example |
Terraform Version
Terraform Configuration Files
root/github-lab/provider.tf
root/github-lab/teams/github_importer_lab/terraform.tf
root/github-lab/teams/github_importer_lab/main.tf
modules/github-repository/terraform.tf
modules/github-repository/variables.tf
modules/github-repository/main.tf
Debug Output
Expected Behavior
No crash.
Actual Behavior
Crashes.
Steps to Reproduce
terraform -chdir=root/github-lab/ init
terraform -chdir=root/github-lab/ plan -out=tfplan-github.tfplan -refresh=false
terraform -chdir=root/github-lab/ apply tfplan-github.tfplan
Additional Context
I do use one provider definition in
root/github-lab/terraform.tf
. The only provider, I use isintegrations/github
.References
The text was updated successfully, but these errors were encountered: