Skip to content

Provider plugin crashes when nutanix_subnet datasource queried with overlay subnet #327

Closed
@bhati-pradeep

Description

Nutanix Cluster Information

Please provide the version of:

  • pc.2021.7

Terraform Version

1.1.3

Affected Resource(s)

nutanix_subnet

Terraform Configuration Files

provider "nutanix" {
  username  = "<username>"
  password  = "<password>"
  endpoint  = "<ip>"
  insecure  = <true/false>
  port      = <port>
}

data "nutanix_subnet" "subnet" {
	subnet_name = "<overlay_subnet_name>"
}

output "sbnet" {
	value = data.nutanix_subnet.subnet
}

Debug Output

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x19f04ea]

goroutine 51 [running]:
github.com/terraform-providers/terraform-provider-nutanix/nutanix.dataSourceNutanixSubnetRead(0xc000760310, 0x1b2ab00, 0xc0006fcae0, 0xc000760310, 0x0)
	github.com/terraform-providers/terraform-provider-nutanix/nutanix/data_source_nutanix_subnet.go:418 +0x107a
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).ReadDataApply(0xc000195a00, 0xc0006fda20, 0x1b2ab00, 0xc0006fcae0, 0xc000361028, 0x1, 0x0)
	github.com/hashicorp/terraform-plugin-sdk@v1.7.0/helper/schema/resource.go:398 +0x88
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).ReadDataApply(0xc0002af000, 0xc0008b19a0, 0xc0006fda20, 0xc0006fda20, 0x0, 0x0)
	github.com/hashicorp/terraform-plugin-sdk@v1.7.0/helper/schema/provider.go:451 +0x8f
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ReadDataSource(0xc00000e868, 0x1f8a8e0, 0xc00074fda0, 0xc00009ad40, 0xc00000e868, 0xc00074fda0, 0xc000539a48)
	github.com/hashicorp/terraform-plugin-sdk@v1.7.0/internal/helper/plugin/grpc_provider.go:1036 +0x45d
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ReadDataSource_Handler(0x1ce0f80, 0xc00000e868, 0x1f8a8e0, 0xc00074fda0, 0xc00075a4e0, 0x0, 0x1f8a8e0, 0xc00074fda0, 0xc000766400, 0x1ee)
	github.com/hashicorp/terraform-plugin-sdk@v1.7.0/internal/tfplugin5/tfplugin5.pb.go:3225 +0x217
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0003062c0, 0x1f94a20, 0xc0006c2900, 0xc000198600, 0xc0005124b0, 0x26eadf0, 0x0, 0x0, 0x0)
	google.golang.org/grpc@v1.23.0/server.go:995 +0x460
google.golang.org/grpc.(*Server).handleStream(0xc0003062c0, 0x1f94a20, 0xc0006c2900, 0xc000198600, 0x0)
	google.golang.org/grpc@v1.23.0/server.go:1275 +0xd3d
google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc00018a190, 0xc0003062c0, 0x1f94a20, 0xc0006c2900, 0xc000198600)
	google.golang.org/grpc@v1.23.0/server.go:710 +0xa1
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/grpc@v1.23.0/server.go:708 +0xa1

Error: The terraform-provider-nutanix_v1.2.2 plugin crashed!

Panic Output

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x19f04ea]

Expected Behavior

It should work fine and print changes to output

Steps to Reproduce

  1. terraform plan

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions