inwx / terraform-provider-inwx

INWX Terraform Provider plugin for Terraform
MIT License
19 stars 5 forks source link

Plugin crash when trying to refresh a refresh a inwx_nameserver_record that does not exist #17

Closed dzegarra closed 7 months ago

dzegarra commented 10 months ago

I have changed the nameservers of a domain and then I stopped being able to synchronize that domain. terraform plan and terraform apply crash with an error.

In the logs ahead, I'm limiting the refresh to a single resource.

$  terraform plan -parallelism=1 -target=inwx_nameserver_record.voltcyprus_org_cname_beta
inwx_nameserver_record.voltcyprus_org_cname_beta: Refreshing state... [id=voltcyprus.org:571103479]

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Warning: Resource targeting is in effect
│
│ You are creating a plan with the -target option, which means that the result of this plan may not represent all of the changes requested by the current configuration.
│
│ The -target option is not for routine use, and is provided only for exceptional situations such as recovering from errors or mistakes, or when Terraform specifically suggests to use it as part of an error
│ message.
╵
╷
│ Error: Request cancelled
│
│   with inwx_nameserver_record.voltcyprus_org_cname_beta,
│   on voltcyprus.org.tf line 15, in resource "inwx_nameserver_record" "voltcyprus_org_cname_beta":
│   15: resource "inwx_nameserver_record" "voltcyprus_org_cname_beta" {
│
│ The plugin.(*GRPCProvider).ReadResource request was cancelled.
╵

Stack trace from the terraform-provider-inwx_v1.3.2 plugin:

panic: interface conversion: interface {} is nil, not []interface {}

goroutine 54 [running]:
github.com/inwx/terraform-provider-inwx/inwx/internal/resource.resourceNameserverRecordRead({0xd38888, 0xc000538de0}, 0xc0003b9680, {0xb92340?, 0xc000606780})
        github.com/inwx/terraform-provider-inwx/inwx/internal/resource/resource_nameserver_record.go:263 +0xd54
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0000e0a80, {0xd388c0, 0xc000538480}, 0xd?, {0xb92340, 0xc000606780})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.13.0/helper/schema/resource.go:725 +0x12e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc0000e0a80, {0xd388c0, 0xc000538480}, 0xc0003c0750, {0xb92340, 0xc000606780})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.13.0/helper/schema/resource.go:1016 +0x47b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc000355d40, {0xd38818?, 0xc00051a9b0?}, 0xc00012ddc0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.13.0/helper/schema/grpc_provider.go:613 +0x4a5
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc0002068c0, {0xd388c0?, 0xc000517bf0?}, 0xc00039a9c0)
        github.com/hashicorp/terraform-plugin-go@v0.8.0/tfprotov5/tf5server/server.go:746 +0x43d
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0xbf7d00?, 0xc0002068c0}, {0xd388c0, 0xc000517bf0}, 0xc00039a960, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.8.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0002688c0, {0xd3c2b8, 0xc000205860}, 0xc0003bcea0, 0xc000372240, 0x11d6790, 0x0)
        google.golang.org/grpc@v1.45.0/server.go:1282 +0xcef
google.golang.org/grpc.(*Server).handleStream(0xc0002688c0, {0xd3c2b8, 0xc000205860}, 0xc0003bcea0, 0x0)
        google.golang.org/grpc@v1.45.0/server.go:1619 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/grpc@v1.45.0/server.go:921 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.45.0/server.go:919 +0x28a

Error: The terraform-provider-inwx_v1.3.2 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.
fsoederhuyzen commented 9 months ago

Could you provide a sample configuration terraform file which reproduces this issue? Additionally is this issue limited to our live environment or does it affect OTE as well?

ddmler commented 7 months ago

If the problem persists please let us know.