You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using the NetActuate terraform provider to provision servers. We ran into a index out of range error in the NetActuate provider in the following situation:
Generate an API key for a user that does not have permission to delete servers via API.
Add a machine to the list of servers to be provisioned and run "terraform apply"
Remove the machine from the list of servers and run "terraform apply"
This correctly fails because the user didn't have the setting to allow deletion via API key (fine, no problem)
Run terraform plan after this
Get a panic in the NetActuate provider due to index out of range (message below)
It looks like the NetActuate terraform provider leaves something in an inconsistent state when the server deletion fails due to lack of API permissions, then on the next invocation it tries to look up a non-existent thing in a zero-length array or slice.
I am happy to provide more info, though I think it can be reproduced with the steps above.
Thanks for creating this great resource!
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: Plugin did not respond
│
│ with module.netactuate_vms["derp1i"].netactuate_server.server,
│ on ../lib/netactuate_vm/vm.tf line 77, in resource "netactuate_server" "server":
│ 77: resource "netactuate_server" "server" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more
│ details.
╵
Releasing state lock. This may take a few moments...
Stack trace from the terraform-provider-netactuate_v0.2.2 plugin:
panic: runtime error: index out of range [0] with length 0
goroutine 23 [running]:
github.com/netactuate/terraform-provider-netactuate/netactuate.resourceServerRead({0x1018a7060?, 0x1400022e840?}, 0x140001e7780, {0x101884040?, 0x1400059d1d0})
github.com/netactuate/terraform-provider-netactuate/netactuate/resource_server.go:268 +0x538
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x140004261c0, {0x1018a7060, 0x1400022e840}, 0xd?, {0x101884040, 0x1400059d1d0})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:724 +0xe8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0x140004261c0, {0x1018a7060, 0x1400022e840}, 0x1400018a5b0, {0x101884040, 0x1400059d1d0})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:1015 +0x468
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0x140004b0bb8, {0x1018a7060?, 0x1400022e720?}, 0x1400004cf00)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:613 +0x400
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0x140000a43c0, {0x1018a7060?, 0x1400009bd40?}, 0x140004e2720)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:748 +0x3e8
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x101872100?, 0x140000a43c0}, {0x1018a7060, 0x1400009bd40}, 0x140002bc8c0, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0x140004c0000, {0x1018aaa60, 0x140004d81a0}, 0x14000360ea0, 0x140004be870, 0x101d1b1f0, 0x0)
google.golang.org/[email protected]/server.go:1340 +0xb7c
google.golang.org/grpc.(*Server).handleStream(0x140004c0000, {0x1018aaa60, 0x140004d81a0}, 0x14000360ea0, 0x0)
google.golang.org/[email protected]/server.go:1713 +0x82c
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/[email protected]/server.go:965 +0x84
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:963 +0x290
Error: The terraform-provider-netactuate_v0.2.2 plugin crashed!
The text was updated successfully, but these errors were encountered:
We are using the NetActuate terraform provider to provision servers. We ran into a index out of range error in the NetActuate provider in the following situation:
It looks like the NetActuate terraform provider leaves something in an inconsistent state when the server deletion fails due to lack of API permissions, then on the next invocation it tries to look up a non-existent thing in a zero-length array or slice.
I am happy to provide more info, though I think it can be reproduced with the steps above.
Thanks for creating this great resource!
The text was updated successfully, but these errors were encountered: