openclaw/docs/health.md

29 lines
2.0 KiB
Markdown
Raw Normal View History

---
summary: "Health check steps for Baileys/WhatsApp connectivity"
read_when:
- Diagnosing web provider health
---
2025-12-07 04:33:22 +00:00
# Health Checks (CLI)
Short guide to verify the WhatsApp Web / Baileys stack without guessing.
## Quick checks
2025-12-13 13:25:49 +00:00
- `clawdis status` — local summary: whether creds exist, auth age, session store path + recent sessions.
2025-12-15 10:11:18 -06:00
- `clawdis status --deep` — also probes the running Gateway (WhatsApp connect + Telegram + Discord APIs).
2025-12-13 13:25:49 +00:00
- `clawdis health --json` — asks the running Gateway for a full health snapshot (WS-only; no direct Baileys socket).
- Send `/status` in WhatsApp/WebChat to get a status reply without invoking the agent.
- Logs: tail `/tmp/clawdis/clawdis-*.log` and filter for `web-heartbeat`, `web-reconnect`, `web-auto-reply`, `web-inbound`.
2025-12-07 04:33:22 +00:00
## Deep diagnostics
- Creds on disk: `ls -l ~/.clawdis/credentials/creds.json` (mtime should be recent).
- Session store: `ls -l ~/.clawdis/sessions/sessions.json` (legacy: `~/.clawdis/sessions.json`; path can be overridden in config). Count and recent recipients are surfaced via `status`.
2025-12-21 13:36:26 +01:00
- Relink flow: `clawdis logout && clawdis login --verbose` when status codes 409515 or `loggedOut` appear in logs. (Note: the QR login flow auto-restarts once for status 515 after pairing.)
2025-12-07 04:33:22 +00:00
## When something fails
2025-12-13 13:25:49 +00:00
- `logged out` or status 409515 → relink with `clawdis logout` then `clawdis login`.
- Gateway unreachable → start it: `clawdis gateway --port 18789` (use `--force` if the port is busy).
- No inbound messages → confirm linked phone is online and the sender is allowed (`routing.allowFrom`); for group chats, ensure mention rules match (`routing.groupChat`).
2025-12-07 04:33:22 +00:00
2025-12-07 04:38:20 +00:00
## Dedicated "health" command
2025-12-13 13:25:49 +00:00
`clawdis health --json` asks the running Gateway for its health snapshot (no direct Baileys socket from the CLI). It reports linked creds, auth age, Baileys connect result/status code, session-store summary, and a probe duration. It exits non-zero if the Gateway is unreachable or the probe fails/timeouts. Use `--timeout <ms>` to override the 10s default.