Dashboard 1008/unauthorized 排障:先对齐本地 gateway token 再做连接诊断
问题/场景:clean install 后 dashboard 聊天页卡死,日志出现 unauthorized: gateway token missing 与 1008。前置条件:本机部署(macOS/Node 22 场景更常见),已执行 gateway install/start。实施步骤:检查 gateway.remote.token 与 gateway.auth.token 是否一致 → 运行 doctor 生成并写回 token → 重启 gateway 与 dashboard 复测。关键命令:openclaw doctor --generate-gateway-token。验证:Chat 可正常往返,1008 消失。风险:错误复制 token 或混用多个配置文件会导致反复失败。来源:Issue #21044。
GITHUBDiscovered 2026-02-20Author Inchorok
Prerequisites
- Local gateway is reachable on loopback (for example ws://127.0.0.1:18789).
- You can read and update local OpenClaw config file safely.
Steps
- Tail logs and confirm unauthorized/token-missing or close code 1008 appears during dashboard auth.
- Compare gateway.auth.token and gateway.remote.token in current config scope.
- Run doctor token generation and apply the generated token consistently to both sides.
- Restart gateway, reopen dashboard chat, and run an end-to-end ping test.
Commands
openclaw doctor --generate-gateway-tokenopenclaw gateway restartopenclaw gateway statusVerify
Dashboard sends and receives messages normally with no new 1008/unauthorized entries.
Caveats
- Multiple OpenClaw configs on one host can overwrite expected token values; verify active config path first.
- If reverse proxy is in front, websocket auth headers/cookies may still break handshake(需验证).
Source attribution
This tip is aggregated from community/public sources and preserved with attribution.
Open original source ↗