Hi there,
Terraform Version
$ terraform version
Terraform v1.5.1
Affected Resource(s)
Terraform Configuration Files
I'm trying to convert the following restconf-json config:
to this code:
Debug Output
Stack trace from the terraform-provider-iosxe_v0.1.17 plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x1773c1f]
goroutine 59 [running]:
github.com/netascode/terraform-provider-iosxe/internal/provider.(*Restconf).fromBody(0xc000260ab0, {0x1c27a00, 0xc0005c7da0}, {0x0, {0x0, 0x0}, {0x0, 0x0}, 0x0, 0x0, ...})
github.com/netascode/terraform-provider-iosxe/internal/provider/model_iosxe_restconf.go:117 +0x1c3f
github.com/netascode/terraform-provider-iosxe/internal/provider.(*RestconfResource).Read(0xc000992000, {0x1c27a00, 0xc0005c7da0}, {{{{0x1c2c8f0, 0xc000714090}, {0x1982d20, 0xc000705140}}, {0x1c2edb0, 0xc0000a58b0}}, 0xc000012048, ...}, ...)
github.com/netascode/terraform-provider-iosxe/internal/provider/resource_iosxe_restconf.go:175 +0x5d5
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ReadResource(0xc000163a20, {0x1c27a00, 0xc0005c7da0}, 0xc0005c7e90, 0xc0008b5610)
github.com/hashicorp/[email protected]/internal/fwserver/server_readresource.go:101 +0x617
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ReadResource(0xc000163a20, {0x1c27a00?, 0xc0005c7c50?}, 0xc000426a00)
github.com/hashicorp/[email protected]/internal/proto6server/server_readresource.go:55 +0x27b
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ReadResource(0xc0001e25a0, {0x1c27a00?, 0xc00061a420?}, 0xc0006a41e0)
github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:749 +0x4b1
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ReadResource_Handler({0x1a3de40?, 0xc0001e25a0}, {0x1c27a00, 0xc00061a420}, 0xc0001e0150, 0x0)
github.com/hashicorp/[email protected]/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:386 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001dc1e0, {0x1c2d1d8, 0xc0003a8b60}, 0xc0001f5560, 0xc0002fdd70, 0x211ec10, 0x0)
google.golang.org/[email protected]/server.go:1337 +0xdf0
google.golang.org/grpc.(*Server).handleStream(0xc0001dc1e0, {0x1c2d1d8, 0xc0003a8b60}, 0xc0001f5560, 0x0)
google.golang.org/[email protected]/server.go:1714 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.1()
google.golang.org/[email protected]/server.go:959 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:957 +0x18c
Error: The terraform-provider-iosxe_v0.1.17 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.
Expected Behavior
Generate the same configurations that:
ntp source Gi0/0
ntp server ntp1.domain.com prefer
ntp server ntp2.domain.com
Actual Behavior
Error: The terraform-provider-iosxe_v0.1.17 plugin crashed!
Steps to Reproduce
terraform apply
Important Factoids
I appreciate if you could show the code using resource iosxe_restconf to reproduce the following IOS-XE configuration:
no ntp logging
ntp source Gi0/0
ntp server ntp1.domain.com prefer
ntp server ntp2.domain.com
!
clock timezone TMZ -3
clock summer-time TMZ recurring 3 Sun Oct 0:00 3 Sun Feb 0:00