dariusbakunas / terraform-provider-truenas

Experimental terraform provider to manage TrueNAS server
MIT License
72 stars 16 forks source link

plugin crash when importing dataset #19

Open g4bcloud opened 1 year ago

g4bcloud commented 1 year ago

here is the error log:

truenas_dataset.Default: Import prepared! Prepared truenas_dataset for import truenas_dataset.Default: Refreshing state... [id=Samsung] ╷ │ Error: Plugin did not respond │ │ The plugin encountered an error, and failed to respond to the │ plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more details. ╵

Stack trace from the terraform-provider-truenas_v0.11.1 plugin:

panic: runtime error: slice bounds out of range [1:0]

goroutine 43 [running]: github.com/dariusbakunas/terraform-provider-truenas/truenas.newDatasetPath({0xc0000352d8?, 0xc000488ba0?}) github.com/dariusbakunas/terraform-provider-truenas/truenas/resource_truenas_dataset.go:40 +0x16a github.com/dariusbakunas/terraform-provider-truenas/truenas.resourceTrueNASDatasetRead({0xdf51e8, 0xc000488ba0}, 0xc00010d480, {0xc0fd00?, 0xc0000c0ae0}) github.com/dariusbakunas/terraform-provider-truenas/truenas/resource_truenas_dataset.go:311 +0x37c github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).read(0xc0001aca80, {0xdf5220, 0xc0002a5320}, 0xd?, {0xc0fd00, 0xc0000c0ae0}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.1/helper/schema/resource.go:724 +0x12e github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).RefreshWithoutUpgrade(0xc0001aca80, {0xdf5220, 0xc0002a5320}, 0xc000555040, {0xc0fd00, 0xc0000c0ae0}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.1/helper/schema/resource.go:1015 +0x585 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(GRPCProviderServer).ReadResource(0xc0003dc438, {0xdf5220?, 0xc0002a5200?}, 0xc000580900) github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.1/helper/schema/grpc_provider.go:613 +0x497 github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(server).ReadResource(0xc00027adc0, {0xdf5220?, 0xc0002a4630?}, 0xc0004888a0) github.com/hashicorp/terraform-plugin-go@v0.14.1/tfprotov5/tf5server/server.go:748 +0x49e github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0xc8d8e0?, 0xc00027adc0}, {0xdf5220, 0xc0002a4630}, 0xc0001c4380, 0x0) github.com/hashicorp/terraform-plugin-go@v0.14.1/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x170 google.golang.org/grpc.(Server).processUnaryRPC(0xc0002781e0, {0xdf7de0, 0xc000003a00}, 0xc0005c9320, 0xc0003df200, 0x12d8690, 0x0) google.golang.org/grpc@v1.50.1/server.go:1340 +0xd13 google.golang.org/grpc.(Server).handleStream(0xc0002781e0, {0xdf7de0, 0xc000003a00}, 0xc0005c9320, 0x0) google.golang.org/grpc@v1.50.1/server.go:1713 +0xa1b google.golang.org/grpc.(Server).serveStreams.func1.2() google.golang.org/grpc@v1.50.1/server.go:965 +0x98 created by google.golang.org/grpc.(Server).serveStreams.func1 google.golang.org/grpc@v1.50.1/server.go:963 +0x28a

Error: The terraform-provider-truenas_v0.11.1 plugin crashed!