ddelnano / terraform-provider-mikrotik

MIT License
129 stars 28 forks source link

Doesn't seem to work on RouterOS v6.47 #15

Closed holmesb closed 4 years ago

holmesb commented 4 years ago

Built using the current master branch. Trying to create a DNS record using:

resource "mikrotik_dns_record" "main" {
  name = "test"
  address = "10.0.0.1"
}

It plans fine, but errors when try to apply:

panic: runtime error: invalid memory address or nil pointer dereference 2020-07-19T10:14:20.271+0100 [DEBUG] plugin.terraform-provider-mikrotik: [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xd204f6] 2020-07-19T10:14:20.271+0100 [DEBUG] plugin.terraform-provider-mikrotik: 2020-07-19T10:14:20.271+0100 [DEBUG] plugin.terraform-provider-mikrotik: goroutine 52 [running]: 2020-07-19T10:14:20.271+0100 [DEBUG] plugin.terraform-provider-mikrotik: github.com/ddelnano/terraform-provider-mikrotik/mikrotik.recordToData(0x0, 0xc0001c0620, 0xc000036140, 0x5) 2020-07-19T10:14:20.271+0100 [DEBUG] plugin.terraform-provider-mikrotik: /home/user/source/terraform-provider-mikrotik/mikrotik/resource_dns_record.go:135 +0x26 2020-07-19T10:14:20.271+0100 [DEBUG] plugin.terraform-provider-mikrotik: github.com/ddelnano/terraform-provider-mikrotik/mikrotik.resourceServerRead(0xc0001c0620, 0xf9e860, 0xc0004cc840, 0xc0001c0620, 0x0) 2020-07-19T10:14:20.271+0100 [DEBUG] plugin.terraform-provider-mikrotik: /home/user/source/terraform-provider-mikrotik/mikrotik/resource_dns_record.go:68 +0x175 2020-07-19T10:14:20.271+0100 [DEBUG] plugin.terraform-provider-mikrotik: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(Resource).RefreshWithoutUpgrade(0xc000508100, 0xc0006c28c0, 0xf9e860, 0xc0004cc840, 0xc0006f0128, 0x0, 0x0) 2020-07-19T10:14:20.271+0100 [DEBUG] plugin.terraform-provider-mikrotik: /home/user/gopath/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.0.0/helper/schema/resource.go:455 +0x119 2020-07-19T10:14:20.271+0100 [DEBUG] plugin.terraform-provider-mikrotik: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(GRPCProviderServer).ReadResource(0xc00037e060, 0x11f9040, 0xc0006c0c60, 0xc0006c26e0, 0xc00037e060, 0xc0006c0c60, 0xc0006e3a48) 2020-07-19T10:14:20.271+0100 [DEBUG] plugin.terraform-provider-mikrotik: /home/user/gopath/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.0.0/internal/helper/plugin/grpc_provider.go:525 +0x3d8 2020-07-19T10:14:20.271+0100 [DEBUG] plugin.terraform-provider-mikrotik: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ReadResource_Handler(0xf85b60, 0xc00037e060, 0x11f9040, 0xc0006c0c60, 0xc0006cc3c0, 0x0, 0x11f9040, 0xc0006c0c60, 0xc0006f4000, 0x50) 2020-07-19T10:14:20.272+0100 [DEBUG] plugin.terraform-provider-mikrotik: /home/user/gopath/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.0.0/internal/tfplugin5/tfplugin5.pb.go:3153 +0x217 2020-07-19T10:14:20.272+0100 [DEBUG] plugin.terraform-provider-mikrotik: google.golang.org/grpc.(Server).processUnaryRPC(0xc000554160, 0x1203500, 0xc00008b200, 0xc0006ce100, 0xc00036ea20, 0x18e9fd0, 0x0, 0x0, 0x0) 2020-07-19T10:14:20.272+0100 [DEBUG] plugin.terraform-provider-mikrotik: /home/user/gopath/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:995 +0x460 2020-07-19T10:14:20.272+0100 [DEBUG] plugin.terraform-provider-mikrotik: google.golang.org/grpc.(Server).handleStream(0xc000554160, 0x1203500, 0xc00008b200, 0xc0006ce100, 0x0) 2020-07-19T10:14:20.272+0100 [DEBUG] plugin.terraform-provider-mikrotik: /home/user/gopath/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:1275 +0xd3d 2020-07-19T10:14:20.272+0100 [DEBUG] plugin.terraform-provider-mikrotik: google.golang.org/grpc.(Server).serveStreams.func1.1(0xc000500050, 0xc000554160, 0x1203500, 0xc00008b200, 0xc0006ce100) 2020-07-19T10:14:20.272+0100 [DEBUG] plugin.terraform-provider-mikrotik: /home/user/gopath/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:710 +0xa1 2020-07-19T10:14:20.272+0100 [DEBUG] plugin.terraform-provider-mikrotik: created by google.golang.org/grpc.(Server).serveStreams.func1 2020-07-19T10:14:20.272+0100 [DEBUG] plugin.terraform-provider-mikrotik: /home/user/gopath/pkg/mod/google.golang.org/grpc@v1.23.0/server.go:708 +0xa1 2020-07-19T10:14:20.274+0100 [DEBUG] plugin: plugin process exited: path=/home/user/.terraform.d/plugins/terraform-provider-mikrotik pid=244752 error="exit status 2" 2020/07/19 10:14:20 [ERROR] module.systems: eval: terraform.EvalRefresh, err: rpc error: code = Unavailable desc = transport is closing 2020/07/19 10:14:20 [ERROR] module.systems: eval: terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing !!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform crashed! This is always indicative of a bug within Terraform. A crash log has been placed at "crash.log" relative to your current working directory. It would be immensely helpful if you could please report the crash with Terraform1 so that we can fix this.

When reporting bugs, please include your terraform version. That information is available on the first line of crash.log. You can also get it by running 'terraform --version' on the command line.

SECURITY WARNING: the "crash.log" file that was created may contain sensitive information that must be redacted before it is safe to share on the issue tracker.

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform is v0.12.28. Similar error occurs when creating a DHCP lease

ddelnano commented 4 years ago

It seems that the acceptance tests are missing this case. I'll start to look into how to fix this problem but I would encourage you to use the 0.2.2 release (rather than compiling yourself) since that was prior to the large refactoring I did that seems to be the source of this crash.

holmesb commented 4 years ago

Yes replacing master with the 0.2.2 release has fixed. Thank you, great work on this provider BTW.

ddelnano commented 4 years ago

I'm going to leave this open because this bug needs fixed and the acceptance tests need to be updated to prevent this regression.