From 1c078b943d8dd083787fa5599160ee158f7af262 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Tue, 30 Jun 2026 09:06:01 +0200 Subject: [PATCH] agent: stale-lock guard uses tasks?source=active (PVE 9.x rejects ?running=1) Live test on felhom-pve (PVE 9.2.2) caught GET /nodes/{node}/tasks?running=1 returning HTTP 400 "property not defined in schema". The fail-safe correctly left the lock, but the BackupRunning guard always errored. source=active is the supported filter and returns the RUNNING tasks. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_0162BnMpUXscPsUB1cU8Tr6K --- internal/proxmox/query.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/proxmox/query.go b/internal/proxmox/query.go index 43bfa72..0286893 100644 --- a/internal/proxmox/query.go +++ b/internal/proxmox/query.go @@ -63,13 +63,16 @@ func (c *Client) ListSnapshots(ctx context.Context, vmid int) ([]Snapshot, error return ss, c.get(ctx, path, &ss) } -// ListRunningTasks returns the node's currently-running tasks (GET /nodes/{node}/tasks?running=1). +// ListRunningTasks returns the node's currently-active tasks (GET /nodes/{node}/tasks?source=active). // The startup stale-lock recovery uses it as the load-bearing safety guard: a backup lock is cleared // ONLY when no vzdump task is genuinely in-flight for the guest (an agent restart while a real backup -// runs must never clear the live lock). +// runs must never clear the live lock). NOTE: PVE 9.x rejects `?running=1` ("property not defined in +// schema") — `source=active` is the supported filter (it returns the RUNNING tasks); confirmed live on +// felhom-pve (PVE 9.2.2). active-source entries carry status "RUNNING"; we match on type+id, so the +// case difference vs the by-UPID status endpoint ("running") is moot. func (c *Client) ListRunningTasks(ctx context.Context) ([]TaskStatus, error) { var ts []TaskStatus - return ts, c.get(ctx, "/nodes/"+c.node+"/tasks?running=1", &ts) + return ts, c.get(ctx, "/nodes/"+c.node+"/tasks?source=active", &ts) } // ListStorage returns GET /storage (cluster-wide storage definitions).