Keine Backups sichtbar — get_storage_content nutzt ?content= statt pvesh --content #20

Closed
opened 2026-06-01 19:19:55 +00:00 by chinux · 0 comments
Owner

Root Cause (bestätigt, Stand Commit b00c2ae0b1)

Der Agent baut für die Storage-Content-Abfrage einen URL-Query-String in den pvesh-Pfad — den die pvesh-CLI nicht auswertet:

Node-Agent/src/proxmox.rs get_storage_content:

let path = ... format!("/nodes/{}/storage/{}/content?content={}", node_name(), storage, content_type);
pvesh_get_array(&path)   // -> pvesh get <path> --output-format=json

ergibt:

pvesh get /nodes/proxmox/storage/NAS/content?content=backup --output-format=json

pvesh get nimmt Parameter als Flag (--content backup), nicht als ?content=... im Pfad. Das ?content=backup wird Teil der Ressource → Pfad passt nicht → leeres/Fehler-Ergebnis → „Keine Backups sichtbar".

Beweis: Manuell pvesh get /nodes/proxmox/storage/NAS/content (ohne ?content) liefert die Backups (PBS „NAS", volids NAS:backup/vm/100/…, Format pbs-vm/pbs-ct). Der Agent hängt nur ?content=backup an und bekommt nichts.

get_storage_content ist die gemeinsame Funktion für den Backups-Tab (storage.content) und list_all_backups (/all-backups) → beide betroffen.

Fix — Node-Agent/src/proxmox.rs get_storage_content

Content-Typ als pvesh-Flag statt als Query-String:

pub fn get_storage_content(storage: &str, content_type: &str) -> Vec<Value> {
    let path = format!("/nodes/{}/storage/{}/content", node_name(), storage);
    let mut argv: Vec<&str> = vec!["pvesh", "get", &path, "--output-format=json"];
    if !content_type.is_empty() {
        argv.push("--content");
        argv.push(content_type);
    }
    let r = run_argv(&argv, PVESH_TIMEOUT);
    if !r.success { return Vec::new(); }
    serde_json::from_str::<Value>(&r.stdout)
        .ok()
        .and_then(|v| v.as_array().cloned())
        .unwrap_or_default()
}

(Muster identisch zu get_backup_tasks, das pvesh bereits korrekt mit --typefilter/--limit als Flags aufruft.)

Akzeptanz

  • Backups-Tab zeigt die PBS-Backups je Storage; /all-backups ebenfalls.
  • cargo build/clippy grün.

Hinweis

Gleiche Datei/Thema wie #19 (get_task_log) — beides sind Agent-pvesh-Form-Bugs aus der #14-Nacharbeit; sinnvoll gemeinsam auf einem Branch fix/agent-pvesh-shapes zu erledigen.

Branch

fix/agent-pvesh-shapes (zusammen mit #19)

## Root Cause (bestätigt, Stand Commit `b00c2ae0b1`) Der Agent baut für die Storage-Content-Abfrage einen **URL-Query-String in den pvesh-Pfad** — den die `pvesh`-CLI **nicht** auswertet: `Node-Agent/src/proxmox.rs` `get_storage_content`: ```rust let path = ... format!("/nodes/{}/storage/{}/content?content={}", node_name(), storage, content_type); pvesh_get_array(&path) // -> pvesh get <path> --output-format=json ``` ergibt: ``` pvesh get /nodes/proxmox/storage/NAS/content?content=backup --output-format=json ``` `pvesh get` nimmt Parameter als **Flag** (`--content backup`), nicht als `?content=...` im Pfad. Das `?content=backup` wird Teil der Ressource → Pfad passt nicht → leeres/Fehler-Ergebnis → **„Keine Backups sichtbar"**. **Beweis:** Manuell `pvesh get /nodes/proxmox/storage/NAS/content` (ohne `?content`) liefert die Backups (PBS „NAS", volids `NAS:backup/vm/100/…`, Format `pbs-vm`/`pbs-ct`). Der Agent hängt nur `?content=backup` an und bekommt nichts. `get_storage_content` ist die gemeinsame Funktion für den **Backups-Tab** (`storage.content`) **und** `list_all_backups` (`/all-backups`) → beide betroffen. ## Fix — `Node-Agent/src/proxmox.rs` `get_storage_content` Content-Typ als pvesh-Flag statt als Query-String: ```rust pub fn get_storage_content(storage: &str, content_type: &str) -> Vec<Value> { let path = format!("/nodes/{}/storage/{}/content", node_name(), storage); let mut argv: Vec<&str> = vec!["pvesh", "get", &path, "--output-format=json"]; if !content_type.is_empty() { argv.push("--content"); argv.push(content_type); } let r = run_argv(&argv, PVESH_TIMEOUT); if !r.success { return Vec::new(); } serde_json::from_str::<Value>(&r.stdout) .ok() .and_then(|v| v.as_array().cloned()) .unwrap_or_default() } ``` (Muster identisch zu `get_backup_tasks`, das pvesh bereits korrekt mit `--typefilter`/`--limit` als Flags aufruft.) ## Akzeptanz - Backups-Tab zeigt die PBS-Backups je Storage; `/all-backups` ebenfalls. - `cargo build`/`clippy` grün. ## Hinweis Gleiche Datei/Thema wie #19 (`get_task_log`) — beides sind Agent-pvesh-Form-Bugs aus der #14-Nacharbeit; sinnvoll gemeinsam auf einem Branch `fix/agent-pvesh-shapes` zu erledigen. ## Branch `fix/agent-pvesh-shapes` (zusammen mit #19)
chinux changed title from Keine Backups sichtbar to Keine Backups sichtbar — Diagnose (storage.content-Pfad im Commit korrekt) 2026-06-01 19:28:29 +00:00
chinux changed title from Keine Backups sichtbar — Diagnose (storage.content-Pfad im Commit korrekt) to Keine Backups sichtbar — get_storage_content nutzt ?content= statt pvesh --content 2026-06-01 19:33:30 +00: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
chinux/theProx#20
No description provided.