When interacting with the Proxmox HTTP API and submitting a request that produces an error (e.g. creating a VM with a "vmid" that is already taken, I am not getting any error message from the api.
The following request produces a 500 error with content
.
But when trying to produce the same outcome with pvesh:
I obtain a more qualified error message:
Is this behavior expected ? Does the API not return any error message when something bad happens? It complicates my debugging. Also, I desperately tried to find some thorough logs that could help me debug errors but all I could find for the API is the /var/log/pveproxy/access.log, which gives me incoming request and their HTTP status code, but no additional context.
To be precise, I don't need fixing that specific error: the context is clear, the vm id is already taken. What I want is, when an error occurs, get that error from the HTTP API, and not having to mimic that request through pvesh to obtain an error message.
My best,
Bash:
curl --request POST --url https://proxmox.acme/api2/json/nodes/pve-node1/qemu --header 'authorization: PVEAPIToken=root@pam!api=obfuscated-token' --header 'content-type: application/json' --data '{ "vmid":100}'
The following request produces a 500 error with content
JSON:
{"data": null}
But when trying to produce the same outcome with pvesh:
Bash:
pvesh create /nodes/pve-node1/qemu --vmid 100
I obtain a more qualified error message:
Bash:
unable to create VM 100 - VM 100 already exists on node 'pve-node1'
Is this behavior expected ? Does the API not return any error message when something bad happens? It complicates my debugging. Also, I desperately tried to find some thorough logs that could help me debug errors but all I could find for the API is the /var/log/pveproxy/access.log, which gives me incoming request and their HTTP status code, but no additional context.
To be precise, I don't need fixing that specific error: the context is clear, the vm id is already taken. What I want is, when an error occurs, get that error from the HTTP API, and not having to mimic that request through pvesh to obtain an error message.
My best,