#gateway error.
1 messages Ā· Page 1 of 1 (latest)
That āversion mismatchā is probably a symptom, not the root cause ā the CLI canāt query the gateway because nothing is actually listening on 127.0.0.1:18789.
The key line is:
Gateway port 18789 is not listening (service appears running)
So the systemd service exists and Node is alive, but OpenClaw likely failed/hung before binding the gateway port.
Please paste these next:
journalctl --user -u openclaw-gateway.service -n 200 --no-pager
cat ~/.openclaw/logs/gateway-restart.log
tail -n 200 /tmp/openclaw/openclaw-2026-04-27.log
openclaw doctor
Also, because the machine says *** System restart required *** and your SSH connection reset, Iād do a full reboot if you can:
sudo reboot
Then after reconnecting:
openclaw gateway status --deep
Docs for the gateway troubleshooting ladder: https://docs.openclaw.ai/gateway/troubleshooting š¦
ive actually used this gateway? as node to connect vps with local windows to use browser control. was thsi the problem?
Not directly, no.
Using a Windows node for browser control is a valid setup. But a node failing to connect should not stop the VPS gateway from listening on 127.0.0.1:18789.
What is suspicious:
Gateway: bind=loopback (127.0.0.1)
Gateway port 18789 is not listening
So there are two layers:
- Current blocker: VPS gateway itself is not binding/listening. Need the logs from:
journalctl --user -u openclaw-gateway.service -n 200 --no-pager
cat ~/.openclaw/logs/gateway-restart.log
tail -n 200 /tmp/openclaw/openclaw-2026-04-27.log
- After gateway is healthy: your Windows browser node cannot connect directly to a loopback-only VPS gateway unless you use SSH tunnel / Tailscale / proper remote access. Loopback means āonly clients on the VPS itself.ā
For Windows-as-browser-node, the intended shape is: VPS runs Gateway, Windows runs node host, browser actions proxy through that node. Docs: https://docs.openclaw.ai/nodes and https://docs.openclaw.ai/gateway/remote š¦
Yep ā now we have the real cause, and itās not the Windows node.
Gateway startup is failing because of hook config validation:
hooks.allowedSessionKeyPrefixes is required when a hook mapping sessionKey uses templates
Fix it with either option:
If you use hooks/Gmail/webhooks:
openclaw config set hooks.allowRequestSessionKey true --strict-json
openclaw config set hooks.allowedSessionKeyPrefixes '["hook:","hook:gmail:"]' --strict-json
openclaw config validate
openclaw gateway restart
If you donāt use hooks:
openclaw config set hooks.enabled false --strict-json
openclaw config validate
openclaw gateway restart
Donāt paste your full hooks config here unless you redact tokens. If you want to inspect safely:
openclaw config get hooks.presets --json
openclaw config get hooks.mappings --json
Docs: https://docs.openclaw.ai/gateway/configuration-reference#hooks š¦
what is hook?
A hook is an external trigger into OpenClaw.
Example: some service sends an HTTP request to your gateway like:
POST /hooks/gmail
ā¦and OpenClaw wakes an agent, creates/uses a session, and optionally replies somewhere.
Common uses:
- Gmail/webhook notifications
- custom automations
- āwhen X happens, wake OpenClaw and tell it Yā
Your error means your config has hooks enabled with a templated session key, probably something like:
hook:gmail:{{messages[0].id}}
OpenClaw now requires you to explicitly allow what session key prefixes are safe.
If you donāt know what hooks are / didnāt mean to use them, just disable them:
openclaw config set hooks.enabled false --strict-json
openclaw gateway restart
This wonāt break your Windows browser node setup. Browser nodes do not need hooks.
Docs: https://docs.openclaw.ai/gateway/configuration-reference#hooks š¦
Im using VPS, and im not using window broswer node right now
Yep, then the Windows node is irrelevant here.
Your gateway is failing before it even starts because hooks are enabled in config. If youāre not intentionally using webhook/Gmail hooks, disable them:
openclaw config set hooks.enabled false --strict-json
openclaw config validate
openclaw gateway restart
openclaw gateway status --deep
If that comes back healthy, youāre done.
If it still fails, paste the new last error from:
tail -n 100 /tmp/openclaw/openclaw-2026-04-27.log
Docs: https://docs.openclaw.ai/gateway/configuration-reference#hooks š¦
my oauth providers token refresh failed and sht.. does this matter?
For this specific gateway-not-listening error, probably no.
OAuth token-refresh failures can break model calls later, but your gateway is currently dying at startup because of this config error:
hooks.allowedSessionKeyPrefixes is required...
So fix the hook config first:
openclaw config set hooks.enabled false --strict-json
openclaw config validate
openclaw gateway restart
openclaw gateway status --deep
After the gateway is healthy, then check OAuth/model auth separately:
openclaw models status
openclaw doctor
If OAuth is still broken, re-run the relevant provider setup/configure flow ā but donāt chase that until Connectivity probe: ok first. š¦
what hooks are used for?
Hooks are for event-driven automation ā letting something outside OpenClaw wake or trigger it.
Examples:
- Gmail/webhook notifications: ānew email arrived ā wake an agentā
- Custom webhooks: GitHub, Stripe, your own app, etc. sends
POST /hooks/... - Startup/session hooks: run extra instructions or setup when a session/gateway starts
- Automation glue: āwhen this external event happens, send this message to an agent/sessionā
Theyāre optional. For a normal VPS gateway + Discord/Telegram/chat setup, you often donāt need them.
In Paulās case, hooks are only relevant because the config has them enabled and invalid, so the gateway refuses to start. If heās not intentionally using webhooks/Gmail hooks, disabling them is the right quick fix.
Good ā this is progress. Itās no longer ECONNREFUSED; now the gateway is listening:
Listening: 127.0.0.1:18789
pid 1985645 ubuntu: openclaw-gateway
So donāt change ports. The āport already in useā is just the gateway itself.
Now itās either still warming up or hanging during startup. Wait ~30s, then run:
openclaw gateway status --deep
curl -sS -m 5 http://127.0.0.1:18789/healthz ; echo
curl -sS -m 5 http://127.0.0.1:18789/readyz ; echo
tail -n 120 /tmp/openclaw/openclaw-2026-04-27.log
If healthz works but readyz fails/timeouts, the server is alive but some startup piece is stuck. The log tail should show which one. Also since your VPS says *** System restart required ***, a full reboot is still a reasonable cleanup step if this keeps hanging.
That log tail is still showing the same hooks config error, so first make sure the config change actually applied.
Run these exactly:
openclaw config set hooks.enabled false --strict-json
openclaw config get hooks.enabled --json
openclaw config validate
You want hooks.enabled to print:
false
Then do a clean service restart:
systemctl --user restart openclaw-gateway.service
sleep 10
openclaw gateway status --deep
If it still says timeout, paste the newest log lines with timestamps:
tail -n 200 /tmp/openclaw/openclaw-2026-04-27.log
journalctl --user -u openclaw-gateway.service -n 100 --no-pager
Also: since the VPS says *** System restart required ***, if the config validates but the gateway stays half-alive/listening-but-timeout, reboot the VPS once. That can clear a stuck systemd/process state.
how do i check gateway health
Use these, in order:
openclaw gateway status --deep
Then direct HTTP health endpoints:
curl -sS -m 5 http://127.0.0.1:18789/healthz ; echo
curl -sS -m 5 http://127.0.0.1:18789/readyz ; echo
And the WS health command:
openclaw health --verbose
Healthy signs:
Connectivity probe: ok
Capability: ...
/healthz = basic server is alive.
/readyz = gateway finished startup and is ready.
In your case, fix the hook config first, then re-check:
openclaw config set hooks.enabled false --strict-json
openclaw config validate
openclaw gateway restart
openclaw gateway status --deep
Youāre not crazy ā this state is confusing.
Whatās wrong right now:
ECONNREFUSEDchanged totimeout- port
18789is now owned byopenclaw-gateway - but health/WebSocket doesnāt respond
So the gateway process is alive enough to bind the port, but hung/not ready enough to answer requests.
Do this cleanly:
openclaw config get hooks.enabled --json
openclaw config validate
If hooks.enabled is not false, run:
openclaw config set hooks.enabled false --strict-json
openclaw config validate
Then fully stop/start the service:
systemctl --user stop openclaw-gateway.service
sleep 5
ss -ltnp | grep 18789 || true
systemctl --user start openclaw-gateway.service
sleep 15
openclaw gateway status --deep
If ss still shows something on 18789 after stop, the old process is stuck. Since your VPS already says *** System restart required ***, Iād honestly reboot once:
sudo reboot
Then after reconnect:
openclaw gateway status --deep
tail -n 120 /tmp/openclaw/openclaw-2026-04-27.log
Donāt change ports ā the āport already in useā is just the gateway itself.
ive tried all.
Service: systemd (enabled)
File logs: /tmp/openclaw/openclaw-2026-04-27.log
Command: /usr/bin/node /home/ubuntu/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 1938, state active, sub running, last exit 0, reason 0)
Warm-up: launch agents can take a few seconds. Try again shortly.
Connectivity probe: failed
Probe target: ws://127.0.0.1:18789
connect ECONNREFUSED 127.0.0.1:18789
Capability: unknown
Gateway port 18789 is not listening (service appears running).
Logs: journalctl --user -u openclaw-gateway.service -n 200 --no-pager
Restart log: ~/.openclaw/logs/gateway-restart.log
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
Okay ā stop re-running gateway status for a moment. Itās only telling us the symptom now: systemd process exists, but gateway never binds the port.
We need the startup error.
Run this exact block and paste the output:
openclaw config get hooks.enabled --json
openclaw config validate
journalctl --user -u openclaw-gateway.service -n 250 --no-pager
cat ~/.openclaw/logs/gateway-restart.log
tail -n 200 /tmp/openclaw/openclaw-2026-04-27.log
If those still donāt show a fresh error, do a foreground startup test:
systemctl --user stop openclaw-gateway.service
sleep 3
OPENCLAW_GATEWAY_STARTUP_TRACE=1 openclaw gateway run --port 18789 --verbose
Let it sit ~30 seconds, then paste the last error/output. That will show what startup phase is hanging or crashing. Right now weāre missing the actual cause after the hook fix.
yes. it siads false. and the log is too fucking long for me to paste.
Yeah, donāt paste the whole log ā thatās miserable.
Since hooks.enabled is now false, we need just the new error lines. Run this:
journalctl --user -u openclaw-gateway.service --since "15 minutes ago" --no-pager -o cat \
| grep -Ei 'error|failed|fatal|exception|uncaught|startup|timeout|warn' \
| tail -n 80
And this:
grep -Ei '"logLevelName":"(ERROR|WARN)"|Gateway failed|startup_failed|Unhandled|uncaught|fatal|Error:' \
/tmp/openclaw/openclaw-2026-04-27.log \
| tail -n 80
If thatās still too much, use the diagnostics export instead:
openclaw gateway diagnostics export --output ~/openclaw-diagnostics.zip
Then attach ~/openclaw-diagnostics.zip here. Itās meant for sharing and redacts sensitive stuff.
Right now the important fact is: the old hook issue is fixed, but the gateway still crashes/hangs before listening, so we need the next startup error. š¦
interesting that I'm facing simular problem...
Could be same symptom, but not necessarily same cause. The important distinction is:
ECONNREFUSED= nothing is listening on the porttimeoutwhile port is owned byopenclaw-gateway= process is alive but hung/not answering- The actual cause is usually in the startup logs
For your setup, first run:
openclaw --version
openclaw gateway status --deep
openclaw config validate
Then grab only the useful log lines:
journalctl --user -u openclaw-gateway.service --since "15 minutes ago" --no-pager -o cat \
| grep -Ei 'error|failed|fatal|exception|uncaught|startup|timeout|warn' \
| tail -n 80
And:
grep -Ei '"logLevelName":"(ERROR|WARN)"|Gateway failed|startup_failed|Unhandled|uncaught|fatal|Error:' \
/tmp/openclaw/openclaw-$(date +%F).log \
| tail -n 80
If you see the same hooks error, fix is:
openclaw config set hooks.enabled false --strict-json
openclaw config validate
openclaw gateway restart
But paste your exact filtered error first if itās different. Similar gateway symptoms can come from totally different config failures.
my problem is with slack! Somehow slack makes my Gateway go kaboom
Yeah, Slack can absolutely be the startup trigger if the Slack channel plugin crashes/hangs during init.
First isolate it:
openclaw --version
openclaw config set channels.slack.enabled false --strict-json
openclaw config validate
openclaw gateway restart
openclaw gateway status --deep
If the gateway becomes healthy after that, we know Slack config/runtime is the culprit.
Then grab the Slack-specific errors only:
journalctl --user -u openclaw-gateway.service --since "30 minutes ago" --no-pager -o cat \
| grep -Ei 'slack|bolt|socket|xapp|xoxb|error|failed|fatal|exception' \
| tail -n 100
Also check Slack config shape without leaking tokens:
openclaw config get channels.slack.enabled --json
openclaw config get channels.slack.mode --json
openclaw channels status --probe
Do not paste xoxb-, xapp-, or signing secrets.
Common Slack things to verify: