"sshkeys" (ciuser) to vm endpoint

iamralf

New Member
May 6, 2024
6
0
1
Ich erhalte folgenden Fehler von der Proxmox-API (Proxmox v8.1.10):

{"sshkeys": "invalid format - invalid urlencoded string: ssh-rsa%20AA.................................%20eom\n"}}, "msg": "Status code was 400 and not [200]: HTTP Error 400: Parameter verification failed.", "pragma": "no-cache", "redirected": false, "server": "pve-api-daemon/3.0", "status": 400, "url": "https://proxmox:8006/api2/json/nodes/cluster01/qemu/5000/config"}

Das gleiche Problem wurde vor Kurzem gemeldet:
https://forum.proxmox.com/threads/sshkeys-invalid-format-invalid-urlencoded-string.126202
Und ich habe es noch einmal gepostet.

Das Seltsame ist, dass in der Fehlermeldung vom Proxmox-Server ein "\n" an den Inhalt der sshkey-Variable angehängt wird. Allerdings scheint {{ | urlencode }} richtig zu kodieren (+ wird konvertiert, " " wird konvertiert etc.).
Es macht nur der Hash sshkeys Probleme. "ciuser" und "cipassword" gehen durch.

Mein Ansible-Task sieht so aus:

YAML:
   - name: configure vm
     uri:
       url: "https://{{ server_url }}:8006/api2/json/nodes/{{ node }}/qemu/{{ vmid_next | trim }}/config"
       method: POST
       return_content: yes
       body_format: json
       use_proxy: no
       validate_certs: no
       timeout: 5
       headers:
         Authorization: "PVEAPIToken=..."
         Content-Type: "application/json"
       body:
         [...]
         ciuser: "{{ inventory_settings__pve_vm_username }}"
         sshkeys: "{{ inventory_settings__pve_vm_public_key | trim | urlencode }}"
     [...]


Was ist das Problem? Danke fuer jegliche Hilfe !
Herzliche Gr.!
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!