Error: Plugin did not respond
We captured several terraform plan failure recently. │ Error: Plugin did not respond │ │ with module.system_storage_account.azurerm_storage_account.main, │ on ../../../modules/providers/azure/storage-account/main.tf line 19, in resource "azurerm_storage_account" "main": │ 19: resource "azurerm_storage_account" "main" { │ │ The plugin encountered an error, and failed to respond to the │ plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more │ details. ╷ │ Error: Request cancelled │ │ with module.keyvault_policy.azurerm_key_vault_access_policy.keyvault[0], │ on ../../../modules/providers/azure/keyvault-policy/main.tf line 15, in resource "azurerm_key_vault_access_policy" "keyvault": │ 15: resource "azurerm_key_vault_access_policy" "keyvault" { │ │ The plugin.(*GRPCProvider).UpgradeResourceState request was cancelled. ╵
Also with stack trace logs:
Stack trace from the terraform-provider-azurerm_v3.39.1_x5 plugin:
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4c12582]
goroutine 1950 [running]: github.com/hashicorp/terraform-provider-azurerm/internal/services/containers.resourceKubernetesClusterRead(0xc001d94480, {0x5d01ea0?, 0xc000737000}) github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/kubernetes_cluster_resource.go:2060 +0x9c2 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x6f8e340?, {0x6f8e340?, 0xc001fd32c0?}, 0xd?, {0x5d01ea0?, 0xc000737000?}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.1/helper/schema/resource.go:712 +0x178 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc000b56b60, {0x6f8e340, 0xc001fd32c0}, 0xc001f90750, {0x5d01ea0, 0xc000737000}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.1/helper/schema/resource.go:1015 +0x585 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc00152f980, {0x6f8e340?, 0xc001fd2ea0?}, 0xc001c5a100) github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.1/helper/schema/grpc_provider.go:613 +0x4a5 github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc001930320, {0x6f8e340?, 0xc001fd2780?}, 0xc001127140) github.com/hashicorp/terraform-plugin-go@v0.14.1/tfprotov5/tf5server/server.go:748 +0x4b1 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x63c6d80?, 0xc001930320}, {0x6f8e340, 0xc001fd2780}, 0xc001347b20, 0x0) github.com/hashicorp/terraform-plugin-go@v0.14.1/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x170 google.golang.org/grpc.(*Server).processUnaryRPC(0xc00027a000, {0x6f9e380, 0xc000f9e000}, 0xc002595b00, 0xc001993530, 0xb246a90, 0x0) google.golang.org/grpc@v1.50.1/server.go:1340 +0xd23 google.golang.org/grpc.(*Server).handleStream(0xc00027a000, {0x6f9e380, 0xc000f9e000}, 0xc002595b00, 0x0) google.golang.org/grpc@v1.50.1/server.go:1713 +0xa2f google.golang.org/grpc.(*Server).serveStreams.func1.2() google.golang.org/grpc@v1.50.1/server.go:965 +0x98 created by google.golang.org/grpc.(*Server).serveStreams.func1 google.golang.org/grpc@v1.50.1/server.go:963 +0x28a
Error: The terraform-provider-azurerm_v3.39.1_x5 plugin crashed!
This is always indicative of a bug within the plugin. It would be immensely helpful if you could report the crash with the plugin's maintainers so that it can be fixed. The output above should help diagnose the issue.
By troubleshooting on this, we noticed that there is a bug fix: Fix nil panic by correcting nil check expression: https://github.com/hashicorp/terraform-provider-azurerm/pull/21850 This fix is inclued in terraform-provider-azurerm v3.57.0 (May 19, 2023) https://github.com/hashicorp/terraform-provider-azurerm/blob/v3.57.0/CHANGELOG.md BUG FIXES: data.azurerm_kubernetes_cluster - prevent a panic when some values returned are nil (#21850)