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

Fehlermeldung nach terraform apply #1

Open
BrinRe opened this issue Jan 18, 2024 · 4 comments
Open

Fehlermeldung nach terraform apply #1

BrinRe opened this issue Jan 18, 2024 · 4 comments

Comments

@BrinRe
Copy link

BrinRe commented Jan 18, 2024

Hallo,
ich bekomme leider einen Fehler nach Ausführung von
terraform apply
Ich habe versucht, das Projekt sorgfältigst nachzubauen
Proxmox ist die neueste Version 8.1.4
terraform läuft über meine WSL (Win10, Ubuntu)

Folgende Fehler meldet das apply:

proxmox_vm_qemu.cttest[0]: Creating...
proxmox_vm_qemu.cttest[1]: Creating...
proxmox_vm_qemu.cttest[2]: Creating...

│ Error: 400 Parameter verification failed.

│ with proxmox_vm_qemu.cttest[2],
│ on main.tf line 15, in resource "proxmox_vm_qemu" "cttest":
│ 15: resource "proxmox_vm_qemu" "cttest" {



│ Error: 400 Parameter verification failed.

│ with proxmox_vm_qemu.cttest[1],
│ on main.tf line 15, in resource "proxmox_vm_qemu" "cttest":
│ 15: resource "proxmox_vm_qemu" "cttest" {



│ Error: 400 Parameter verification failed.

│ with proxmox_vm_qemu.cttest[0],
│ on main.tf line 15, in resource "proxmox_vm_qemu" "cttest":
│ 15: resource "proxmox_vm_qemu" "cttest" {


root@Notebook-RB:~/terraform/proxmox#

@ndi-ct
Copy link
Owner

ndi-ct commented Jan 19, 2024

Hi @BrinRe, die Fehlermeldung sagt aus, dass einer der Parameter falsch konfiguriert ist (möglicherweise ein Tippfehler). Leider beinhaltet die Fehlermeldung nicht, um welchen Parameter es sich handelt. Für mehr Informationen könnte es helfen, in main.tf den Debugging-Modus für den Provider zu aktivieren:

provider "proxmox" {
  pm_debug = true
}

@BrinRe
Copy link
Author

BrinRe commented Jan 19, 2024

Hallo @ndi-ct (Niklas),
Vielen Dank für die Hilfe. Ich hatte berreits versucht, den Debugging-Modus zu aktivieren. Leider sehe ich da weder eine Debug Ausgabe, noch wird augenscheinlich eine Debug-Datei im lokalen tf/proxmox Ordner erstellt. Aus meiner Sicht macht das debug also nichts.

Ich habe mal Dein Repository geclont und verglichen:

bringr@Notebook-RB:~/terraform/proxmox$ ll
total 24
drwxr-xr-x 3 bringr bringr 4096 Jan 19 17:40 ./
drwxr-xr-x 3 bringr bringr 4096 Jan 18 19:24 ../
drwxr-xr-x 3 bringr bringr 4096 Jan 19 17:32 IaC-terraform-proxmox/
-rw-r--r-- 1 bringr bringr  882 Jan 19 17:07 main.tf
-rw-r--r-- 1 bringr bringr   96 Jan 18 20:24 terraform.tfvars
-rw-r--r-- 1 bringr bringr  287 Jan 19 17:40 vars.tf
bringr@Notebook-RB:~/terraform/proxmox$ diff main.tf IaC-terraform-proxmox/main.tf
10d9
<   pm_debug = true
43,45c42,44
<   provisioner "local-exec" {
<     command = "echo ${self.name}: ${self.default_ipv4_address} >> ipv4list.txt"
<   }
---
> #  provisioner "local-exec" {
> #    command = "echo ${self.name}: ${self.default_ipv4_address} >> ipv4list.txt"
> #  }
bringr@Notebook-RB:~/terraform/proxmox$ diff terraform.tfvars IaC-terraform-proxmox/terraform.tfvars
1,2c1,2
< token_secret = "973a5738-fa20-4049-a729-0cea5cd0921a"
< token_id = "tf-user@pve!terraform-token"
---
> token_secret = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
> token_id = "cttest@pve!terraform-token"
bringr@Notebook-RB:~/terraform/proxmox$ diff vars.tf IaC-terraform-proxmox/vars.tf
2c2
<     default = "pve.rbx.local"
---
>     default = "pve"
11c11
<     default = "https://192.168.178.10:8006/api2/json"
---
>     default = "https://192.168.100.100:8006/api2/json"
bringr@Notebook-RB:~/terraform/proxmox$

Mein Proxmox heißt ebenfalls "pve", bzw. "pve.rbx.local" und aus der WSL heraus erreiche ich den über die IP "https://192.168.178.10:8006"
Mich wundert, warum bei Dir token_id = "cttest@pve!terraform-token" gesetzt ist...
Vielleicht kannst Du mir ja helfen.
Wo finde ich die Debug Ausgabe?
Soll ich mal das komplette Verzeichnis in ein Repository legen nachdem der Durchlauf fertig ist?
Vielen Dank schon mal
Gruss Reinhard Bring

@BrinRe
Copy link
Author

BrinRe commented Jan 19, 2024

Ich bin nochmals alles Schritt für Schritt abgelaufen. Exakt nach dem Artikel.
Dabei habe ich festgestellt, dass in dem Befehl für das Anlegen einer Rolle ein "-" fehlt. Genau muss es heißen pveum role add tf-role --privs ...
Weiterhin habe ich das Privileg SDN.Use noch hinzugefügt,
Also mit folgendem Befehl die Rolle tf-role geändert:

pveum role modify tf-role --privs \
"VM.Allocate VM.Clone \
VM.Config.CDROM VM.Config.CPU \
VM.Config.Cloudinit VM.Config.Disk \
VM.Config.HWType VM.Config.Memory \
VM.Config.Network VM.Config.Options \
VM.Monitor VM.Audit VM.PowerMgmt \
Datastore.AllocateSpace \
Datastore.Audit SDN.Use" 

Danach lief es so gut wie nie zuvor. TF machte sich ans bauen. Nach ca. 1 Minute brach das dann aber wieder mit einer Fehlermeldung ab. Ich poste mal den Output:

proxmox_vm_qemu.tf-user[0]: Creating...
proxmox_vm_qemu.tf-user[2]: Creating...
proxmox_vm_qemu.tf-user[1]: Creating...
proxmox_vm_qemu.tf-user[2]: Still creating... [10s elapsed]
proxmox_vm_qemu.tf-user[0]: Still creating... [10s elapsed]
proxmox_vm_qemu.tf-user[1]: Still creating... [10s elapsed]
proxmox_vm_qemu.tf-user[0]: Still creating... [20s elapsed]
proxmox_vm_qemu.tf-user[2]: Still creating... [20s elapsed]
proxmox_vm_qemu.tf-user[1]: Still creating... [20s elapsed]
proxmox_vm_qemu.tf-user[2]: Still creating... [30s elapsed]
proxmox_vm_qemu.tf-user[0]: Still creating... [30s elapsed]
proxmox_vm_qemu.tf-user[1]: Still creating... [30s elapsed]
proxmox_vm_qemu.tf-user[2]: Still creating... [40s elapsed]
proxmox_vm_qemu.tf-user[0]: Still creating... [40s elapsed]
proxmox_vm_qemu.tf-user[1]: Still creating... [40s elapsed]
proxmox_vm_qemu.tf-user[2]: Still creating... [50s elapsed]
proxmox_vm_qemu.tf-user[0]: Still creating... [50s elapsed]
proxmox_vm_qemu.tf-user[1]: Still creating... [50s elapsed]
proxmox_vm_qemu.tf-user[0]: Still creating... [1m0s elapsed]
proxmox_vm_qemu.tf-user[2]: Still creating... [1m0s elapsed]
proxmox_vm_qemu.tf-user[1]: Still creating... [1m0s elapsed]
╷
│ Error: Request cancelled
│
│   with proxmox_vm_qemu.tf-user[1],
│   on main.tf line 16, in resource "proxmox_vm_qemu" "tf-user":
│   16: resource "proxmox_vm_qemu" "tf-user" {
│
│ The plugin.(*GRPCProvider).ApplyResourceChange request was cancelled.
╵
╷
│ Error: Request cancelled
│
│   with proxmox_vm_qemu.tf-user[2],
│   on main.tf line 16, in resource "proxmox_vm_qemu" "tf-user":
│   16: resource "proxmox_vm_qemu" "tf-user" {
│
│ The plugin.(*GRPCProvider).ApplyResourceChange request was cancelled.
╵
╷
│ Error: Plugin did not respond
│
│   with proxmox_vm_qemu.tf-user[0],
│   on main.tf line 16, in resource "proxmox_vm_qemu" "tf-user":
│   16: resource "proxmox_vm_qemu" "tf-user" {
│
│ 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.11 plugin:

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

goroutine 40 [running]:
github.com/Telmate/proxmox-api-go/proxmox.NewConfigQemuFromApi(0xc000462530, 0xc0000345b0?)
        github.com/Telmate/[email protected]/proxmox/config_qemu.go:579 +0x4774
github.com/Telmate/terraform-provider-proxmox/proxmox.resourceVmQemuCreate(0xc000195800, {0xb2bec0?, 0xc0000b58b0})
        github.com/Telmate/terraform-provider-proxmox/proxmox/resource_vm_qemu.go:908 +0x25fd
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xd847f0?, {0xd847f0?, 0xc0003f0930?}, 0xd?, {0xb2bec0?, 0xc0000b58b0?})
        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(0xc000182e00, {0xd847f0, 0xc0003f0930}, 0xc000571040, 0xc000195600, {0xb2bec0, 0xc0000b58b0})
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:837 +0xa7a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0002d24c8, {0xd847f0?, 0xc0003f0810?}, 0xc000526370)
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xe3c
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc000207860, {0xd847f0?, 0xc0003f01e0?}, 0xc0005642a0)
        github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0xc29f00?, 0xc000207860}, {0xd847f0, 0xc0003f01e0}, 0xc000564230, 0x0)
        github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0002601e0, {0xd87268, 0xc00008a680}, 0xc000398fc0, 0xc0002e4780, 0x1212d00, 0x0)
        google.golang.org/[email protected]/server.go:1295 +0xb0b
google.golang.org/grpc.(*Server).handleStream(0xc0002601e0, {0xd87268, 0xc00008a680}, 0xc000398fc0, 0x0)
        google.golang.org/[email protected]/server.go:1636 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/[email protected]/server.go:932 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/[email protected]/server.go:930 +0x28a

Error: The terraform-provider-proxmox_v2.9.11 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.

Die Maschinen waren auf jeden Fall angelegt. Aus dem neuerlichen Fehler werde ich allerdings nicht schlau.

Du etwa?

VG Reinhard

@BrinRe
Copy link
Author

BrinRe commented Jan 19, 2024

hab auch noch das Update des Plugins auf 2.9.14 versucht. Ebensolches Ergebnis.

Habe das mal unter Telmate/terraform-provider-proxmox#903 (comment) eingetragen, da jemand anderes offensichtlich ganz ähnliche Fehler erzeugt....

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