[GH-ISSUE #176] Wrong URL with backend local #100

Closed
opened 2026-02-27 15:46:27 +03:00 by kerem · 2 comments
Owner

Originally created by @dainok on GitHub (Sep 29, 2024).
Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/176

Originally assigned to: @dainok on GitHub.

Seems that Proxmoxer is setting a wrong URL using the local backend:

from proxmoxer import ProxmoxAPI
proxmox = ProxmoxAPI(sudo=False, backend="local")
proxmox.nodes.proxmox1.qemu.get()

The error is:

proxmoxer.core.ResourceException: 500 Internal Server Error: No 'get' handler defined for 'localhost/nodes/proxmox1/qemu'

The affected file is proxmoxer/backends/local.py. Target should be / and not localhost:

class Backend(CommandBaseBackend):
    def __init__(self, *args, **kwargs):
        self.session = LocalSession(*args, **kwargs)
        self.target = "/"

With this change the URL is correct:

>>> proxmox.nodes.proxmox1.qemu
ProxmoxResource (/nodes/proxmox1/qemu)

If anyone can confirm my usage is correct, I can prepare a patch.

Version:

  • Proxmox VE: 8.2.2
  • Proxmoxer: 2.1.0
  • Backend: local
Originally created by @dainok on GitHub (Sep 29, 2024). Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/176 Originally assigned to: @dainok on GitHub. Seems that Proxmoxer is setting a wrong URL using the local backend: ```python from proxmoxer import ProxmoxAPI proxmox = ProxmoxAPI(sudo=False, backend="local") proxmox.nodes.proxmox1.qemu.get() ``` The error is: ```text proxmoxer.core.ResourceException: 500 Internal Server Error: No 'get' handler defined for 'localhost/nodes/proxmox1/qemu' ``` The affected file is `proxmoxer/backends/local.py`. Target should be `/` and not `localhost`: ``` class Backend(CommandBaseBackend): def __init__(self, *args, **kwargs): self.session = LocalSession(*args, **kwargs) self.target = "/" ``` With this change the URL is correct: ```text >>> proxmox.nodes.proxmox1.qemu ProxmoxResource (/nodes/proxmox1/qemu) ``` If anyone can confirm my usage is correct, I can prepare a patch. Version: * Proxmox VE: **8.2.2** * Proxmoxer: **2.1.0** * Backend: **local**
kerem 2026-02-27 15:46:27 +03:00
Author
Owner

@leahoswald commented on GitHub (Oct 2, 2024):

I can confirm the error and that the wrong target was introduced last year with this commit github.com/proxmoxer/proxmoxer@500a8dd2e3 so between the 2.0.1 release and the 2.1.0 release. Downgraded for now.

<!-- gh-comment-id:2388315458 --> @leahoswald commented on GitHub (Oct 2, 2024): I can confirm the error and that the wrong target was introduced last year with this commit https://github.com/proxmoxer/proxmoxer/commit/500a8dd2e338491b12836510efc767805a464d8a so between the 2.0.1 release and the 2.1.0 release. Downgraded for now.
Author
Owner

@arthurlunkes commented on GitHub (Oct 24, 2024):

PLEASE MERGE @jhollowe @dainok ! Proxmoxer does not work for local cases. This guy solved it. I'm starting a project in my organization and I need this LIB, but it's impossible to use API or SSH because my script will run locally.

<!-- gh-comment-id:2435159999 --> @arthurlunkes commented on GitHub (Oct 24, 2024): PLEASE MERGE @jhollowe @dainok ! Proxmoxer does not work for local cases. This guy solved it✅. I'm starting a project in my organization and I need this LIB, but it's impossible to use API or SSH because my script will run locally.
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/proxmoxer#100
No description provided.