[PR #449] [MERGED] fix: make nextid get next id #479

Closed
opened 2026-02-28 00:42:20 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/449
Author: @jedrw
Created: 8/18/2025
Status: Merged
Merged: 8/22/2025
Merged by: @Tinyblargon

Base: masterHead: nextID


📝 Commits (1)

  • d864f3c fix: make nextid get nextid

📊 Changes

2 files changed (+17 additions, -2 deletions)

View changed files

📝 cli/command/get/id/get-id-next.go (+13 -2)
📝 proxmox/client.go (+4 -0)

📄 Description

The proxmox API returns an error (rightly or wrongly?) when an in-use vmid is passed as a parameter to the API call.

e.g. from pvesh on my 8.3.5 cluster:

root@tc-01:~# pvesh get /cluster/nextid -vmid 2004
400 Parameter verification failed.
vmid: VM 2004 already exists
pvesh get <api_path> [OPTIONS] [FORMAT_OPTIONS]

from a proxmox-api-go debug log:

HTTP/1.1 400 Parameter verification failed. Connection: close Content-Length: 101 Cache-Control: max-age=0 Content-Type: application/json;charset=UTF-8 Date: Mon, 18 Aug 2025 11:59:14 GMT Expires: Mon, 18 Aug 2025 11:59:14 GMT Pragma: no-cache Server: pve-api-daemon/3.0 {"errors":{"vmid":"VM 2004 already exists"},"data":null,"message":"Parameter verification failed.\n"}

My expectation would be that the next available id would be returned instead of the error, this was the case in previous versions of proxmox-api-go until this commit github.com/Telmate/proxmox-api-go@9b95514b3f removed the recursive call which increments the id each time until a valid one is found.

I can see a world in which it is expected that the user should implement the retry logic as that is how the proxmox API behaves but I think it's a better user experience if it just does what the name of the function implies.

I've also updated the new cli to accept a positional arg since I was using that to test this.

Please let me know your thoughts.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Telmate/proxmox-api-go/pull/449 **Author:** [@jedrw](https://github.com/jedrw) **Created:** 8/18/2025 **Status:** ✅ Merged **Merged:** 8/22/2025 **Merged by:** [@Tinyblargon](https://github.com/Tinyblargon) **Base:** `master` ← **Head:** `nextID` --- ### 📝 Commits (1) - [`d864f3c`](https://github.com/Telmate/proxmox-api-go/commit/d864f3c64c0faf5330012ae32dd653015e202275) fix: make nextid get nextid ### 📊 Changes **2 files changed** (+17 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `cli/command/get/id/get-id-next.go` (+13 -2) 📝 `proxmox/client.go` (+4 -0) </details> ### 📄 Description The proxmox API returns an error (rightly or wrongly?) when an in-use vmid is passed as a parameter to the API call. e.g. from pvesh on my 8.3.5 cluster: ``` root@tc-01:~# pvesh get /cluster/nextid -vmid 2004 400 Parameter verification failed. vmid: VM 2004 already exists pvesh get <api_path> [OPTIONS] [FORMAT_OPTIONS] ``` from a proxmox-api-go debug log: ``` HTTP/1.1 400 Parameter verification failed. Connection: close Content-Length: 101 Cache-Control: max-age=0 Content-Type: application/json;charset=UTF-8 Date: Mon, 18 Aug 2025 11:59:14 GMT Expires: Mon, 18 Aug 2025 11:59:14 GMT Pragma: no-cache Server: pve-api-daemon/3.0 {"errors":{"vmid":"VM 2004 already exists"},"data":null,"message":"Parameter verification failed.\n"} ``` My expectation would be that the next available id would be returned instead of the error, this was the case in previous versions of proxmox-api-go until this commit https://github.com/Telmate/proxmox-api-go/commit/9b95514b3fb474c4c3b1e66d739c7e691c6adba7 removed the recursive call which increments the id each time until a valid one is found. I can see a world in which it is expected that the user should implement the retry logic as that is how the proxmox API behaves but I think it's a better user experience if it just does what the name of the function implies. I've also updated the new cli to accept a positional arg since I was using that to test this. Please let me know your thoughts. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:42:20 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#479
No description provided.