From 86d2987ad8619e1729340f5e22419e32ca769258 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 14 Sep 2026 14:53:57 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20probe=20precision=20=E2=80=94=20add=20re?= =?UTF-8?q?try=20+=20probe-failed=20reporting=20to=20zulip-health?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per defect report 1150.msg: - Add standing probe rules section (2026-09-14) - Step 1 (Zulip API): retry once at 25s on 000, print target + code - Step 2 (Platform A): retry once at 25s on 000, print target + code, note must run on Abiba host - Apply same shape as infrastructure-monitoring: any HTTP status = ALIVE; only 000/timeout = probe-failed Verified: all probes now return real HTTP codes (Zulip API 200, Platform A 200, Tanko 401, Agent Zero 401) --- zulip-health.prose.md | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/zulip-health.prose.md b/zulip-health.prose.md index 46ca1e4..54229f8 100644 --- a/zulip-health.prose.md +++ b/zulip-health.prose.md @@ -127,20 +127,48 @@ grep -c "async def edit_message" ~/.hermes/plugins/*/zulip*/adapter.py ## Execution +### Liveness rule (scoped) + +Any HTTP response proves the service is ALIVE. For auth-gated endpoints (Zulip API, Tanko gateway), a 401/403 redirect or status means the service answered — report the code, never "down". Only a failed CONNECTION (curl status 000, timeout, refused) is a failed probe. + +**STANDING PROBE RULES (2026-09-14, from defect report 1150.msg):** +1. **Any HTTP status means ALIVE.** 200, 301, 302, 401, 403, 404 all prove the service answered — report the code, never "down". A redirect is not a failure. Only a failed CONNECTION (curl status 000, timeout, refused) is a failed probe. +2. **A failed probe is never a service verdict.** Print `probe-failed: ` naming the exact URL/host/port and the failure kind (timeout, refused, no-route, dns), retry once at a longer timeout, and only then report. +3. **Say which probe produced each number.** "API: 000" is unusable; "API https://chat.sysloggh.net/api/v1/server_settings -> connection timeout after 10s (retried at 25s: also timeout)" is actionable. + ### Step 1: Zulip Server Liveness ```bash -curl -s -o /dev/null -w "%{http_code}" https://chat.sysloggh.net/api/v1/server_settings \ - -u 'abiba-bot@chat.sysloggh.net:$ZULIP_API_KEY' +# Probe the Zulip API (authenticated, any HTTP status = ALIVE) +code=$(curl -s -o /dev/null -w '%{http_code}' --connect-timeout 10 https://chat.sysloggh.net/api/v1/server_settings -u 'abiba-bot@chat.sysloggh.net:$ZULIP_API_KEY') +if [ "$code" == "000" ]; then + code=$(curl -s -o /dev/null -w '%{http_code}' --connect-timeout 25 https://chat.sysloggh.net/api/v1/server_settings -u 'abiba-bot@chat.sysloggh.net:$ZULIP_API_KEY') + echo "Zulip API https://chat.sysloggh.net/api/v1/server_settings -> probe-failed: timeout (retried at 25s: still $code)" +else + echo "Zulip API https://chat.sysloggh.net/api/v1/server_settings -> $code" +fi ``` -Expected: `200`. If not → mark `zulip_server_status: "down"`, skip per-platform checks, alert. +Expected: `200` (authenticated). Any HTTP status = ALIVE; only 000/timeout = probe-failed. If not 200 after retry, log as warning but do NOT mark server down — that's a stale expectation, not a fault. ### Step 2: Platform A — pi (Abiba, localhost) **A1: Health Endpoint** -Fetch `http://localhost:9200/health` as JSON. Check: +```bash +# Probe the Abiba extension health endpoint (loopback, any HTTP status = ALIVE) +code=$(curl -s -o /dev/null -w '%{http_code}' --connect-timeout 10 http://127.0.0.1:9200/health) +if [ "$code" == "000" ]; then + code=$(curl -s -o /dev/null -w '%{http_code}' --connect-timeout 25 http://127.0.0.1:9200/health) + echo "Abiba extension http://127.0.0.1:9200/health -> probe-failed: timeout (retried at 25s: still $code)" +else + echo "Abiba extension http://127.0.0.1:9200/health -> $code" +fi +``` + +Expected: `200` with JSON payload `{"zulip":{"connected":true,...}}`. Any HTTP status = ALIVE; only 000/timeout = probe-failed. **NOTE: This probe MUST run on the Abiba host (CT 100) where 127.0.0.1:9200 is the extension. If probed from a different host, the leg will fail — name the host it must run on or probe the extension's real address.** + +Check the JSON payload: | Field | Healthy | Critical | |-------|---------|----------|