ClawKit Logo
ClawKitReliability Toolkit

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.

A) gateway service missing / openclaw gateway install

If the service is missing or broken after update/restart, reinstall the gateway service first, then restart.

Reinstall gateway service
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.

Safe lock-timeout recovery
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.

Get immediate diagnostic signal
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.

Quick recovery (no Docker)
openclaw config set agents.defaults.sandbox.mode off
openclaw gateway restart

Full install paths and PATH troubleshooting: spawn docker ENOENT.

Verification Sources Used

  • Official docs for Gateway/CLI commands and troubleshooting workflows.
  • Official docs references for token/device/pairing and runtime diagnostics.
  • GitHub issue validation: #1690, #32635, #18470, #30096, #23335, #19168, #4632.

Related Cluster Page

If logs show auth/device words, jump to the auth cluster runbook:

Did this guide solve your problem?