terraform-provider-proxmox
terraform-provider-proxmox copied to clipboard
Loops break containers
So from the best I can see it looks like looping the nics breaks the container creation.
Stack trace from the terraform-provider-proxmox_v0.23.0 plugin: panic: interface conversion: interface {} is nil, not map[string]interface {} goroutine 83 [running]: github.com/bpg/terraform-provider-proxmox/proxmoxtf/resource.containerCreateCustom({0x101d548, 0xc000456840}, 0x15da180?, {0xde5000?, 0xc000465140?}) github.com/bpg/terraform-provider-proxmox/proxmoxtf/resource/container.go:1110 +0x2c74 github.com/bpg/terraform-provider-proxmox/proxmoxtf/resource.containerCreate({0x101d548, 0xc000456840}, 0x0?, {0xde5000, 0xc000465140}) github.com/bpg/terraform-provider-proxmox/proxmoxtf/resource/container.go:656 +0x9f github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc0002749a0, {0x101d580, 0xc000211ec0}, 0xd?, {0xde5000, 0xc000465140}) github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:707 +0x12e github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0002749a0, {0x101d580, 0xc000211ec0}, 0xc000219110, 0xc000410000, {0xde5000, 0xc000465140}) 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(0xc0000116f8, {0x101d580?, 0xc000211ce0?}, 0xc000163540) github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xe8d github.com/hashicorp/terraform-plugin-mux/tf5to6server.v5tov6Server.ApplyResourceChange({{0x1023870?, 0xc0000116f8?}}, {0x101d580, 0xc000211ce0}, 0x0?) github.com/hashicorp/[email protected]/tf5to6server/tf5to6server.go:34 +0x5a github.com/hashicorp/terraform-plugin-mux/tf6muxserver.muxServer.ApplyResourceChange({0xc00026f320, 0xc00026f380, {0xc0002acfc0, 0x2, 0x2}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...}, ...}, ...) github.com/hashicorp/[email protected]/tf6muxserver/mux_server_ApplyResourceChange.go:27 +0x102 github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ApplyResourceChange(0xc0002d81e0, {0x101d580?, 0xc000210fc0?}, 0xc0000afc00) github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:819 +0x574 github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ApplyResourceChange_Handler({0xe79540?, 0xc0002d81e0}, {0x101d580, 0xc000210fc0}, 0xc0000afb90, 0x0) github.com/hashicorp/[email protected]/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:422 +0x170 google.golang.org/grpc.(*Server).processUnaryRPC(0xc0001203c0, {0x1022818, 0xc0002c9ba0}, 0xc000214120, 0xc0003907b0, 0x15cbd40, 0x0) google.golang.org/[email protected]/server.go:1337 +0xdf3 google.golang.org/grpc.(*Server).handleStream(0xc0001203c0, {0x1022818, 0xc0002c9ba0}, 0xc000214120, 0x0) google.golang.org/[email protected]/server.go:1714 +0xa36 google.golang.org/grpc.(*Server).serveStreams.func1.1() google.golang.org/[email protected]/server.go:959 +0x98 created by google.golang.org/grpc.(*Server).serveStreams.func1 google.golang.org/[email protected]/server.go:957 +0x18c Error: The terraform-provider-proxmox_v0.23.0 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.
Hey @Msabljic, could you please attach an example of the container resource that causes the issue?
@bpg Here it is, let me know if you are able to use it. This is just looping on the nic but same output on the entire container creation main.txt terraform.tfvars.txt
Additionally testing shows that its if the variables are passed as objects it breaks the looping creating. I think this might not be a large impacting problem and if its not an easy fix maybe just need a note placed somewhere?
Marking this issue as stale due to inactivity in the past 180 days. This helps us focus on the active issues. If this issue is reproducible with the latest version of the provider, please comment. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
same issue while creating VMs
This seems to be related to handling of empty blocks. This particular error is related to an empty initialization.dns in the plan.
Related:
- https://github.com/bpg/terraform-provider-proxmox/pull/1043
- https://github.com/bpg/terraform-provider-proxmox/pull/977
Also in VM:
- https://github.com/bpg/terraform-provider-proxmox/pull/1033
- https://github.com/bpg/terraform-provider-proxmox/pull/1196