civo/terraform-provider-civo

Civo provider bug - plugin.(*GRPCProvider).ReadResource call

emctl opened this issue · 2 comments

emctl commented
  • provider registry.terraform.io/civo/civo v1.0.14
│ Error: Plugin did not respond
│ 
│   with civo_kubernetes_cluster.my-cluster,
│   on main.tf line 62, in resource "civo_kubernetes_cluster" "my-cluster":62: resource "civo_kubernetes_cluster" "my-cluster" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more
│ details.Releasing state lock. This may take a few moments...

Stack trace from the terraform-provider-civo_v1.0.14 plugin:

panic: runtime error: index out of range [0] with length 0

goroutine 100 [running]:
github.com/civo/terraform-provider-civo/civo.flattenNodePool(0x140005e0000, 0x1400046c400, 0x9, 0x104d007a0, 0x140007d4510)
        /home/runner/work/terraform-provider-civo/terraform-provider-civo/civo/resource_kubernetes_cluster.go:567 +0xb90
github.com/civo/terraform-provider-civo/civo.resourceKubernetesClusterRead(0x104e92138, 0x140006d2840, 0x1400046c400, 0x104e648e0, 0x140005580f0, 0x1400084b5b0, 0x1400061d8e8, 0x10474198c)
        /home/runner/work/terraform-provider-civo/terraform-provider-civo/civo/resource_kubernetes_cluster.go:406 +0x8c0
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x140001ef260, 0x104e920c8, 0x14000462100, 0x1400046c400, 0x104e648e0, 0x140005580f0, 0x0, 0x0, 0x0)
        /home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.5.0/helper/schema/resource.go:347 +0x118
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0x140001ef260, 0x104e920c8, 0x14000462100, 0x140002942a0, 0x104e648e0, 0x140005580f0, 0x140007da510, 0x0, 0x0, 0x0)
        /home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.5.0/helper/schema/resource.go:624 +0x160
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0x14000434240, 0x104e920c8, 0x14000462100, 0x14000462140, 0x14000462100, 0x104ac902c, 0x104de9b40)
        /home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.5.0/helper/schema/grpc_provider.go:575 +0x380
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ReadResource(0x1400054c480, 0x104e92170, 0x14000462100, 0x140006d2240, 0x1400054c480, 0x10490a030, 0x104df2020)
        /home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.2.1/tfprotov5/server/server.go:298 +0xe4
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler(0x104e22780, 0x1400054c480, 0x104e92170, 0x140007e01b0, 0x140006d21e0, 0x0, 0x104e92170, 0x140007e01b0, 0x14000835000, 0xf38)
        /home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.2.1/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:344 +0x1c8
google.golang.org/grpc.(*Server).processUnaryRPC(0x1400042a540, 0x104e9b4d8, 0x14000092780, 0x14000464100, 0x14000403e30, 0x1053928b0, 0x0, 0x0, 0x0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:1194 +0x3e8
google.golang.org/grpc.(*Server).handleStream(0x1400042a540, 0x104e9b4d8, 0x14000092780, 0x14000464100, 0x0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:1517 +0xa50
google.golang.org/grpc.(*Server).serveStreams.func1.2(0x140003f41f0, 0x1400042a540, 0x104e9b4d8, 0x14000092780, 0x14000464100)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:859 +0x94
created by google.golang.org/grpc.(*Server).serveStreams.func1
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:857 +0x1f8

Error: The terraform-provider-civo_v1.0.14 plugin crashed!
emctl commented

Workaround (sort of):

  • add --refresh=false to your terraform command

This is already fixed