mirror of
https://github.com/Telmate/proxmox-api-go.git
synced 2026-04-26 07:55:50 +03:00
[GH-ISSUE #465] Bug: Proxmox 9.0: Not HA managed VM error not correctly detected #118
Labels
No labels
good first issue
issue/confirmed
issue/critical
proposal/accepted
pull-request
type/bug
type/enhancement
type/feature
type/question
type/refactoring
type/testing
type/testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/proxmox-api-go#118
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TobiPeterG on GitHub (Oct 2, 2025).
Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/465
This is related to https://github.com/Telmate/terraform-provider-proxmox/issues/1416
While testing https://github.com/Telmate/terraform-provider-proxmox/pull/1415 , I noticed that VM deletion fails with with the current master version of the proxmox terraform provider. I ran this command:
TF_LOG=TRACE TF_LOG_PATH=tofu.log PM_LOG=1 PM_DEBUG=1 tofu destroywhich created this log:
The server only shows two API calls:
I created the VM using this terraform config using the latest master provider version:
This happens because the current destroy path always tries to delete the VM as HA first and tries to detect if the error is "VM not HA managed" (which by itself is not very clean; it should be checked if the VM is HA managed before making the call).
However, this error isn't correctly detected and therefore, instead of being ignored, this halts the complete destroy process.
@TobiPeterG commented on GitHub (Oct 2, 2025):
Related to https://github.com/Telmate/proxmox-api-go/pull/464 where this check was introduced but is not working in our case.
copilot also says that the string matching is fragile lol
@Tinyblargon commented on GitHub (Oct 6, 2025):
@TobiPeterG Under which circumstances did this issue occur? Which version of PVE?
This should catch it when you try to delete a non existent HA config, maybe not in every version of PVE.
github.com/Telmate/proxmox-api-go@b7a8fcf873/proxmox/config__guest.go (L251-L253)@Tinyblargon commented on GitHub (Oct 6, 2025):
Originally opted to detect the error as checking if the guest has HA would require another API call. Most PVE error messages rarely if ever change.
@TobiPeterG commented on GitHub (Oct 7, 2025):
We currently run PVE 9.0.10
@TobiPeterG commented on GitHub (Oct 7, 2025):
What would the issue be of making 1 additional API call?
@Tinyblargon commented on GitHub (Oct 8, 2025):
@TobiPeterG If I understand correctly you got error
500 Internal Server Errorwhen it tried to delete the nonexistent HA group?@Tinyblargon commented on GitHub (Oct 8, 2025):
{"data":null,"message":"cannot delete service 'vm:198', not HA managed!\n"}: timestamp="2025-10-02T14:17:19.697+0200"Confused why this says
cannot delete service 'vm:198', not HA managed!, when I run it the error is500 cannot delete service 'vm:198', not HA managed!Am quite concerned about the
500prefix getting removed.I am testing with Terraform, maybe OpenTofu gives different results?