From 53ffcf9b4d0506d1b3b6c5b864934b3b2c9bfa6d Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Fri, 12 Jun 2026 17:30:23 +0200 Subject: [PATCH] =?UTF-8?q?fix(install.sh):=20Verifikation=20pr=C3=BCft=20?= =?UTF-8?q?gateway=5Fstate.json=20statt=20Journal-Grep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: Journal-Grep suchte nur nach 'rocketchat.*connected' — wenn Telegram die einzige Plattform war (Discovery-Bug), galt die Verifikation trotzdem als erfolgreich. Fix: python3 liest gateway_state.json und prüft BEIDE Plattformen: rocketchat=connected UND telegram=connected. Erst dann gilt der Gateway-Start als erfolgreich. Robuster als Journal-Grep: state.json ist die Ground Truth, nicht Log-Zeilen die fehlen können. --- install.sh | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index b0c67b0..71ce85d 100755 --- a/install.sh +++ b/install.sh @@ -517,15 +517,32 @@ perform_update_only() { # Gateway starten systemctl --user start hermes-gateway 2>/dev/null || true - # 6. Verify Rocket.Chat connected (wait up to 60s — Gateway braucht länger nach Cleanup) + # 6. Verify BOTH platforms connected (gateway_state.json — robuster als Journal-Grep) msg verifying local verified=false for i in $(seq 1 24); do sleep 2.5 - if journalctl --user -u hermes-gateway --since "60 seconds ago" --no-pager 2>/dev/null \ - | grep -qE "rocketchat.*connected|✓ rocketchat connected|Subscribed to.*[0-9]+ room"; then - verified=true - break + if [ -f "$HOME/.hermes/gateway_state.json" ]; then + local state_check + state_check=$(python3 -c " +import json, sys +try: + with open('$HOME/.hermes/gateway_state.json') as f: + d = json.load(f) + platforms = d.get('platforms', {}) + rc = platforms.get('rocketchat', {}).get('state', '') + tg = platforms.get('telegram', {}).get('state', '') + if rc == 'connected' and tg == 'connected': + print('OK') + else: + print('WAITING: rc={}, tg={}'.format(rc, tg)) +except Exception as e: + print('ERROR: {}'.format(e)) +" 2>/dev/null) + if [ "$state_check" = "OK" ]; then + verified=true + break + fi fi if [ $((i % 4)) -eq 0 ]; then msg verify_timeout