[GH-ISSUE #173] GetVmRefsByName Crash (Downstream terraform-provider-proxmox) #35

Closed
opened 2026-02-28 00:40:16 +03:00 by kerem · 1 comment
Owner

Originally created by @clbx on GitHub (Apr 28, 2022).
Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/173

As described in this comment, it looks like whenever the terraform Proxmox provider attempts to use the api to get a VM by reference, it crashes:

Stack trace from the terraform-provider-proxmox plugin:

panic: interface conversion: interface {} is nil, not []interface {}

goroutine 43 [running]:
github.com/Telmate/proxmox-api-go/proxmox.(*Client).GetVmRefsByName(0x14000314460, {0x1400011e670, 0x5})
	/Users/clbx/go/pkg/mod/github.com/!telmate/proxmox-api-go@v0.0.0-20220427175411-e25c3463f0db/proxmox/client.go:197 +0x768
github.com/Telmate/proxmox-api-go/proxmox.(*Client).GetVmRefByName(...)
	/Users/clbx/go/pkg/mod/github.com/!telmate/proxmox-api-go@v0.0.0-20220427175411-e25c3463f0db/proxmox/client.go:187
github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuCreate(0x14000212f00, {0x1028bef80, 0x140003144b0})
	/Users/clbx/Projects/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:795 +0x12ac
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x140003bc700, {0x1029fd900, 0x14000718000}, 0x14000212f00, {0x1028bef80, 0x140003144b0})
	/Users/clbx/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.14.0/helper/schema/resource.go:695 +0x170
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x140003bc700, {0x1029fd900, 0x14000718000}, 0x1400052e270, 0x14000212d80, {0x1028bef80, 0x140003144b0})
	/Users/clbx/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.14.0/helper/schema/resource.go:837 +0xc14
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x1400000f140, {0x1029fd858, 0x1400011a700}, 0x140001445a0)
	/Users/clbx/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.14.0/helper/schema/grpc_provider.go:1021 +0xedc
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x140000ea3c0, {0x1029fd900, 0x14000111830}, 0x14000708000)
	/Users/clbx/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.9.0/tfprotov5/tf5server/server.go:812 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x1029b4a20, 0x140000ea3c0}, {0x1029fd900, 0x14000111830}, 0x1400010eb40, 0x0)
	/Users/clbx/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.9.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x1c0
google.golang.org/grpc.(*Server).processUnaryRPC(0x140000b6700, {0x102a09ba0, 0x140004024e0}, 0x14000700000, 0x140003d4ba0, 0x102ecb140, 0x0)
	/Users/clbx/go/pkg/mod/google.golang.org/grpc@v1.46.0/server.go:1283 +0xc88
google.golang.org/grpc.(*Server).handleStream(0x140000b6700, {0x102a09ba0, 0x140004024e0}, 0x14000700000, 0x0)
	/Users/clbx/go/pkg/mod/google.golang.org/grpc@v1.46.0/server.go:1620 +0xa34
google.golang.org/grpc.(*Server).serveStreams.func1.2(0x1400042c540, 0x140000b6700, {0x102a09ba0, 0x140004024e0}, 0x14000700000)
	/Users/clbx/go/pkg/mod/google.golang.org/grpc@v1.46.0/server.go:922 +0x94
created by google.golang.org/grpc.(*Server).serveStreams.func1
	/Users/clbx/go/pkg/mod/google.golang.org/grpc@v1.46.0/server.go:920 +0x1f0

Error: The terraform-provider-proxmox 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.
> pveversion
pve-manager/7.1-7/df5740ad (running kernel: 5.13.19-2-pve)
Terraform v1.1.9
on darwin_arm64
+ provider registry.terraform.io/telmate/proxmox v2.9.10
Originally created by @clbx on GitHub (Apr 28, 2022). Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/173 As described in [this](https://github.com/Telmate/terraform-provider-proxmox/issues/547) comment, it looks like whenever the terraform Proxmox provider attempts to use the api to get a VM by reference, it crashes: ``` Stack trace from the terraform-provider-proxmox plugin: panic: interface conversion: interface {} is nil, not []interface {} goroutine 43 [running]: github.com/Telmate/proxmox-api-go/proxmox.(*Client).GetVmRefsByName(0x14000314460, {0x1400011e670, 0x5}) /Users/clbx/go/pkg/mod/github.com/!telmate/proxmox-api-go@v0.0.0-20220427175411-e25c3463f0db/proxmox/client.go:197 +0x768 github.com/Telmate/proxmox-api-go/proxmox.(*Client).GetVmRefByName(...) /Users/clbx/go/pkg/mod/github.com/!telmate/proxmox-api-go@v0.0.0-20220427175411-e25c3463f0db/proxmox/client.go:187 github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuCreate(0x14000212f00, {0x1028bef80, 0x140003144b0}) /Users/clbx/Projects/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:795 +0x12ac github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x140003bc700, {0x1029fd900, 0x14000718000}, 0x14000212f00, {0x1028bef80, 0x140003144b0}) /Users/clbx/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.14.0/helper/schema/resource.go:695 +0x170 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x140003bc700, {0x1029fd900, 0x14000718000}, 0x1400052e270, 0x14000212d80, {0x1028bef80, 0x140003144b0}) /Users/clbx/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.14.0/helper/schema/resource.go:837 +0xc14 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x1400000f140, {0x1029fd858, 0x1400011a700}, 0x140001445a0) /Users/clbx/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.14.0/helper/schema/grpc_provider.go:1021 +0xedc github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x140000ea3c0, {0x1029fd900, 0x14000111830}, 0x14000708000) /Users/clbx/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.9.0/tfprotov5/tf5server/server.go:812 +0x574 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x1029b4a20, 0x140000ea3c0}, {0x1029fd900, 0x14000111830}, 0x1400010eb40, 0x0) /Users/clbx/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.9.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x1c0 google.golang.org/grpc.(*Server).processUnaryRPC(0x140000b6700, {0x102a09ba0, 0x140004024e0}, 0x14000700000, 0x140003d4ba0, 0x102ecb140, 0x0) /Users/clbx/go/pkg/mod/google.golang.org/grpc@v1.46.0/server.go:1283 +0xc88 google.golang.org/grpc.(*Server).handleStream(0x140000b6700, {0x102a09ba0, 0x140004024e0}, 0x14000700000, 0x0) /Users/clbx/go/pkg/mod/google.golang.org/grpc@v1.46.0/server.go:1620 +0xa34 google.golang.org/grpc.(*Server).serveStreams.func1.2(0x1400042c540, 0x140000b6700, {0x102a09ba0, 0x140004024e0}, 0x14000700000) /Users/clbx/go/pkg/mod/google.golang.org/grpc@v1.46.0/server.go:922 +0x94 created by google.golang.org/grpc.(*Server).serveStreams.func1 /Users/clbx/go/pkg/mod/google.golang.org/grpc@v1.46.0/server.go:920 +0x1f0 Error: The terraform-provider-proxmox 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. ``` ``` > pveversion pve-manager/7.1-7/df5740ad (running kernel: 5.13.19-2-pve) ``` ``` Terraform v1.1.9 on darwin_arm64 + provider registry.terraform.io/telmate/proxmox v2.9.10 ```
kerem closed this issue 2026-02-28 00:40:17 +03:00
Author
Owner

@clbx commented on GitHub (Apr 29, 2022):

My pm_api_url was invalid, figured out by this issue.

<!-- gh-comment-id:1112764378 --> @clbx commented on GitHub (Apr 29, 2022): My ``pm_api_url`` was invalid, figured out by [this](https://github.com/Telmate/terraform-provider-proxmox/issues/543) issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#35
No description provided.