[GH-ISSUE #161] qemu monitor api failed to call command like info block #85

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

Originally created by @pandada8 on GitHub (Mar 11, 2024).
Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/161

Originally assigned to: @jhollowe on GitHub.

When executing the following code:

pve.nodes(vm['node']).qemu(vm['vmid']).monitor.post(command="info block")

following exception is generated

proxmoxer.core.ResourceException: 400 Bad Request: Parameter verification failed. - {'command': "type check ('string') failed - got ARRAY"}

This particular issue appears to have been introduced with the changes made in #90. The issue seems to revolve around the code located here: github.com/proxmoxer/proxmoxer@d7419ab036/proxmoxer/backends/https.py (L197-L201)
The logic in these lines of code should only activate when the url ends with agent/exec.

Originally created by @pandada8 on GitHub (Mar 11, 2024). Original GitHub issue: https://github.com/proxmoxer/proxmoxer/issues/161 Originally assigned to: @jhollowe on GitHub. When executing the following code: ```python pve.nodes(vm['node']).qemu(vm['vmid']).monitor.post(command="info block") ``` following exception is generated ```python proxmoxer.core.ResourceException: 400 Bad Request: Parameter verification failed. - {'command': "type check ('string') failed - got ARRAY"} ``` This particular issue appears to have been introduced with the changes made in #90. The issue seems to revolve around the code located here: https://github.com/proxmoxer/proxmoxer/blob/d7419ab03628aa7cbcf24e90f981446996b91100/proxmoxer/backends/https.py#L197-L201 The logic in these lines of code should only activate when the url ends with `agent/exec`.
Author
Owner

@jhollowe commented on GitHub (Mar 13, 2024):

What is your PVE version and proxmoxer version?
It looks like there was a change from PVE 7 to PVE 8 that changed/broke the qemu agent APIs: https://bugzilla.proxmox.com/show_bug.cgi?id=4871 (unrelated to this issue)

<!-- gh-comment-id:1993182683 --> @jhollowe commented on GitHub (Mar 13, 2024): What is your PVE version and proxmoxer version? ~~It looks like there was a change from PVE 7 to PVE 8 that changed/broke the qemu agent APIs: https://bugzilla.proxmox.com/show_bug.cgi?id=4871~~ (unrelated to this issue)
Author
Owner

@pandada8 commented on GitHub (Mar 13, 2024):

I am running with latest proxmoxer 2.0.1 against PVE 8.1.4
I changed above code to

          for k, v in data.copy().items():
            # split qemu exec commands for proper parsing by PVE (issue#89)
            if k == "command" and url.endswith('agent/exec'):
                if isinstance(v, list):
                    data[k] = v
                elif "Windows" not in platform.platform():
                    data[k] = shell_split(v)

seems fix the issue

<!-- gh-comment-id:1994376334 --> @pandada8 commented on GitHub (Mar 13, 2024): I am running with latest proxmoxer 2.0.1 against PVE 8.1.4 I changed above code to ``` for k, v in data.copy().items(): # split qemu exec commands for proper parsing by PVE (issue#89) if k == "command" and url.endswith('agent/exec'): if isinstance(v, list): data[k] = v elif "Windows" not in platform.platform(): data[k] = shell_split(v) ``` seems fix the issue
Author
Owner

@tomjones1977 commented on GitHub (Jul 5, 2024):

I know the fix has been merged into develop, how/when does the fix end up in the main pypi repositories?

<!-- gh-comment-id:2211139207 --> @tomjones1977 commented on GitHub (Jul 5, 2024): I know the fix has been merged into develop, how/when does the fix end up in the main pypi repositories?
Author
Owner

@jhollowe commented on GitHub (Aug 10, 2024):

I just released 2.1.0 which includes this fix

<!-- gh-comment-id:2282265533 --> @jhollowe commented on GitHub (Aug 10, 2024): I just released 2.1.0 which includes this fix
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#85
No description provided.