From 7498b4167567b3e11daf2c2b36ca10b7584f92e9 Mon Sep 17 00:00:00 2001 From: "Bernd (Hermes)" Date: Sun, 26 Jul 2026 09:50:22 +0200 Subject: [PATCH] =?UTF-8?q?fix(install.sh):=20Post-Deployment-Verifikation?= =?UTF-8?q?=20Timing=20=E2=80=94=2020s=20initial,=205=20Versuche,=20Prozes?= =?UTF-8?q?s-Check=20vorab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/install.sh b/install.sh index def2384..f4f664c 100755 --- a/install.sh +++ b/install.sh @@ -1505,14 +1505,22 @@ if $UPDATE_ONLY; then banner "Post-Deployment-Verifikation" _update_verify_fail=0 - if command -v journalctl >/dev/null 2>&1; then - # Präziser Zeitstempel für journalctl --since (statt relativem Zeitfenster) - _verify_since="$(date '+%Y-%m-%d %H:%M:%S')" - # Warte 12s: Gateway braucht ~5-7s für PresenceEngine, ~8-10s für Archivar/Connected - sleep 12 + # Zuerst: Prüfe ob der Gateway-Prozess überhaupt läuft. + # Wenn der Prozess gecrasht ist, sind Log-Checks sinnlos. + if ! gateway_is_active; then + die "Post-Deployment-Verifikation: Gateway-Prozess ist NICHT active — Gateway ist gecrasht, nicht nur langsam. Prüfe: gateway_journalctl -n 50" + fi + ok "Gateway-Prozess ist active — starte Log-Verifikation" - # Retry-Schleife: bis zu 3 Versuche im Abstand von 5s - for _check_attempt in 1 2 3; do + if command -v journalctl >/dev/null 2>&1; then + # Präziser Zeitstempel für journalctl --since (ab Gateway-Start) + _verify_since="$(date '+%Y-%m-%d %H:%M:%S')" + # Warte 20s: Gateway braucht ~6-8s für PresenceEngine, ~10-15s für + # Archivar/Connected (besonders nach Plugin-Updates mit FAISS-Rebuild) + sleep 20 + + # Retry-Schleife: bis zu 5 Versuche im Abstand von 5s + for _check_attempt in 1 2 3 4 5; do _all_ok=true # Prüfe auf PresenceEngine/presence @@ -1520,7 +1528,7 @@ if $UPDATE_ONLY; then if [ "${_update_presence_hits:-0}" -gt 0 ]; then ok "PresenceEngine im Log gefunden ($_update_presence_hits Treffer)" else - err "FAIL: PresenceEngine NICHT im Gateway-Log (Versuch $_check_attempt/3) — Plugin-Code wurde möglicherweise nicht geladen (stale __pycache__?)" + err "FAIL: PresenceEngine NICHT im Gateway-Log (Versuch $_check_attempt/5) — Plugin-Code wurde möglicherweise nicht geladen (stale __pycache__?)" _all_ok=false fi @@ -1529,7 +1537,7 @@ if $UPDATE_ONLY; then if [ "${_update_archivar_hits:-0}" -gt 0 ]; then ok "'Archivar initialisiert' im Log gefunden ($_update_archivar_hits Treffer)" else - err "FAIL: 'Archivar initialisiert' NICHT im Gateway-Log (Versuch $_check_attempt/3)" + err "FAIL: 'Archivar initialisiert' NICHT im Gateway-Log (Versuch $_check_attempt/5)" _all_ok=false fi @@ -1538,16 +1546,16 @@ if $UPDATE_ONLY; then if [ "${_update_connected_hits:-0}" -gt 0 ]; then ok "'Connected to' im Log gefunden ($_update_connected_hits Treffer)" else - err "FAIL: 'Connected to' NICHT im Gateway-Log (Versuch $_check_attempt/3) — Gateway hat keine Verbindung" + err "FAIL: 'Connected to' NICHT im Gateway-Log (Versuch $_check_attempt/5) — Gateway hat keine Verbindung" _all_ok=false fi if $_all_ok; then - ok "Post-Deployment-Verifikation: ALLE CHECKS BESTANDEN (Versuch $_check_attempt/3)" + ok "Post-Deployment-Verifikation: ALLE CHECKS BESTANDEN (Versuch $_check_attempt/5)" break fi - if [ "$_check_attempt" -lt 3 ]; then + if [ "$_check_attempt" -lt 5 ]; then warn "Warte 5s vor nächstem Verifikations-Versuch..." sleep 5 else