Closed levtech1 closed 1 year ago
Hi @levtech1, Seems you are providing wrong NDB cluster id. Please get the correct cluster id. You can use below code as well.
data "nutanix_ndb_clusters" "test1" {}
data "nutanix_ndb_cluster" "test" {
cluster_id = data.nutanix_ndb_clusters.test1.clusters[0].id
}
Thank you but even if i provide the wrong ID should it crash the plug in?
I agree. It shouldn't crash the plugin. Moreover, NDB API for cluster doesn't return any error. So the validation for error passes. I will recheck and improve the code to avoid plugin crash in future.
PR: #571
Fix is available in latest v1.8.1 release.
Nutanix Cluster Information
Terraform Version
Your version of Terraform is out of date! The latest version is 1.4.0. You can update by downloading from https://www.terraform.io/downloads.html
Affected Resource(s)
Terraform Configuration Files
data "nutanix_ndb_cluster" "poc004" { cluster_id = "0005cd8a-22f2-9956-0000-000000016d5c" }
resource "nutanix_ndb_database" "dbp" {
}
---> lev.goronshtein@G5QM65D47Q MSSQL % terraform plan data.nutanix_ndb_cluster.poc004: Reading... ╷ │ Warning: Disabled Providers: foundation. Please provide required fields in provider configuration to enable them. Refer docs. │ │ with provider["registry.terraform.io/nutanix/nutanix"], │ on provider.tf line 10, in provider "nutanix": │ 10: provider "nutanix" { │ ╵ ╷ │ Error: Plugin did not respond │ │ with data.nutanix_ndb_cluster.poc004, │ on sql.tf line 1, in data "nutanix_ndb_cluster" "poc004": │ 1: data "nutanix_ndb_cluster" "poc004" { │ │ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadDataSource call. The plugin logs may contain more details. ╵
Stack trace from the terraform-provider-nutanix_v1.8.0 plugin:
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x101618044]
goroutine 22 [running]: github.com/terraform-providers/terraform-provider-nutanix/nutanix.dataSourceNutanixEraClusterRead({0x101b01668, 0x140004fe720}, 0x140000f6780, {0x10198a4a0, 0x140010d50e0}) github.com/terraform-providers/terraform-provider-nutanix/nutanix/data_source_nutanix_ndb_cluster.go:280 +0x1574 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).read(0x14000568b60, {0x101b015f8, 0x1400011a5c0}, 0x140000f6780, {0x10198a4a0, 0x140010d50e0}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/resource.go:358 +0x118 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).ReadDataApply(0x14000568b60, {0x101b015f8, 0x1400011a5c0}, 0x140000f6680, {0x10198a4a0, 0x140010d50e0}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/resource.go:569 +0xf4 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(GRPCProviderServer).ReadDataSource(0x14000114030, {0x101b015f8, 0x1400011a5c0}, 0x14000b8c400) github.com/hashicorp/terraform-plugin-sdk/v2@v2.10.1/helper/schema/grpc_provider.go:1133 +0x434 github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(server).ReadDataSource(0x14000290980, {0x101b016a0, 0x14000b821e0}, 0x14000ad80a0) github.com/hashicorp/terraform-plugin-go@v0.5.0/tfprotov5/tf5server/server.go:478 +0x37c github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler({0x101aab460, 0x14000290980}, {0x101b016a0, 0x14000b821e0}, 0x140004fe180, 0x0) github.com/hashicorp/terraform-plugin-go@v0.5.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:416 +0x1c0 google.golang.org/grpc.(Server).processUnaryRPC(0x1400020ce00, {0x101b0e4f0, 0x140003c6300}, 0x14000d2a000, 0x1400039bc20, 0x102068170, 0x0) google.golang.org/grpc@v1.32.0/server.go:1194 +0xc38 google.golang.org/grpc.(Server).handleStream(0x1400020ce00, {0x101b0e4f0, 0x140003c6300}, 0x14000d2a000, 0x0) google.golang.org/grpc@v1.32.0/server.go:1517 +0xa34 google.golang.org/grpc.(Server).serveStreams.func1.2(0x14000034de0, 0x1400020ce00, {0x101b0e4f0, 0x140003c6300}, 0x14000d2a000) google.golang.org/grpc@v1.32.0/server.go:859 +0x94 created by google.golang.org/grpc.(Server).serveStreams.func1 google.golang.org/grpc@v1.32.0/server.go:857 +0x1f0
Error: The terraform-provider-nutanix_v1.8.0 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.