Closed radosevic closed 1 year ago
Hi, have you had any success in figuring out what the cause is?
I had exactly the same error and it seems that there are multiple issues that can cause this output.
Anyone with the same issue, I would suggest you to activate debug logging like this and check the log output:
provider "proxmox" {
...
pm_log_enable = true
pm_log_file = "terraform-plugin-proxmox.log"
pm_log_levels = {
_default = "debug"
_capturelog = ""
}
}
In my case it was not really a config Issue!
Somehow passing the secrets as ENV variables was not working as described and I had to pass it in the provider with pm_api_token_id
/pm_api_token_secret
.
@radosevic I had a quick look at your config and if you remove media from your disk it seems to work. main.tf:
dynamic "disk" {
for_each = var.disk
content {
type = disk.value.type
storage = disk.value.storage
size = disk.value.size
format = disk.value.format
cache = disk.value.cache
backup = disk.value.backup
iothread = disk.value.iothread
replicate = disk.value.replicate
ssd = disk.value.ssd
discard = disk.value.discard
mbps = disk.value.mbps
mbps_rd = disk.value.mbps_rd
mbps_rd_max = disk.value.mbps_rd_max
mbps_wr = disk.value.mbps_wr
mbps_wr_max = disk.value.mbps_wr_max
file = disk.value.file
#media = disk.value.media
volume = disk.value.volume
slot = disk.value.slot
}
}
Not sure why though. (maybe somewhere here: https://github.com/Telmate/proxmox-api-go/blob/5e4c0d698a7828f63fab0656aaa31dbe310a6912/proxmox/client.go#L842 )
same issue on proxmox 7
I was following the description here: https://austinsnerdythings.com/2021/09/01/how-to-deploy-vms-in-proxmox-with-terraform/ and had the same error. I did a debug logging but could not see any error in it (API communication ok).
Problem solved, see here: https://github.com/Telmate/terraform-provider-proxmox/issues/414
"I had the same problem. I connect to a proxmox in my local network using a self-signed certificate, so I had to add the provider setting pm_tls_insecure = true"
Problem solved, see here: #414
"I had the same problem. I connect to a proxmox in my local network using a self-signed certificate, so I had to add the provider setting pm_tls_insecure = true"
I have had that setting since day one in my test environment, and have only now run into the GRPC provider bug. This is not a solution.
Same problem here. My machine stack comes up 1 out of 3 times if I'm lucky.
Same issue too with basic resource :
resource "proxmox_vm_qemu" "worker" {
count = var.number_of_masters
target_node = "galaxy"
name = "worker0${count.index + 1}"
vmid = count.index + 111
full_clone = true
clone = "ubuntu-cloud"
cores = 2
sockets = 1
memory = 2048
searchdomain = "foo.bar"
nameserver = "172.16.1.254"
ipconfig0 = "ip=172.16.1.${count.index + 111}/24,gw=172.16.1.254"
}
This makes the provider unusable unfortunately...
I have also had this issue. My fix was to remove the media =
line for disk as although in the documentation the value of media can be 'disk' or 'cdrom', this is not valid and working.
Problem solved, see here: #414
"I had the same problem. I connect to a proxmox in my local network using a self-signed certificate, so I had to add the provider setting pm_tls_insecure = true"
This worked for me!
For me the Pool.Allocate
privilege was needed to list the pools. I didn't used any pool but now it is working.
This is still an issue. I'm currently seeing it after having it work fine for months.
Same here. It usually happens if I am creating 5 or more VMs. Creating 3 works fine.
same here (proxmox 8.1.3) Error: Plugin did not respond │ │ with module.k8s[1].proxmox_vm_qemu.cloudinit, │ on modules/proxmox/resource.tf line 1, in resource "proxmox_vm_qemu" "cloudinit": │ 1: resource "proxmox_vm_qemu" "cloudinit" { │ │ The plugin encountered an error, and failed to respond to the │ plugin.(GRPCProvider).ReadResource 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 113 [running]: github.com/Telmate/proxmox-api-go/proxmox.NewConfigQemuFromApi(0xc00072b088, 0xc00072b088?) github.com/Telmate/proxmox-api-go@v0.0.0-20230319185744-e7cde7198cdf/proxmox/config_qemu.go:584 +0x4605 github.com/Telmate/terraform-provider-proxmox/proxmox._resourceVmQemuRead(0xc00012cb80, {0xb66f60?, 0xc0003390e0}) github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:1475 +0x457 github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuRead(0x0?, {0xb66f60?, 0xc0003390e0?}) github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:1446 +0x25 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).read(0xdd7840?, {0xdd7840?, 0xc000830d20?}, 0xd?, {0xb66f60?, 0xc0003390e0?}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:712 +0x178 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).RefreshWithoutUpgrade(0xc0003cc7e0, {0xdd7840, 0xc000830d20}, 0xc0000a1790, {0xb66f60, 0xc0003390e0}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:1015 +0x585 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(GRPCProviderServer).ReadResource(0xc000456b70, {0xdd7840?, 0xc000830c00?}, 0xc0005da2c0) github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/grpc_provider.go:613 +0x4a5 github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(server).ReadResource(0xc0001323c0, {0xdd7840?, 0xc000830240?}, 0xc000114d20) github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/tf5server/server.go:748 +0x4b1 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0xc6bc20?, 0xc0001323c0}, {0xdd7840, 0xc000830240}, 0xc0001f00e0, 0x0) github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x170 google.golang.org/grpc.(Server).processUnaryRPC(0xc000470000, {0xddb420, 0xc0003161a0}, 0xc00088eea0, 0xc00046cdb0, 0x128f770, 0x0) google.golang.org/grpc@v1.53.0/server.go:1336 +0xd23 google.golang.org/grpc.(Server).handleStream(0xc000470000, {0xddb420, 0xc0003161a0}, 0xc00088eea0, 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.
Same here i tested v2.9.10 from which the log is but for latest i get the same crash
Stack trace from the terraform-provider-proxmox_v2.9.10 plugin:
panic: interface conversion: interface {} is string, not float64
goroutine 145 [running]:
github.com/Telmate/proxmox-api-go/proxmox.NewConfigQemuFromApi(0xc0002cca10, 0xc00069a4b0)
github.com/Telmate/proxmox-api-go@v0.0.0-20220427175411-e25c3463f0db/proxmox/config_qemu.go:569 +0x46a5
github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuCreate(0xc0005dc800, {0xae93c0, 0xc00022ee10})
github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:855 +0x24fd
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xd1df00, {0xd1df00, 0xc00057e7e0}, 0xd, {0xae93c0, 0xc00022ee10})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.14.0/helper/schema/resource.go:695 +0x178
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0003e8700, {0xd1df00, 0xc00057e7e0}, 0xc0000ae340, 0xc0005dc680, {0xae93c0, 0xc00022ee10})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.14.0/helper/schema/resource.go:837 +0xc29
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000151128, {0xd1de58, 0xc0005b2e00}, 0xc000454280)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.14.0/helper/schema/grpc_provider.go:1021 +0xe3c
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc00017e320, {0xd1df00, 0xc0004526c0}, 0xc00046c1c0)
github.com/hashicorp/terraform-plugin-go@v0.9.0/tfprotov5/tf5server/server.go:812 +0x56b
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xbe2c80, 0xc00017e320}, {0xd1df00, 0xc0004526c0}, 0xc0000986c0, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.9.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000144700, {0xd2b6c0, 0xc000484340}, 0xc000294000, 0xc00023ad20, 0x120cfa0, 0x0)
google.golang.org/grpc@v1.46.0/server.go:1283 +0xcf2
google.golang.org/grpc.(*Server).handleStream(0xc000144700, {0xd2b6c0, 0xc000484340}, 0xc000294000, 0x0)
google.golang.org/grpc@v1.46.0/server.go:1620 +0xa2a
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/grpc@v1.46.0/server.go:922 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.46.0/server.go:920 +0x294
Error: The terraform-provider-proxmox_v2.9.10 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.
I got the same problem.
Stack trace from the terraform-provider-proxmox_v2.9.14 plugin:
panic: interface conversion: interface {} is string, not float64
goroutine 74 [running]: github.com/Telmate/proxmox-api-go/proxmox.NewConfigQemuFromApi(0x140005926e0, 0x10271eab6?) github.com/Telmate/proxmox-api-go@v0.0.0-20230319185744-e7cde7198cdf/proxmox/config_qemu.go:584 +0x3b34 github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuCreate(0x1400026c000, {0x102899ee0?, 0x1400018c460}) github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:972 +0x21cc github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).create(0x1029d69a0?, {0x1029d69a0?, 0x14000485980?}, 0xd?, {0x102899ee0?, 0x1400018c460?}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:695 +0x134 github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(Resource).Apply(0x14000274ee0, {0x1029d69a0, 0x14000485980}, 0x140001495f0, 0x1400011df00, {0x102899ee0, 0x1400018c460}) github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:837 +0x86c github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(GRPCProviderServer).ApplyResourceChange(0x14000477f50, {0x1029d69a0?, 0x14000485860?}, 0x140001d82d0) github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/grpc_provider.go:1021 +0xb70 github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(server).ApplyResourceChange(0x140003bc320, {0x1029d69a0?, 0x14000484150?}, 0x14000292150) github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/tf5server/server.go:818 +0x3b8 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x10299fa60?, 0x140003bc320}, {0x1029d69a0, 0x14000484150}, 0x140002920e0, 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(0x140003421e0, {0x1029da540, 0x14000102820}, 0x140002a8000, 0x14000485710, 0x102e77860, 0x0) google.golang.org/grpc@v1.53.0/server.go:1336 +0xb7c google.golang.org/grpc.(Server).handleStream(0x140003421e0, {0x1029da540, 0x14000102820}, 0x140002a8000, 0x0) google.golang.org/grpc@v1.53.0/server.go:1704 +0x82c google.golang.org/grpc.(Server).serveStreams.func1.2() google.golang.org/grpc@v1.53.0/server.go:965 +0x84 created by google.golang.org/grpc.(Server).serveStreams.func1 google.golang.org/grpc@v1.53.0/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.
Greetings, I am bumping my head for days... Am I doing something wrong? Every version ( tried 2.6.5, 2.6.6, 2.6.7, 2.7.1, 2.7.2, 2.7.3 and 2.7.4 ) of telmate/proxmox provider I tried gives me this panic/error:
panic: interface conversion: interface {} is nil, not string
Version of Proxmox:
VM template is Ubuntu cloud image prepared by recommendations from Proxmox wiki + added qemu agent. I get new cloned image, but provider breaks when starts doing disk block, so at the end disk is not resized and doesn't push cloud-init settings.
This is last entry in Proxmox-provider.log:
I can provide you with Terraform debug/trace logs if needed.
It is always breaking when doing disk block:
my main.tf file:
variables.tf:
terraform.tfvars:
versions.tf:
provider.tf: