Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interface conversion: interface {} is string, not float64 #882

Closed
Neels-v-Wyk opened this issue Dec 20, 2023 · 8 comments
Closed

interface conversion: interface {} is string, not float64 #882

Neels-v-Wyk opened this issue Dec 20, 2023 · 8 comments
Labels

Comments

@Neels-v-Wyk
Copy link

Neels-v-Wyk commented Dec 20, 2023

Good day,

It looks like I'm experiencing a variation of the error that occurred on this issue

This is for Proxmox VE 8.1.3, Terraform 1.6.6, and the Telmate proxmox provider v2.9.14, so everything is on it's latest version

I've tried giving the terraform user (and token) admin privelages on the zfs share because it seemed like a few similar issues had that as their root cause but this was not the case as it made no difference

I've set up the terraform user with all the permissions found in this part of the documentation for the provider

When trying to create a VM I get the following output from terraform:

Plan: 1 to add, 0 to change, 0 to destroy.
proxmox_vm_qemu.test_server[0]: Creating...
╷
│ Error: Request cancelled
│
│   with proxmox_vm_qemu.test_server[0],
│   on main.tf line 32, in resource "proxmox_vm_qemu" "test_server":
│   32: resource "proxmox_vm_qemu" "test_server" {
│
│ The plugin.(*GRPCProvider).ApplyResourceChange request was cancelled.
╵

Stack trace from the terraform-provider-proxmox_v2.9.14 plugin:

panic: interface conversion: interface {} is string, not float64

goroutine 46 [running]:
github.com/Telmate/proxmox-api-go/proxmox.NewConfigQemuFromApi(0xc0000623c0, 0xc0003c76b0?)
	github.com/Telmate/[email protected]/proxmox/config_qemu.go:584 +0x4605
github.com/Telmate/terraform-provider-proxmox/proxmox.prepareDiskSize(0x0?, 0xc0002a4600?, 0x9?, 0x0?)
	github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:1737 +0xeb
github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuCreate(0xc000560780, {0x1767860?, 0xc0002e3450})
	github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:1059 +0x1cb2
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x19d8be0?, {0x19d8be0?, 0xc00010e990?}, 0xd?, {0x1767860?, 0xc0002e3450?})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:695 +0x178
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc00033c7e0, {0x19d8be0, 0xc00010e990}, 0xc0002e9040, 0xc000560900, {0x1767860, 0xc0002e3450})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:837 +0xa85
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0003c6b40, {0x19d8be0?, 0xc00010e4e0?}, 0xc000122320)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xe8d
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0001243c0, {0x19d8be0?, 0xc0000b0f30?}, 0xc0001800e0)
	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x186d600?, 0xc0001243c0}, {0x19d8be0, 0xc0000b0f30}, 0xc000180000, 0x0)
	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0003dc000, {0x19dc840, 0xc0002ae820}, 0xc0001a6000, 0xc0003decf0, 0x1e95900, 0x0)
	google.golang.org/[email protected]/server.go:1336 +0xd23
google.golang.org/grpc.(*Server).handleStream(0xc0003dc000, {0x19dc840, 0xc0002ae820}, 0xc0001a6000, 0x0)
	google.golang.org/[email protected]/server.go:1704 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	google.golang.org/[email protected]/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/[email protected]/server.go:963 +0x28a

Error: The terraform-provider-proxmox_v2.9.14 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.

The plugin debug log can be found as part of this gist

@blockloop
Copy link

blockloop commented Dec 21, 2023

Looks like it's fixed in Tinyblargon/proxmox-go-sdk#7 and this provider needs to update?

Edit: it seems this project is actually dead now. See Telmate/proxmox-api-go#281 (comment) and move to https://github.com/bpg/terraform-provider-proxmox

@Neels-v-Wyk
Copy link
Author

Darn. Thanks for the find @blockloop. I guess I'll start moving things over

@MaartendeKruijf
Copy link
Contributor

@Neels-v-Wyk I've fixed in Telmates provider #878 you can use mine for now at https://registry.terraform.io/providers/MaartendeKruijf/proxmox/latest

@adelrizaev
Copy link

it works again with the fix from @MaartendeKruijf . Thank you.
When then fix will be released in the telmates provider?

@den-patrakeev
Copy link

Hi!
Check work RC v3.0.1-rc1 on Terraform 1.6.6 / 1.7.1 with ProxMox 8.1.3.
The error is gone. Everything works well.
Thanks to all!

@hedche
Copy link

hedche commented Feb 29, 2024

I think this issue still isn't fixed? I have just encountered the same bug (after updating the provider and terraform):

proxmox_vm_qemu.k8s-1[0]: Still creating... [10s elapsed]
╷
│ Error: Plugin did not respond
│
│   with proxmox_vm_qemu.k8s-1[0],
│   on main.tf line 14, in resource "proxmox_vm_qemu" "k8s-1":
│   14: resource "proxmox_vm_qemu" "k8s-1" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-proxmox_v2.9.14 plugin:

panic: interface conversion: interface {} is string, not float64

goroutine 58 [running]:
github.com/Telmate/proxmox-api-go/proxmox.NewConfigQemuFromApi(0x140000de6e0, 0x102ed6ab6?)
	github.com/Telmate/[email protected]/proxmox/config_qemu.go:584 +0x3b34
github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuCreate(0x14000354380, {0x103051ee0?, 0x1400013ceb0})
	github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:972 +0x21cc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x10318e9a0?, {0x10318e9a0?, 0x14000382f00?}, 0xd?, {0x103051ee0?, 0x1400013ceb0?})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:695 +0x134
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x1400042a7e0, {0x10318e9a0, 0x14000382f00}, 0x1400054cf70, 0x14000518980, {0x103051ee0, 0x1400013ceb0})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:837 +0x86c
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x140004b2b58, {0x10318e9a0?, 0x14000382de0?}, 0x1400052a2d0)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xb70
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x140003943c0, {0x10318e9a0?, 0x1400020a7e0?}, 0x140002162a0)
	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:818 +0x3b8
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x103157a60?, 0x140003943c0}, {0x10318e9a0, 0x1400020a7e0}, 0x14000216230, 0x0)
	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0x140004cc000, {0x103192540, 0x14000102d00}, 0x1400052e000, 0x140004cec30, 0x10362f860, 0x0)
	google.golang.org/[email protected]/server.go:1336 +0xb7c
google.golang.org/grpc.(*Server).handleStream(0x140004cc000, {0x103192540, 0x14000102d00}, 0x1400052e000, 0x0)
	google.golang.org/[email protected]/server.go:1704 +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-proxmox_v2.9.14 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.
Terraform v1.7.4
on darwin_arm64
+ provider registry.terraform.io/telmate/proxmox v2.9.14

Proxmox 8.1.4

@den-patrakeev - how did you get it to work? Did you compile manually from source? I tried updating the provider and couldn't get 3.0.1:

$ terraform init -upgrade

Initializing the backend...

Initializing provider plugins...
- Finding latest version of telmate/proxmox...
- Using previously-installed telmate/proxmox v2.9.14

Terraform has been successfully initialized!

Copy link

This issue is stale because it has been open for 60 days with no activity. Please update the provider to the latest version and, in the issue persist, provide full configuration and debug logs

@github-actions github-actions bot added the stale label Apr 30, 2024
Copy link

github-actions bot commented May 6, 2024

This issue was closed because it has been inactive for 5 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants