fix: eliminate race condition on multi-field updates, add PATH fix for cron

- n8n workflow: apply all field changes to full document text in one pass,
  send single documents.update per container/VM instead of multiple patch
  calls (fixed race condition where parallel patches to the same doc could
  partially overwrite each other, e.g. RAM update lost when Swap changed
  simultaneously)
- n8n workflow: add HTTP Request Doc Info (documents.info) node to fetch
  fresh document content by ID instead of relying on the search index
  snapshot, which can lag slightly behind
- n8n workflow: add Aggregate node after documents.update so the
  Loop Over Items (Split In Batches) counter stays correct regardless of
  how many fields changed
- proxmox-inventory-json.sh: explicit PATH export so pct/qm are found
  under cron's restricted PATH (fixes empty containers/vms payload in
  production cron runs while manual testing looked fine)
- README: document all of the above + known limitation with Outline table
  column width metadata not being touched by content-only sync
This commit is contained in:
Claude
2026-07-29 18:47:35 +00:00
parent 7015e26fdf
commit 2f1171e0d4
3 changed files with 42 additions and 12 deletions
+7 -1
View File
@@ -9,6 +9,12 @@
# Voraussetzung: "jq" muss installiert sein.
# apt install -y jq
#
# WICHTIG (Cron): Cron nutzt einen deutlich eingeschränkteren PATH als eine
# interaktive Shell. "pct"/"qm" liegen meist unter /usr/sbin - deshalb wird
# der PATH hier explizit erweitert, damit das Script auch per Cronjob
# zuverlässig funktioniert (nicht nur beim manuellen Testen im Terminal).
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
#
# Nutzung:
# chmod +x proxmox-inventory-json.sh
# ./proxmox-inventory-json.sh # baut JSON + sendet an n8n (alle VMIDs)
@@ -29,7 +35,7 @@ set -euo pipefail
# ---------------------------------------------------------------------------
# KONFIGURATION - hier eure n8n-Webhook-URL eintragen
# ---------------------------------------------------------------------------
N8N_WEBHOOK_URL="https://n8n.example.com/webhook/REPLACE_ME"
N8N_WEBHOOK_URL="https://n8n.vogt.de.com/webhook-test/22ac0717-01fa-4756-a45b-2dc7411a6442"
# Komma-getrennte Liste von VMIDs, die verarbeitet werden sollen, z.B. "101,102,138"
# Leer lassen ("") um wie gewohnt ALLE Container/VMs zu verarbeiten.