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

invalid memory address or nil pointer dereference

Open gkor75 opened this issue 3 years ago • 0 comments

Environment

  • TMOS/Bigip Version: 16.1.x
  • HA Pair - please mind that there are two management addresses, so they cannot be defined in the 'provider' section
  • Terraform Version: v1.2.1
  • Terraform bigip provider Version: v1.15.1
  • AWS environment

Summary

BigIP Provider crashes with invalid memory address or nil pointer dereference, while trying to send Declarative Onboarding. Full message:

│ Error: Plugin did not respond
│ 
│   with bigip_do.bigIP_0,
│   on bigIP.tf line 197, in resource "bigip_do" "bigIP_0":
│  197: resource "bigip_do" "bigIP_0" {
│ 
│ 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.15.1 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0xc57df5]

goroutine 66 [running]:
github.com/F5Networks/terraform-provider-bigip/bigip.resourceBigipDoCreate(0xe07c80?, {0xf19b20?, 0x0})
        github.com/F5Networks/terraform-provider-bigip/bigip/resource_bigip_do.go:103 +0x255
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc00051b900, 0xc0000e2be0, 0xc00063c7a0, {0xf19b20, 0x0})
        github.com/hashicorp/[email protected]/helper/schema/resource.go:305 +0x438
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc000560980, 0xc000337818, 0xc000636e38?, 0x7?)
        github.com/hashicorp/[email protected]/helper/schema/provider.go:294 +0x70
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc000012be8, {0xc000702a80?, 0x51f946?}, 0xc000702a80)
        github.com/hashicorp/[email protected]/internal/helper/plugin/grpc_provider.go:885 +0x805
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xee1b20?, 0xc000012be8}, {0x10df7b0, 0xc000794150}, 0xc000702a20, 0x0)
        github.com/hashicorp/[email protected]/internal/tfplugin5/tfplugin5.pb.go:3189 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000176480, {0x10e3820, 0xc000296000}, 0xc0006ee500, 0xc00048fc50, 0x16a33a0, 0x0)
        google.golang.org/[email protected]/server.go:995 +0xe1e
google.golang.org/grpc.(*Server).handleStream(0xc000176480, {0x10e3820, 0xc000296000}, 0xc0006ee500, 0x0)
        google.golang.org/[email protected]/server.go:1275 +0xa16
google.golang.org/grpc.(*Server).serveStreams.func1.1()
        google.golang.org/[email protected]/server.go:710 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/[email protected]/server.go:708 +0xea

Error: The terraform-provider-bigip_v1.15.1 plugin crashed!

Steps To Reproduce

Steps to reproduce the behavior:

  1. Define a terraform code to create BigIP cluster

  2. Define a terraform code to prepare Declarative Onboarding declaration for the first cluster member

  3. Define BigIP provider resources to send DO:

provider "bigip" {
  username               = "bigipuser"
  password               = var.password
  
}

resource "bigip_do" "bigIP_0" {
  do_json               = data.template_file.DO[0].rendered
  bigip_address         = module.bigip[0].private_addresses.mgmt_private.private_ip[0]
}
  1. terraform apply

Or, set up a zoom session with [email protected]

Expected Behavior

Provider doesn't crash

Actual Behavior

Provider crashes

gkor75 avatar Sep 01 '22 11:09 gkor75