F5Networks / terraform-provider-bigip

Terraform resources that can configure F5 BIG-IP products
https://registry.terraform.io/providers/F5Networks/bigip/latest/docs
Mozilla Public License 2.0
102 stars 118 forks source link

Provider crash when renaming AS3 partition #601

Closed jskirde closed 2 years ago

jskirde commented 2 years ago

Environment

Summary

In our environment, we name AS3 partitions after the common name of the service, the site and some other details. If one of these changes, the partition name changes. When the partition name changes the BIGIP provider crashes.

module.lbaas-pool.bigip_as3.application-site1["site1"]: Still modifying... [id=tfeedev_original_partition_name, 40s elapsed]
╷
│ Error: Plugin did not respond
│
│   with module.lbaas-pool.bigip_as3.application-site1["site1"],
│   on ..\modules\terraform_module-bigip-lbaas-pool\bigip_as3.tf line 276, in resource "bigip_as3" "application-site1":
│  276: resource "bigip_as3"  "application-site1" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-bigip_v1.13.0.exe plugin:

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

goroutine 41 [running]:
github.com/f5devcentral/go-bigip.(*BigIP).DeleteAs3Bigip(0xc0002e40e0, 0xc000236000, 0x57, 0x1, 0xc00020b320, 0x1, 0x1)
        github.com/f5devcentral/go-bigip@v0.0.0-20220302174144-f3febbee09dd/as3bigip.go:165 +0xde9
github.com/F5Networks/terraform-provider-bigip/bigip.resourceBigipAs3Update(0xc00025ad20, 0x14da380, 0xc0002e40e0, 0x0, 0x0)
        github.com/F5Networks/terraform-provider-bigip/bigip/resource_bigip_as3.go:327 +0x89f
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc0005ce080, 0xc000440730, 0xc000086420, 0x14da380, 0xc0002e40e0, 0x13b0e01, 0xc00006f780, 0xc000505470)
        github.com/hashicorp/terraform-plugin-sdk@v1.1.0/helper/schema/resource.go:311 +0x293
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc0005ce880, 0xc00006f8e8, 0xc000440730, 0xc000086420, 0xc0005c9678, 0xc000006478, 0x13b2b00)
        github.com/hashicorp/terraform-plugin-sdk@v1.1.0/helper/schema/provider.go:294 +0xa5
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc0000961b0, 0x1677f70, 0xc0005040f0, 0xc00055a060, 0xc0000961b0, 0xc0005040f0, 0xc0003c1a50)
        github.com/hashicorp/terraform-plugin-sdk@v1.1.0/internal/helper/plugin/grpc_provider.go:885 +0x8c5
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x1499820, 0xc0000961b0, 0x1677f70, 0xc0005040f0, 0xc00055a000, 0x0, 0x1677f70, 0xc0005040f0, 0xc00031c000, 0x2776)
        github.com/hashicorp/terraform-plugin-sdk@v1.1.0/internal/tfplugin5/tfplugin5.pb.go:3189 +0x222
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00014a160, 0x1680ed8, 0xc000051e00, 0xc00050c300, 0xc000504480, 0x1bedde0, 0x0, 0x0, 0x0)
        google.golang.org/grpc@v1.23.0/server.go:995 +0x482
google.golang.org/grpc.(*Server).handleStream(0xc00014a160, 0x1680ed8, 0xc000051e00, 0xc00050c300, 0x0)
        google.golang.org/grpc@v1.23.0/server.go:1275 +0xd4c
google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc0005021a0, 0xc00014a160, 0x1680ed8, 0xc000051e00, 0xc00050c300)
        google.golang.org/grpc@v1.23.0/server.go:710 +0xb2
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.23.0/server.go:708 +0xa8

Error: The terraform-provider-bigip_v1.13.0.exe 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.

Steps To Reproduce

Steps to reproduce the behavior:

This issue is occurring in v 1.11.1, 1.12.0, 1.13.0 (possibly others)

  1. Provide terraform resource config which you are facing trouble along with the output of it. N/A

  2. To get to know more about the issue, provide terraform debug logs N/A

  3. To capture debug logs, export TF_LOG variable with debug ( export TF_LOG= DEBUG ) before runnning terraform apply/plan N/A

  4. As3/DO json along with the resource config( for AS3/DO resource issues ) N/A

Expected Behavior

I expect to be able to rename an AS3 partition in a single run and not encounter an error.

Actual Behavior

Provider crashes with panic: runtime error: index out of range [1] with length 1 when renaming partitions.

trinaths commented 2 years ago

@jskirde please share the TF manifest to try this issue.

Created [INFRAANO-701] for internal tracking.

RavinderReddyF5 commented 2 years ago

@jskirde fixed in v1.14.0