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

infoblox_ip_allocation failing with capital letters in FQDN when ipv6_cidr is set #389

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

Comments

@mzakonek
Copy link

mzakonek commented Oct 11, 2024

Provider block:

terraform {
  required_providers {
    infoblox = {
      source  = "infobloxopen/infoblox"
      version = "~> 2.7.0"
    }
  }
}

using terraform-provider-infoblox_v2.7.0 .

When trying to create resources with terraform apply:

resource "infoblox_ip_allocation" "load_balancer" {
  fqdn  = "TF.MODULE.TEST.UPPERCASED.${local.dns}"
  ipv4_cidr = "<ipv4 cidr>"
  ipv6_cidr = "<ipv6 cidr>"
  enable_dns = true
}

then everything works as expected and new host gets created with ipv4 and ipv6 address.

But when you rerun the terraform apply, then you will get an error:

infoblox_ip_allocation.load_balancer: Refreshing state... [id=c514f930-f561-47bb-94c4-f669f0bf5048]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # infoblox_ip_allocation.load_balancer will be updated in-place
  ~ resource "infoblox_ip_allocation" "load_balancer" {
      ~ fqdn                = "ib.tf.module.test.uppercased.<your dns>" -> "IB.TF.MODULE.TEST.UPPERCASED.<your dns>"
        id                  = "c514f930-f561-47bb-94c4-f669f0bf5048"
        # (10 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

infoblox_ip_allocation.load_balancer: Modifying... [id=c514f930-f561-47bb-94c4-f669f0bf5048]
╷
│ Error: Plugin did not respond
│ 
│   with infoblox_ip_allocation.load_balancer,
│   on main.tf line 20, in resource "infoblox_ip_allocation" "load_balancer":
│   20: resource "infoblox_ip_allocation" "load_balancer" {
│ 
│ 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-infoblox_v2.7.0 plugin:

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

goroutine 113 [running]:
github.com/infobloxopen/terraform-provider-infoblox/infoblox.resourceAllocationUpdate(0xc000747500, {0xc5bfa0?, 0xc0000ce1c0})
        github.com/infobloxopen/terraform-provider-infoblox/infoblox/resource_infoblox_ip_allocation.go:497 +0xc22
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0xe459e8?, {0xe459e8?, 0xc000014f00?}, 0xd?, {0xc5bfa0?, 0xc0000ce1c0?})
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:828 +0x163
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0001e9340, {0xe459e8, 0xc000014f00}, 0xc00042f6c0, 0xc000747280, {0xc5bfa0, 0xc0000ce1c0})
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:947 +0x83a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0004162d0, {0xe459e8?, 0xc000014e10?}, 0xc0004126e0)
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1153 +0xdbc
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0002bb400, {0xe459e8?, 0xc0000142a0?}, 0xc000290540)
        github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:865 +0x3d0
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xccf800?, 0xc0002bb400}, {0xe459e8, 0xc0000142a0}, 0xc000746000, 0x0)
        github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:518 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000222e00, {0xe459e8, 0xc000014210}, {0xe49f70, 0xc000002180}, 0xc000612000, 0xc00040f9b0, 0x13860b8, 0x0)
        google.golang.org/[email protected]/server.go:1379 +0xe23
google.golang.org/grpc.(*Server).handleStream(0xc000222e00, {0xe49f70, 0xc000002180}, 0xc000612000)
        google.golang.org/[email protected]/server.go:1790 +0x1016
google.golang.org/grpc.(*Server).serveStreams.func2.1()
        google.golang.org/[email protected]/server.go:1029 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 8
        google.golang.org/[email protected]/server.go:1040 +0x135

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

When you try to do the same, but without ipv6_cidr being set:

resource "infoblox_ip_allocation" "load_balancer" {
  fqdn  = "TF.MODULE.TEST.UPPERCASED.${local.dns}"
  ipv4_cidr = "<ipv4 cidr>"
  ipv6_cidr = null
  enable_dns = true
}

then the error doesn't occur. It is only when ipv6_cidr is set and only if you rerun apply.

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