ClouDNS / terraform-provider-cloudns

A Terraform provider for ClouDNS
Mozilla Public License 2.0
1 stars 0 forks source link

State fragility crashes provider #7

Closed sempervictus closed 1 month ago

sempervictus commented 2 months ago

Creating a zone in TF and then deleting it via the GUI crashes the provider when it tries to figure out if the zone/records need to be rebuilt:

╷
│ Error: Plugin did not respond
│ 
│   with cloudns_dns_zone.subdomain-somezone-net,
│   on dns.tf line 24, in resource "cloudns_dns_zone" "subdomain-somezone-net":
│   24: resource "cloudns_dns_zone" "subdomain-somezone-net" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-cloudns_v1.0.1 plugin:

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

goroutine 62 [running]:
github.com/ClouDNS/cloudns-go.Zone.Read({{0x6ab3fc040520, 0x1c}, {0x6ab3fc012334, 0x6}, {0x0, 0x0, 0x0}, {0x0, 0x0}}, 0x6ab3fc60f250)
    github.com/ClouDNS/cloudns-go@v1.0.1/cloudns.go:236 +0x5be

suggest implementing error handling to tell TF that state must be converged back to what is expected in the plan/statefile if what is returned from the API has drifted.

Venkoul99 commented 1 month ago

Hello, the issue with the DNS zone deletion through the UI is fixed now in the new version v1.0.5 of the Terraform provider.

Venkoul99 commented 1 month ago

We'll go ahead and close this issue for now. If you encounter any further problems or have any other questions, please don't hesitate to reach out to us again.