terraform-provider-bigip icon indicating copy to clipboard operation
terraform-provider-bigip copied to clipboard

BigIP provider crash when virtual server configured to use a port list.

Open ajchiarello opened this issue 3 years ago • 11 comments

Environment

  • TMOS/Bigip Version: BIG-IP 14.1.4 Build 0.0.11 Final
  • Terraform Version: 1.0.10
  • Terraform bigip provider Version: 1.12.0

Summary

I've created a virtual_server using the bigip terraform provider. I needed it to use a port list rather than a single port, so I made that change in the GUI, and then ran a terraform plan to see what it would try to change (so I could tell terraform to ignore that change). Instead, the provider crashed when it attempted to refresh the virtual server resource.

Steps To Reproduce

Create a bigip_ltm_virtual_server resource. Go to the web interface and configure the virtual server to use a port list. Run a terraform refresh, plan, or apply.

Output:

╷
│ Error: Request cancelled
│
│   with bigip_ltm_virtual_server.consul,
│   on install-consul.tf line 55, in resource "bigip_ltm_virtual_server" "consul":
│   55: resource "bigip_ltm_virtual_server" "consul" {
│
│ The plugin.(*GRPCProvider).ReadResource request was cancelled.
╵

Stack trace from the terraform-provider-bigip_v1.12.0 plugin:

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

goroutine 42 [running]:
github.com/F5Networks/terraform-provider-bigip/bigip.resourceBigipLtmVirtualServerRead(0xc0003fa070, 0x1020c00, 0xc0002820e0, 0xc0003fa070, 0x0)
        github.com/F5Networks/terraform-provider-bigip/bigip/resource_bigip_ltm_virtual_server.go:372 +0x2c0f
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc000452780, 0xc000576ff0, 0x1020c00, 0xc0002820e0, 0xc00000f348, 0x0, 0x0)
        github.com/hashicorp/[email protected]/helper/schema/resource.go:455 +0x12e
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ReadResource(0xc00000ebb0, 0x11b3610, 0xc0001f3830, 0xc000576f00, 0xc00000ebb0, 0xc0001f3830, 0xc000692a50)
        github.com/hashicorp/[email protected]/internal/helper/plugin/grpc_provider.go:525 +0x3dd
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ReadResource_Handler(0xfdfce0, 0xc00000ebb0, 0x11b3610, 0xc0001f3830, 0xc0002c30e0, 0x0, 0x11b3610, 0xc0001f3830, 0xc00037cfc0, 0x222)
        github.com/hashicorp/[email protected]/internal/tfplugin5/tfplugin5.pb.go:3153 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000c6000, 0x11bbf78, 0xc0002e2c00, 0xc000544500, 0xc0005805d0, 0x1717c70, 0x0, 0x0, 0x0)
        google.golang.org/[email protected]/server.go:995 +0x482
google.golang.org/grpc.(*Server).handleStream(0xc0000c6000, 0x11bbf78, 0xc0002e2c00, 0xc000544500, 0x0)
        google.golang.org/[email protected]/server.go:1275 +0xd2c
google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc00049a1b0, 0xc0000c6000, 0x11bbf78, 0xc0002e2c00, 0xc000544500)
        google.golang.org/[email protected]/server.go:710 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/[email protected]/server.go:708 +0xa5

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

ERRO[0009] 1 error occurred:
        * exit status 1

Expected Behavior

Ideally, that the terraform provider supported port lists for virtual servers. Minimally, that I can add one in the gui and tell terraform to ignore_changes on it. Minimally, that it doesn't crash the provider completely.

ajchiarello avatar Nov 09 '21 20:11 ajchiarello

@ajchiarello - Please provide TF manifest to verify this issue at our end.

trinaths avatar Nov 23 '21 09:11 trinaths

Here's the BIG-IP resources. In this, I do have a port defined under the virtual_server, because one is required to create the resource; as I said in the original post, changing it to a port list in the F5 and then running anything that triggers a terraform refresh will crash the provider.

resource "bigip_ltm_pool" "consul" {
  name     = "/K8S/${var.project_name}-pool"
  monitors = ["/K8S/https_8501"]
}

resource "bigip_ltm_pool_attachment" "consul_web" {
  for_each = local.consul_name_ip_map
  pool     = bigip_ltm_pool.consul.name
  node     = "${bigip_ltm_node.consul[each.key].name}:8501"
}

resource "bigip_ltm_node" "consul" {
  for_each = local.consul_name_ip_map
  name     = "/K8S/${each.key}"
  address  = each.value
}

resource "bigip_ltm_virtual_server" "consul" {
  name                       = "/K8S/${var.project_name}"
  destination                = var.consul_f5_ip
  ip_protocol                = "tcp"
  port                       = "8501"
  pool                       = bigip_ltm_pool.consul.name
  profiles                   = ["/Common/tcp"]
  source_address_translation = "automap"
}

ajchiarello avatar Nov 23 '21 13:11 ajchiarello

Created INFRAANO-599 for internal tracking.

trinaths avatar Nov 23 '21 16:11 trinaths

I have raised BUG - 1068173, for this issue.

urohit011 avatar Dec 17 '21 06:12 urohit011

Is there any timeline for resolving this bug?

ajchiarello avatar Jan 10 '22 13:01 ajchiarello

@ajchiarello - This issue is with another team. We raised this issue BUG - 1068173.

trinaths avatar Jan 11 '22 05:01 trinaths

Greetings, is there any updates on this topic or an ETA for a release covering this? We also have some usecases where portlist setup on VS via the TF provider would be required.

gmouratidis avatar Feb 17 '22 11:02 gmouratidis

@gmouratidis this issue must be resolved in BIGIP to be resolved from ansible. Please followup with BID 1068173

trinaths avatar Feb 17 '22 12:02 trinaths

@trinaths How would one go about following up on the bug ID?

ajchiarello avatar Feb 17 '22 13:02 ajchiarello

I have the same need for port list configuration

malacration avatar Nov 14 '23 16:11 malacration

Hi @gmouratidis, @ajchiarello and @malacration,

Bug ID 1068173 needs to be fixed first on TMOS. To get an update about this bug ID, you need to open a ticket via https://my.f5.com

pgouband avatar Nov 15 '23 09:11 pgouband