Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Add Additional Extensible Attribute to infoblox_ip_allocation Resource with IPv6 #390

Open
ppieprzycki opened this issue Oct 11, 2024 · 0 comments

Comments

@ppieprzycki
Copy link

When attempting to add an additional extensible attribute (ext_attr) to an existing infoblox_ip_allocation resource using an IPv6 CIDR, the operation results in a crash.

This issue only occurs when using an IPv6 address. When using IPv4, the issue is not present.

Steps to Reproduce:

  1. Define the infoblox_ip_allocation resource with an initial ext_attr and an IPv6 address.
resource "infoblox_ip_allocation" "test_ip" {
  provider = infoblox.static
  ipv6_cidr = "2a00:1111:2222:3333:3::/80"
  fqdn  = "testip.testzone.io"
  enable_dns = false
  comment = "managed by tf"
  ext_attrs = jsonencode(
    {
        "ExtAttr1" = 10      
    }
  )
}

  1. Apply the configuration with terraform apply and verify the resource.

  2. Modify the ext_attrs by adding an additional attribute (e.g., ExtAttr2).

  ~ resource "infoblox_ip_allocation" "test_ip" {
      ~ ext_attrs           = jsonencode(
          ~ {
              + ExtAttr2    = 10
                # (1 unchanged element hidden)
            }
        )
        id                  = "..."
        # (10 unchanged attributes hidden)
    }
  1. Attempt to apply the updated configuration.

Expected Behavior: Terraform should update the resource with the new extensible attribute without errors.

Actual Behavior: Terraform crashes with the following stack trace:

Stack trace from the terraform-provider-infoblox_v2.7.0 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1033396d4]

goroutine 65 [running]:
github.com/infobloxopen/terraform-provider-infoblox/infoblox.resourceAllocationUpdate(0x1400052cf00, {0x1035c1500?, 0x1400007c380})
        github.com/infobloxopen/terraform-provider-infoblox/infoblox/resource_infoblox_ip_allocation.go:497 +0x964
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0x10366f3e8?, {0x10366f3e8?, 0x14000373170?}, 0xd?, {0x1035c1500?, 0x1400007c380?})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:828 +0x134
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x14000111340, {0x10366f3e8, 0x14000373170}, 0x14000426c30, 0x1400052cd80, {0x1035c1500, 0x1400007c380})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/resource.go:947 +0x658
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x14000328378, {0x10366f3e8?, 0x14000373080?}, 0x140005e25f0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.34.0/helper/schema/grpc_provider.go:1153 +0xb08
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x14000235400, {0x10366f3e8?, 0x14000372630?}, 0x140001c6070)
        github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/tf5server/server.go:865 +0x2b0
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x103635e20?, 0x14000235400}, {0x10366f3e8, 0x14000372630}, 0x1400052c000, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.23.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:518 +0x164
google.golang.org/grpc.(*Server).processUnaryRPC(0x14000144e00, {0x10366f3e8, 0x140003724e0}, {0x103673950, 0x1400023a300}, 0x14000000240, 0x140003279e0, 0x103b932f8, 0x0)
        google.golang.org/grpc@v1.64.0/server.go:1379 +0xba0
google.golang.org/grpc.(*Server).handleStream(0x14000144e00, {0x103673950, 0x1400023a300}, 0x14000000240)
        google.golang.org/grpc@v1.64.0/server.go:1790 +0xc80
google.golang.org/grpc.(*Server).serveStreams.func2.1()
        google.golang.org/grpc@v1.64.0/server.go:1029 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 25
        google.golang.org/grpc@v1.64.0/server.go:1040 +0x150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant