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

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

Open
frederikkunze opened this issue Dec 20, 2024 · 0 comments
Open

Comments

@frederikkunze
Copy link

When i try to apply followong terraform the plugin does crash

terraform {
required_providers {
proxmox = {
source = "telmate/proxmox"
}
}
}

provider "proxmox" {
pm_api_url = "https://cleanedup:8006/api2/json"
pm_api_token_id = "cleanedup"
pm_api_token_secret = "cleanedup"
pm_tls_insecure = true
}

resource "proxmox_vm_qemu" "vm-instance" {
name = "vm-instance"
target_node = "pve01"
clone = "ubuntu-2404-template"
full_clone = true
cores = 2
memory = 2048

disk {
    size            = "32G"
    type            = "scsi"
    storage         = "local-lvm"
    discard         = "on"
}

network {
    model     = "virtio"
    bridge    = "vmbr1"
    firewall  = false
    link_down = false
}

}

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:

  • create

Terraform will perform the following actions:

proxmox_vm_qemu.vm-instance will be created

  • resource "proxmox_vm_qemu" "vm-instance" {
    • additional_wait = 5

    • automatic_reboot = true

    • balloon = 0

    • bios = "seabios"

    • boot = (known after apply)

    • bootdisk = (known after apply)

    • clone = "ubuntu-2404-template"

    • clone_wait = 10

    • cores = 2

    • cpu = "host"

    • default_ipv4_address = (known after apply)

    • define_connection_info = true

    • force_create = false

    • full_clone = true

    • guest_agent_ready_timeout = 100

    • hotplug = "network,disk,usb"

    • id = (known after apply)

    • kvm = true

    • memory = 2048

    • name = "vm-instance"

    • nameserver = (known after apply)

    • onboot = false

    • oncreate = true

    • preprovision = true

    • reboot_required = (known after apply)

    • scsihw = "lsi"

    • searchdomain = (known after apply)

    • sockets = 1

    • ssh_host = (known after apply)

    • ssh_port = (known after apply)

    • tablet = true

    • target_node = "pve01"

    • unused_disk = (known after apply)

    • vcpus = 0

    • vlan = -1

    • vmid = (known after apply)

    • disk {

      • backup = true
      • cache = "none"
      • discard = "on"
      • file = (known after apply)
      • format = (known after apply)
      • iops = 0
      • iops_max = 0
      • iops_max_length = 0
      • iops_rd = 0
      • iops_rd_max = 0
      • iops_rd_max_length = 0
      • iops_wr = 0
      • iops_wr_max = 0
      • iops_wr_max_length = 0
      • iothread = 0
      • mbps = 0
      • mbps_rd = 0
      • mbps_rd_max = 0
      • mbps_wr = 0
      • mbps_wr_max = 0
      • media = (known after apply)
      • replicate = 0
      • size = "32G"
      • slot = (known after apply)
      • ssd = 0
      • storage = "local-lvm"
      • storage_type = (known after apply)
      • type = "scsi"
      • volume = (known after apply)
        }
    • network {

      • bridge = "vmbr1"
      • firewall = false
      • link_down = false
      • macaddr = (known after apply)
      • model = "virtio"
      • queues = (known after apply)
      • rate = (known after apply)
      • tag = -1
        }
        }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

Enter a value: yes

proxmox_vm_qemu.vm-instance: Creating...

│ Error: Plugin did not respond

│ with proxmox_vm_qemu.vm-instance,
│ on main.tf line 16, in resource "proxmox_vm_qemu" "vm-instance":
│ 16: resource "proxmox_vm_qemu" "vm-instance" {

│ 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.exe plugin:

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

goroutine 106 [running]:
github.com/Telmate/proxmox-api-go/proxmox.NewConfigQemuFromApi(0xc0003006c0, 0x0?)
github.com/Telmate/[email protected]/proxmox/config_qemu.go:584 +0x4605
github.com/Telmate/terraform-provider-proxmox/proxmox.prepareDiskSize(0x0?, 0xc0003125c0?, 0xb?, 0x0?)
github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:1737 +0xeb
github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuCreate(0xc000274900, {0xa58680?, 0xc0003351d0})
github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:1059 +0x1cb2
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xcda800?, {0xcda800?, 0xc000108b70?}, 0xd?, {0xa58680?, 0xc0003351d0?})
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(0xc0003dc7e0, {0xcda800, 0xc000108b70}, 0xc000596ea0, 0xc000274a80, {0xa58680, 0xc0003351d0})
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(0xc000464c60, {0xcda800?, 0xc000108a50?}, 0xc0004f4230)
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(0xc00011a3c0, {0xcda800?, 0xc00018a390?}, 0xc000210070)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xb5f460?, 0xc00011a3c0}, {0xcda800, 0xc00018a390}, 0xc000210000, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00047e000, {0xcde3e0, 0xc0005841a0}, 0xc0003a2000, 0xc000480c00, 0x11a0880, 0x0)
google.golang.org/[email protected]/server.go:1336 +0xd23
google.golang.org/grpc.(*Server).handleStream(0xc00047e000, {0xcde3e0, 0xc0005841a0}, 0xc0003a2000, 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.exe plugin crashed!

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

1 participant