-
Notifications
You must be signed in to change notification settings - Fork 4.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
Terraform Crash on apply #3106
Comments
I've had similar issues deleting NAT pools when using a VMSS. Do you happen to know if that NAT pool was being referenced by your load balancer at the time you tried to delete it? Perhaps look in the Azure portal as I don't see anything in your terraform file. What I see happening often times is there is an existing reference to the NAT pool inside the VMSS LB, and so terraform is unable to delete it as it is in use. This normally errors the first time around, but perhaps it gets into a bad state afterwards. Often times I just destroy the whole VNET and re-create but my guess is something is not right with the dependencies and there is some existing reference of the NAT pool causing the issue. |
Hi @Lucretius, Yes, I suspect you are correct. The NAT pool was being referenced by LB. The interesting thing is that the resource was in fact deleted although TF crashed. If you are not seeing anything in crash logs then feel free to close this issue. I like the idea of deleting entire deployment, although our model is to have a top-level VNET for all deployments. But I could have certainly deleted the VMSS completely and redeploy. Thank you! |
Crash is here: https://github.com/terraform-providers/terraform-provider-azurerm/blob/v1.23.0/azurerm/loadbalancer.go#L35 This should be fixed with the latest go-autorest update we merged recently; but we should update this to use the utils functions which handle the response being nil too |
This has been released in version 1.44.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 1.44.0"
}
# ... other configuration ... |
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
This issue was originally opened by @marrik96 as hashicorp/terraform#20778. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
Terraform Configuration Files
Debug Output
Crash Output
https://gist.githubusercontent.com/marrik96/1c338c16f6754f9604174ca49272641a/raw/2f48d9378b6718826d4c4c24fc94058aa1d2c3f0/terraform_crash.log
Expected Behavior
Destroy the azurerm_lb_nat_pool resource
Actual Behavior
Terraform crashed
Steps to Reproduce
terraform init
terraform apply
terraform apply
Additional Context
Used terraform to create an Azure Load Balancer with a VM Scale set. Made several modifications to main.tf with no problems and ran subsequest "terraform apply". Finally decided to remove/delete the "azurerm_lb_nat_pool". Deleted this section from main.tf. Ran "terraform apply" and the crashed occurred about ~6 minutes into deployment.
References
The text was updated successfully, but these errors were encountered: