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

Bug Report: Terraform Proxmox Plugin Crash (v2.9.14) #1204

Open
SKreiscloud opened this issue Dec 17, 2024 · 2 comments
Open

Bug Report: Terraform Proxmox Plugin Crash (v2.9.14) #1204

SKreiscloud opened this issue Dec 17, 2024 · 2 comments

Comments

@SKreiscloud
Copy link

SKreiscloud commented Dec 17, 2024

Bug Report: Terraform Proxmox Plugin Crash (v2.9.14)

Summary: The Terraform Proxmox Provider (v2.9.14) crashes with the error interface conversion: interface {} is string, not float64, despite the operation being successful (VM creation).

Logs:

Proxmox API Request and Response:
{"data":{"pstart":248887856,"tokenid":"terraform-proxmox","node":"proxmox","status":"stopped","user":"root@pam","upid":"UPID:proxmox:002476FD:0ED5BA30:67613F06:qmclone:201:root@pam!terraform-proxmox:","pid":2389757,"type":"qmclone","id":"201","exitstatus":"OK","starttime":1734426374}}
2024/12/17 10:07:00 >>>>>>>>>> REQUEST:
GET /api2/json/nodes/proxmox/qemu/100/config HTTP/1.1
Host: 10.0.8.3:8006
User-Agent: Go-http-client/1.1
Accept: application/json
Authorization: PVEAPIToken=root@pam!terraform-proxmox=839b198d-1701-4b0c-853f-e3a85575c78e
Accept-Encoding: gzip

2024/12/17 10:07:00 <<<<<<<<<< RESULT:
HTTP/1.1 200 OK
Content-Length: 564
Cache-Control: max-age=0
Connection: Keep-Alive
Content-Type: application/json;charset=UTF-8
Date: Tue, 17 Dec 2024 09:07:00 GMT
Expires: Tue, 17 Dec 2024 09:07:00 GMT
Pragma: no-cache
Server: pve-api-daemon/3.0

{"data":{"cpu":"x86-64-v2-AES","sockets":1,"digest":"0131fb35933a035c1b0e95427949d10f84dc70df","net0":"virtio=BC:24:11:3A:9B:13,bridge=vmbr0,firewall=1","vmgenid":"32cab242-acbc-40a8-a4a3-3b1862caf4ce","scsihw":"virtio-scsi-single","numa":0,"smbios1":"uuid=1a785fb4-dff5-473b-ae74-fd11609e8cb0","memory":"8192","ostype":"l26","cores":2,"boot":"order=scsi0;ide2;net0","meta":"creation-qemu=8.1.5,ctime=1731939004","ide2":"local:iso/Debian.iso,media=cdrom,size=3904304K","onboot":1,"scsi0":"local-lvm:vm-100-disk-0,iothread=1,size=32G","name":"elastic-debian1-new"}}

Terraform:


╷
│ Error: Plugin did not respond
│ 
│   with proxmox_vm_qemu.elastic-debian1,
│   on proxmox.tf line 17, in resource "proxmox_vm_qemu" "elastic-debian1":
│   17: resource "proxmox_vm_qemu" "elastic-debian1" {
│ 
│ 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 67 [running]:
github.com/Telmate/proxmox-api-go/proxmox.NewConfigQemuFromApi(0xc000356718, 0xc9d509?)
        github.com/Telmate/[email protected]/proxmox/config_qemu.go:584 +0x4605
github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuCreate(0xc000284a00, {0xb66f60?, 0xc0000aa190})
        github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:972 +0x2c4d
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xdd7840?, {0xdd7840?, 0xc0002bf3b0?}, 0xd?, {0xb66f60?, 0xc0000aa190?})
        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(0xc0003d07e0, {0xdd7840, 0xc0002bf3b0}, 0xc00024d860, 0xc000284880, {0xb66f60, 0xc0000aa190})
        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(0xc00045ab58, {0xdd7840?, 0xc0002bf290?}, 0xc0002e62d0)
        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(0xc00012c3c0, {0xdd7840?, 0xc0002be330?}, 0xc0001c04d0)
        github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xc6bc20?, 0xc00012c3c0}, {0xdd7840, 0xc0002be330}, 0xc0001c0000, 0x0)
        github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000474000, {0xddb420, 0xc0001036c0}, 0xc00061c120, 0xc000476c00, 0x128f7a0, 0x0)
        google.golang.org/[email protected]/server.go:1336 +0xd23
google.golang.org/grpc.(*Server).handleStream(0xc000474000, {0xddb420, 0xc0001036c0}, 0xc00061c120, 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.
{
  "data": {
    "status": "stopped",
    "exitstatus": "OK",
    "cpu": "x86-64-v2-AES",
    "memory": "8192",
    "name": "elastic-debian1-new"
  }
}

Error Message:

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

Terraform Configuration:

provider "proxmox" {
  pm_api_url = "https://${var.proxmox_server}:8006/api2/json"
  pm_api_token_id = "root@pam!terraform-proxmox"
  pm_tls_insecure = true
}

resource "proxmox_vm_qemu" "elastic-debian1" {
  name = "elastic-debian1-new"
  clone = "elastic-debian1"
  memory = 2048
  disk { size = "32G" }
  network { model = "virtio" }
}

Issue:

The plugin crashes with a type conversion error (interface {} is string, not float64) during VM creation. The operation completes successfully, but the plugin crashes afterward.

@eweissge
Copy link

I'm also having this issue, same version, same stack trace, but operation does not complete. VM is partially created but not registered in state, so it can't be refreshed or destroyed. VMs have to be removed manually.

@Yfksw65
Copy link

Yfksw65 commented Jan 5, 2025

Same problem for me, any fix please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants