Skip to content

Provider crashes in v3.3.0 in terraform plan #289

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

Closed
1 task done
BTMichel opened this issue Apr 19, 2023 · 6 comments · Fixed by #291
Closed
1 task done

Provider crashes in v3.3.0 in terraform plan #289

BTMichel opened this issue Apr 19, 2023 · 6 comments · Fixed by #291
Assignees
Labels
Milestone

Comments

@BTMichel
Copy link

Terraform CLI and Provider Versions

The provider crashes sporadically in version 3.3.0 when performing terraform plan with the following error messages:
image
image

Terraform Configuration

terraform {
  required_providers {
    dns = {
      source  = "hashicorp/dns"
      version = "~> 3.0"
    }
  }
  required_version = "~> 1.0"
}

Expected Behavior

The provider should work as it did in previous versions.

Actual Behavior

The provider crashes

Steps to Reproduce

Perform a terraform plan using the provider in version 3.3.0

How much impact is this issue causing?

High

Logs

No response

Additional Information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@BTMichel BTMichel added the bug label Apr 19, 2023
@SBGoods
Copy link
Contributor

SBGoods commented Apr 19, 2023

Hi @BTMichel,
Sorry that you are running into trouble here. Can you provide more detail about your specific configuration, including the DNS provider configuration, the dns_ptr_record resource configuration and which environment variables if any are set? You can redact all of the values, but it is difficult for us to replicate the issue without knowing what attributes are being set.

Also you mentioned that you are running into this issue sporadically, can you elaborate more on this? Are you not seeing a crash on every plan?

@Halfwalker
Copy link

Can confirm - just started hitting this now ...

Error messages from terraform plan

The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more
│ details.

The plugin.(*GRPCProvider).UpgradeResourceState request was cancelled.
Stack trace from the terraform-provider-dns_v3.3.0_x5 plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xc2fd52]
goroutine 104 [running]:
github.com/hashicorp/terraform-provider-dns/internal/provider.exchange(0xc0001be2d0?, 0xc0?, 0x1a?)
	github.com/hashicorp/terraform-provider-dns/internal/provider/provider.go:447 +0x52
github.com/hashicorp/terraform-provider-dns/internal/provider.resourceDnsRead_framework({{0xc00021a7c0?, 0x0?}, {0xc0006804f8?, 0xc000374310?}}, 0xdf4f80?, 0xc)
	github.com/hashicorp/terraform-provider-dns/internal/provider/provider_framework.go:442 +0x139
github.com/hashicorp/terraform-provider-dns/internal/provider.(*dnsPTRRecordResource).Read(0xc0001344e8, {0xf6ad20, 0xc0001f4570}, {{{{0xf719b8, 0xc0001f5f50}, {0xcfd0a0, 0xc0001f5c20}}, {0xf73068, 0xc000362370}}, 0xc000134520, ...}, ...)
	github.com/hashicorp/terraform-provider-dns/internal/provider/resource_dns_ptr_record.go:[185](https://gitlab.datto.net/syseng/terraform/tf_use1-api_gateway_internal/-/jobs/5965746#L185) +0x25f
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ReadResource(0xc00014fa20, {0xf6ad20, 0xc0001f4570}, 0xc0001f4660, 0xc0000ed3f8)
	github.com/hashicorp/[email protected]/internal/fwserver/server_readresource.go:97 +0x617
github.com/hashicorp/terraform-plugin-framework/internal/proto5server.(*Server).ReadResource(0xc00014fa20, {0xf6ad20?, 0xc0001f4420?}, 0xc00027a740)
	github.com/hashicorp/[email protected]/internal/proto5server/server_readresource.go:53 +0x27b
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.muxServer.ReadResource({0xc0003378f0, 0xc000337950, {0xc0003b2440, 0x2, 0x2}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...}, ...}, ...)
	github.com/hashicorp/[email protected]/tf5muxserver/mux_server_ReadResource.go:26 +0x102
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc0002e35e0, {0xf6ad20?, 0xc000277710?}, 0xc000480480)
	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:748 +0x4b1
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0xdc4e00?, 0xc0002e35e0}, {0xf6ad20, 0xc000277710}, 0xc000374150, 0x0)
	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:383 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001e21e0, {0xf71d60, 0xc00037eea0}, 0xc0000f87e0, 0xc000467260, 0x14cfa30, 0x0)
	google.golang.org/[email protected]/server.go:1345 +0xdf0
google.golang.org/grpc.(*Server).handleStream(0xc0001e21e0, {0xf71d60, 0xc00037eea0}, 0xc0000f87e0, 0x0)
	google.golang.org/[email protected]/server.go:1722 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	google.golang.org/[email protected]/server.go:966 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/[email protected]/server.go:964 +0x28a
Error: The terraform-provider-dns_v3.3.0_x5 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.

@Halfwalker
Copy link

Some config info ...

provider "dns" {
  update {
    server = var.ad_dns_dc # Using the hostname is important in order for an SPN to match
    gssapi {
      realm    = var.ad_realm
      username = var.ad_dns_user
      password   = var.ad_dns_pass
    }
  }
}

The actual resources in the terraform module for DNS - typical values

resource "dns_a_record_set" "a_records" {
  count     = length(var.hostnames)
  zone      = "${var.domain_name}."
  name      = var.hostnames[count.index]
  ttl       = var.host_a_ttl
  addresses = [var.ipaddresses[count.index]]
}

resource "dns_ptr_record" "ptr_records" {
  count = length(var.hostnames)
  zone  = format("%s.%s.in-addr.arpa.", split(".", var.ipaddresses[count.index])[1], split(".", var.ipaddresses[count.index])[0])
  name  = format("%s.%s", split(".", var.ipaddresses[count.index])[3], split(".", var.ipaddresses[count.index])[2])
  ttl   = var.host_ptr_ttl
  ptr   = format("%s.%s.", var.hostnames[count.index], var.domain_name)
}

@SBGoods
Copy link
Contributor

SBGoods commented Apr 20, 2023

Hi @BTMichel and @Halfwalker,

We just released v3.3.1 of the DNS provider which should resolve the panics that you were seeing. Please let us know if you have any other questions or if you are seeing any more issues. Thanks!

@Halfwalker
Copy link

Just ran the tf plan again via Gitlab CI/CD - seems to be working again now. Thanks for the quick fix !

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants