Fix OpenClaw Gateway Runtime Errors
These queries represent one operational cluster: gateway closed (1006), gateway already running lock timeout, gateway service missing, and spawn docker ENOENT. One recovery runbook is usually enough.
Next Step
Fix now, then reduce repeat incidents
If this issue keeps coming back, validate your setup in Doctor first, then harden your config.
Jump to Symptom
A) gateway service missing / openclaw gateway install
If the service is missing or broken after update/restart, reinstall the gateway service first, then restart.
openclaw gateway install --force openclaw gateway restart openclaw gateway status
B) gateway already running (pid NNN); lock timeout after 5000ms
Usually stale process or stale lock state. Resolve process ownership first, then restart.
openclaw gateway stop # check process on gateway port # macOS/Linux: lsof -i :18789 # Windows: netstat -ano | findstr :18789 # kill stale PID, then openclaw gateway start
Full deep-dive: Gateway Lock Timeout.
C) gateway closed (1006 abnormal closure)
1006 is a transport-level close code, not a single root cause. In practice it often co-occurs with auth mismatch, crash loops, or dependency failures.
openclaw gateway status openclaw logs --follow
If logs include unauthorized/token terms: go to auth cluster.
If logs include pairing required/device identity: approve device or switch to secure context.
If logs include process/port conflicts: clear stale PID and restart service.
If logs include docker ENOENT: install Docker or disable sandbox.
D) spawn docker ENOENT
Means gateway tried to run Docker sandbox but docker executable was not found.
openclaw config set agents.defaults.sandbox.mode off openclaw gateway restart
Full install paths and PATH troubleshooting: spawn docker ENOENT.
Verification Sources Used
Related Cluster Page
If logs show auth/device words, jump to the auth cluster runbook:
Did this guide solve your problem?