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 #1108

Open
omer-al-ba opened this issue Sep 17, 2024 · 1 comment
Open

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

omer-al-ba opened this issue Sep 17, 2024 · 1 comment

Comments

@omer-al-ba
Copy link

Im not sure if it's really a bug or im not focues to follow the tutorial.

BUG:

╷
│ Error: Plugin did not respond
│
│   with proxmox_vm_qemu.srv_demo_1,
│   on demo-server-1.tf line 1, in resource "proxmox_vm_qemu" "srv_demo_1":
│    1: resource "proxmox_vm_qemu" "srv_demo_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 16 [running]:
github.com/Telmate/proxmox-api-go/proxmox.NewConfigQemuFromApi(0x1400015c6e0, 0x102b8aab6?)
	github.com/Telmate/[email protected]/proxmox/config_qemu.go:584 +0x3b34
github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuCreate(0x140000ab580, {0x102d05ee0?, 0x140003abc20})
	github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:972 +0x21cc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x102e429a0?, {0x102e429a0?, 0x14000014030?}, 0xd?, {0x102d05ee0?, 0x140003abc20?})
	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(0x140004247e0, {0x102e429a0, 0x14000014030}, 0x140004b4340, 0x140000ab900, {0x102d05ee0, 0x140003abc20})
	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(0x140004aeb70, {0x102e429a0?, 0x140000a9d40?}, 0x140002dce60)
	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(0x140000b03c0, {0x102e429a0?, 0x140000a9350?}, 0x140002355e0)
	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:818 +0x3b8
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x102e0ba60?, 0x140000b03c0}, {0x102e429a0, 0x140000a9350}, 0x14000235570, 0x0)
	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0x140004c2000, {0x102e46540, 0x14000102820}, 0x14000339e60, 0x140004c4c00, 0x1032e3860, 0x0)
	google.golang.org/[email protected]/server.go:1336 +0xb7c
google.golang.org/grpc.(*Server).handleStream(0x140004c2000, {0x102e46540, 0x14000102820}, 0x14000339e60, 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.

File:

resource "proxmox_vm_qemu" "srv_demo_1" {
        name = "srv-demo-1"
        target_node = "eva"
        clone = "debian-12-template"
        full_clone  = "true"


        os_type = "cloud-init"
        agent = 1
        cores = 2
        sockets = 1
        cpu = "host"
        memory = 8096
        scsihw = "virtio-scsi-pci"
        bootdisk = "scsi0"

        disk {
                slot = 0
                storage = "local-root"
                type = "scsi"
                size = "30G"
                discard = "on"
                ssd = "1"
        }

        network {
                bridge = "vmbr0"
                model = "virtio"
        }

        lifecycle {
          ignore_changes = [
            network,
          ]
        }
}

provider.tf:

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

variable "proxmox_api_url" {
   type = string
}

variable "proxmox_api_token_id" {
   type = string
   sensitive = true
}

variable "proxmox_api_token_secret" {
   type =  string
   sensitive = true
}

provider "proxmox" {
   pm_api_url= var.proxmox_api_url
   pm_api_token_id = var.proxmox_api_token_id
   pm_api_token_secret = var.proxmox_api_token_secret
   pm_tls_insecure = true
}
@Tinyblargon
Copy link
Collaborator

@omer-al-ba version 2.x.x is broken and 3.0.1rc4 is its replacement, as there was no way to fix it without introducing breaking changes.

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

2 participants