Telmate / terraform-provider-proxmox

Terraform provider plugin for proxmox
MIT License
2.04k stars 507 forks source link

Panic when creating VM #1001

Open gooseops opened 2 months ago

gooseops commented 2 months ago

# pveversion pve-manager/8.2.2/9355359cd7afbae4 (running kernel: 6.8.4-2-pve)

$ terraform providers

Providers required by configuration:
.
├── provider[registry.terraform.io/dopplerhq/doppler] ~> 1.6.1
├── provider[registry.terraform.io/telmate/proxmox] 2.9.11
└── module.geth
    └── provider[registry.terraform.io/telmate/proxmox] >= 2.9.11

I am getting this error when attempting to provision a new vm on Proxmox 8.2.2:

 Error: Plugin did not respond
│ 
│   with module.geth.proxmox_vm_qemu.proxmox-vm,
│   on ../../../modules/proxmox/qemu-vm/2-9-11/main.tf line 2, in resource "proxmox_vm_qemu" "proxmox-vm":
│    2: resource "proxmox_vm_qemu" "proxmox-vm" {
│ 
│ 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.11 plugin:

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

goroutine 20 [running]:
github.com/Telmate/proxmox-api-go/proxmox.NewConfigQemuFromApi(0xc000768530, 0xc0002f03bc?)
        github.com/Telmate/proxmox-api-go@v0.0.0-20220818102740-0129fa923095/proxmox/config_qemu.go:579 +0x4774
github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuCreate(0xc00030f180, {0xb2bec0?, 0xc0000a7270})
        github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:908 +0x25fd
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xd847f0?, {0xd847f0?, 0xc0002fe9c0?}, 0xd?, {0xb2bec0?, 0xc0000a7270?})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.21.0/helper/schema/resource.go:695 +0x178
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0003ce700, {0xd847f0, 0xc0002fe9c0}, 0xc000460d00, 0xc00030ef80, {0xb2bec0, 0xc0000a7270})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.21.0/helper/schema/resource.go:837 +0xa7a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00000d1b8, {0xd847f0?, 0xc0002fe8a0?}, 0xc00078c230)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.21.0/helper/schema/grpc_provider.go:1021 +0xe3c
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0000dc320, {0xd847f0?, 0xc00088a000?}, 0xc000888070)
        github.com/hashicorp/terraform-plugin-go@v0.14.0/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xc29f00?, 0xc0000dc320}, {0xd847f0, 0xc00088a000}, 0xc000888000, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.14.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000001e0, {0xd87268, 0xc000400d00}, 0xc000794000, 0xc0003e8ba0, 0x1212d00, 0x0)
        google.golang.org/grpc@v1.48.0/server.go:1295 +0xb0b
google.golang.org/grpc.(*Server).handleStream(0xc0000001e0, {0xd87268, 0xc000400d00}, 0xc000794000, 0x0)
        google.golang.org/grpc@v1.48.0/server.go:1636 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/grpc@v1.48.0/server.go:932 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.48.0/server.go:930 +0x28a

Error: The terraform-provider-proxmox_v2.9.11 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 VM Clone action is successful, but it never gets to Configure

NetDevAutomate commented 2 months ago

Same issue, posting in case there is any additional data of use. Same issue on macOS (intel) and Ubuntu on an Intel NUC:

Note The storage used is on an NFS share (1Gbps attached).


│
 Error: Plugin did not respond
│
│   with proxmox_vm_qemu.proxmox_vm_master[0],
│   on main.tf line 1, in resource "proxmox_vm_qemu" "proxmox_vm_master":
│    1: resource "proxmox_vm_qemu" "proxmox_vm_master" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs
│ may contain more details.
╵
╷
│ Error: Plugin did not respond
│
│   with proxmox_vm_qemu.proxmox_vm_workers[2],
│   on main.tf line 24, in resource "proxmox_vm_qemu" "proxmox_vm_workers":
│   24: resource "proxmox_vm_qemu" "proxmox_vm_workers" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs
│ may contain more details.
╵
╷
│ Error: Request cancelled
│
│   with proxmox_vm_qemu.proxmox_vm_workers[1],
│   on main.tf line 24, in resource "proxmox_vm_qemu" "proxmox_vm_workers":
│   24: resource "proxmox_vm_qemu" "proxmox_vm_workers" {
│
│ The plugin.(*GRPCProvider).ValidateResourceConfig request was cancelled.
╵
╷
│ Error: Request cancelled
│
│   with proxmox_vm_qemu.proxmox_vm_workers[0],
│   on main.tf line 24, in resource "proxmox_vm_qemu" "proxmox_vm_workers":
│   24: resource "proxmox_vm_qemu" "proxmox_vm_workers" {
│
│ The plugin.(*GRPCProvider).ValidateResourceConfig request was cancelled.
╵
Stack trace from the terraform-provider-proxmox_v2.9.14 plugin:

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

goroutine 42 [running]:
github.com/Telmate/proxmox-api-go/proxmox.NewConfigQemuFromApi(0xc00074e718, 0x189e92a?)
    github.com/Telmate/proxmox-api-go@v0.0.0-20230319185744-e7cde7198cdf/proxmox/config_qemu.go:584 +0x4605
github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuCreate(0xc00051cd80, {0x1767860?, 0xc000109360})
    github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:972 +0x2c4d
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x19d8be0?, {0x19d8be0?, 0xc00012de90?}, 0xd?, {0x1767860?, 0xc000109360?})
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:695 +0x178
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0003aa7e0, {0x19d8be0, 0xc00012de90}, 0xc000249ad0, 0xc00051cc00, {0x1767860, 0xc000109360})
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:837 +0xa85
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000434b40, {0x19d8be0?, 0xc00012d950?}, 0xc0006104b0)
    github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/grpc_provider.go:1021 +0xe8d
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc0003143c0, {0x19d8be0?, 0xc00012c900?}, 0xc0001d6310)
    github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x186d600?, 0xc0003143c0}, {0x19d8be0, 0xc00012c900}, 0xc0001d62a0, 0x0)
    github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00044e000, {0x19dc840, 0xc000007ba0}, 0xc000792240, 0xc000450c00, 0x1e95900, 0x0)
    google.golang.org/grpc@v1.53.0/server.go:1336 +0xd23
google.golang.org/grpc.(*Server).handleStream(0xc00044e000, {0x19dc840, 0xc000007ba0}, 0xc000792240, 0x0)
    google.golang.org/grpc@v1.53.0/server.go:1704 +0xa2f
google.golang.org/grpc.(*Server).serveStreams.func1.2()
    google.golang.org/grpc@v1.53.0/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
    google.golang.org/grpc@v1.53.0/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.```

mjbright commented 2 months ago

... also seeing the same issue on both an Intel NUC and also a mac M1

Running Proxmox 8.2.2 I tried with Terraform 1.7.4 and 1.8.2 just in case I tried with Provider 2.9.10 and 2.9.14 just in case

always getting "plugin crashed" error also

flygav1 commented 2 months ago

Terraform is borked for 8.2 and bbp plugin is so chaotic its impossible to use... very sad.

Syntax3rror404 commented 2 months ago

Is a fix in progress? Otherwise this plugin cannot be used for up to date proxmox versions ...

Tinyblargon commented 2 months ago

This issue has been fixed in 3.0.1-rc1

julianfoad commented 1 month ago

Which commit fixes this, please? (I want to back-port it to the 2.x series, at least my local copy.)