#Connect: failed - connect ECONNREFUSED 127.0.0.1:18789 · Capability: unknown

1 messages · Page 1 of 1 (latest)

ember forge
#

robot@robot ~ % openclaw gateway probe

🦞 OpenClaw 2026.4.24 (cbcfdf6) — I run on caffeine, JSON5, and the audacity of "it worked on my machine."



Gateway Status
Reachable: no
Capability: unknown
Probe budget: 3000ms

Discovery (this machine)
Found 1 gateway(s) via Bonjour (local.)

Targets
Local loopback ws://127.0.0.1:18789
Connect: failed - connect ECONNREFUSED 127.0.0.1:18789 · Capability: unknown

knotty lilyBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

faint larkBOT
#

This means the CLI found a local gateway advertisement, but nothing is actually listening on 127.0.0.1:18789 right now — usually the Gateway service is stopped/crashing, or the Bonjour record is stale.

Try this ladder:

openclaw status
openclaw gateway status

If it’s not running:

openclaw gateway restart

If it says there’s no managed service installed:

#
openclaw gateway install --force
openclaw gateway restart

If it still says ECONNREFUSED, grab the startup error:

openclaw logs --follow

If logs can’t attach because the gateway is totally down:

tail -n 200 "$(ls -t /tmp/openclaw/openclaw-*.log | head -1)"
ember forge
#

robot@robot ~ % openclaw gateway restart

🦞 OpenClaw 2026.4.24 (cbcfdf6) — Shell yeah—I'm here to pinch the toil and leave you the glory.

Restarted LaunchAgent: gui/501/ai.openclaw.gateway

faint larkBOT
#

Nice — that confirms launchd accepted the restart. Next thing is to see whether the Gateway actually stayed up.

Run:

openclaw gateway status
openclaw gateway probe

If it still shows ECONNREFUSED, the LaunchAgent is probably starting and then crashing during startup. Grab the log:

openclaw logs --follow

or, if that can’t connect:

#
tail -n 200 "$(ls -t /tmp/openclaw/openclaw-*.log | head -1)"

Also worth running:

openclaw doctor

Paste gateway status + the first error-looking log lines and we can narrow it down. Restart alone only proves the background service was kicked, not that the gateway successfully bound to port 18789.

Docs: https://docs.openclaw.ai/gateway/troubleshooting

ember forge
#

robot@robot ~ % openclaw logs --follow

🦞 OpenClaw 2026.4.24 (cbcfdf6) — Your task has been queued; your dignity has been deprecated.

gateway connect failed: Error: gateway closed (1006):
Gateway not reachable. Is it running and accessible?
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Config: /Users/robot/.openclaw/openclaw.json
Bind: loopback
Hint: run openclaw doctor.

faint larkBOT
#

openclaw logs --follow is failing because it also needs the gateway RPC connection — so we need the file / launchd logs now.

Please run:

openclaw gateway status --deep
openclaw doctor

Then check the startup logs directly:

tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log
tail -n 200 /tmp/openclaw/openclaw-gateway.log
tail -n 200 "$(ls -t /tmp/openclaw/openclaw-*.log | head -1)"
#

One of those should show the actual crash/startup reason.

If those logs are empty, try a foreground smoke test on a different port:

OPENCLAW_SKIP_CHANNELS=1 OPENCLAW_SKIP_CANVAS_HOST=1 openclaw gateway --port 18999 --bind loopback --verbose

Paste the first error from that output. Since you’re on 2026.4.24, if you see npm/plugin dependency errors like ENOTEMPTY, node_modules, or openclaw-unknown-*, call that out — there may be a 2026.4.24 startup/runtime-deps regression involved.

ember forge
#

robot@robot ~ % openclaw gateway status --deep

🦞 OpenClaw 2026.4.24 (cbcfdf6) — Your terminal just grew claws—type something and let the bot pinch the busywork.



Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-04-26.log
Command: /opt/homebrew/opt/node/bin/node /Users/robot/.local/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
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 24048, state active)
Connectivity probe: ok
Capability: admin-capable

Listening: 127.0.0.1:18789
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting

faint larkBOT
#

Good — this is healthy now 🎉

Key lines:

Runtime: running
Connectivity probe: ok
Capability: admin-capable
Listening: 127.0.0.1:18789

So the restart fixed the immediate ECONNREFUSED. To confirm, rerun:

openclaw gateway probe
openclaw logs --follow
#

Both should work now.

If it flips back to ECONNREFUSED after a minute/reboot, then the gateway is probably crashing after startup and we’d want the file logs. But from this output, it’s currently up and reachable.

If this fixed it, please right-click the solution message → Apps → ✅ Mark Solution so Answer Overflow indexes it for future users. 🦐

ember forge
#

now robot@robot ~ % openclaw gateway status --deep

🦞 OpenClaw 2026.4.24 (cbcfdf6) — Welcome to the command line: where dreams compile and confidence segfaults.



Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-04-26.log
Command: /opt/homebrew/opt/node/bin/node /Users/robot/.local/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
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 24277, state active)
Warm-up: launch agents can take a few seconds. Try again shortly.
Connectivity probe: failed
Probe target: ws://127.0.0.1:18789
timeout
Capability: unknown

Port 18789 is already in use.

  • pid 24277 robot: openclaw-gateway (127.0.0.1:18789)
  • Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
    Listening: 127.0.0.1:18789
    Troubles: run openclaw status
    Troubleshooting: https://docs.openclaw.ai/troubleshooting
faint larkBOT
#

Ah — this is a different state now.

The gateway process is running and listening, but it’s not answering RPC before the timeout:

Runtime: running
Listening: 127.0.0.1:18789
Connectivity probe: failed ... timeout

The Port 18789 is already in use line is probably just the gateway itself, not a second process.

First: wait ~20 seconds and rerun:

openclaw gateway probe
#
openclaw gateway status --deep

If it still times out, we need the startup log because this usually means the gateway is stuck during startup/warm-up:

tail -n 200 /tmp/openclaw/openclaw-2026-04-26.log
tail -n 200 ~/.openclaw/logs/gateway.err.log
openclaw doctor

For macOS, prefer:

openclaw gateway restart
ember forge
#

2026-04-26T21:25:14.190-06:00 [openclaw] wrote stability bundle: /Users/robot/.openclaw/logs/stability/openclaw-stability-2026-04-27T03-25-14-189Z-22137-unhandled_rejection.json
2026-04-26T21:25:22.873-06:00 [plugins] bonjour: watchdog detected non-announced service; attempting re-advertise (gateway fqdn=robot (OpenClaw)._openclaw-gw._tcp.local. host=openclaw.local. port=18789 state=probing)
2026-04-26T21:25:32.837-06:00 [plugins] bonjour: restarting advertiser (service stuck in probing for 9964ms (gateway fqdn=robot (OpenClaw)._openclaw-gw._tcp.local. host=openclaw.local. port=18789 state=probing))
2026-04-26T21:25:32.838-06:00 [openclaw] Unhandled promise rejection: CIAO PROBING CANCELLED
2026-04-26T21:25:32.840-06:00 [openclaw] wrote stability bundle: /Users/robot/.openclaw/logs/stability/openclaw-stability-2026-04-27T03-25-32-839Z-22250-unhandled_rejection.json
2026-04-26T21:25:41.251-06:00 [plugins] bonjour: watchdog detected non-announced service; attempting re-advertise (gateway fqdn=robot (OpenClaw)._openclaw-gw._tcp.local. host=openclaw.local. port=18789 state=probing)

faint larkBOT
#

That log is the useful bit: Bonjour/mDNS is getting stuck in probing and throwing CIAO PROBING CANCELLED. That looks like the gateway is tripping over LAN discovery, not auth.

Quick workaround: disable Bonjour discovery and restart:

openclaw plugins disable bonjour
openclaw gateway restart
sleep 10
openclaw gateway status --deep
openclaw gateway probe

This only disables LAN auto-discovery advertising; local CLI/dashboard on 127.0.0.1:18789 should still work.

If it still hangs, export the crash bundle for a GitHub issue:

#
openclaw gateway stability --bundle latest --export

Include that plus the CIAO PROBING CANCELLED lines. This smells bug-worthy, especially on 2026.4.24.

ember forge
#

robot@robot ~ % openclaw gateway status --deep

🦞 OpenClaw 2026.4.24 (cbcfdf6) — Deployed locally, trusted globally, debugged eternally.



Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-04-26.log
Command: /opt/homebrew/opt/node/bin/node /Users/robot/.local/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
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 25304, state active)
Warm-up: launch agents can take a few seconds. Try again shortly.
Connectivity probe: failed
Probe target: ws://127.0.0.1:18789
timeout
Capability: unknown

Port 18789 is already in use.

  • pid 25304 robot: openclaw-gateway (127.0.0.1:18789)
  • Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
    Listening: 127.0.0.1:18789
    Troubles: run openclaw status
    Troubleshooting: https://docs.openclaw.ai/troubleshooting
faint larkBOT
#

This is still the “process is listening but not answering” state. The Port 18789 is already in use line is just PID 25304 — the gateway itself — so don’t chase that.

Did you run the Bonjour disable yet? If not, use the config-level switch and restart:

openclaw config set discovery.mdns.mode off
openclaw config validate
openclaw gateway restart
sleep 15
openclaw gateway status --deep
openclaw gateway probe

Bonjour/mDNS is only LAN discovery convenience, and docs say it can be disabled when multicast/discovery is problematic. (docs.openclaw.ai)

If it still times out after that, paste the fresh tail:

#
grep -iE "bonjour|ciao|unhandled|fatal|error|ready|listening" /tmp/openclaw/openclaw-2026-04-26.log | tail -120

And export the stability bundle for a bug report:

openclaw gateway stability --bundle latest --export

The important thing now is whether discovery.mdns.mode off stops the CIAO PROBING CANCELLED loop.

ember forge
#

i disabled bonjour yes

faint larkBOT
#

Got it — then Bonjour probably wasn’t the only thing blocking startup.

Next check whether the setting actually landed and whether the new logs still mention Bonjour/CIAO:

openclaw config get discovery.mdns.mode
openclaw gateway restart
sleep 20
openclaw gateway status --deep
grep -iE "bonjour|ciao|unhandled|fatal|error|ready|listening" /tmp/openclaw/openclaw-2026-04-26.log | tail -160
tail -n 120 ~/.openclaw/logs/gateway.err.log

If discovery.mdns.mode is off and it’s still timing out, try isolating core startup on a throwaway port:

#
OPENCLAW_DISABLE_BONJOUR=1 OPENCLAW_SKIP_CHANNELS=1 OPENCLAW_SKIP_CANVAS_HOST=1 openclaw gateway --port 18999 --bind loopback --verbose

If that works, the hang is likely in a channel/plugin startup path. If that also hangs, it’s core gateway/config/service-level.

Either way, please also run:

openclaw status --all
openclaw gateway stability --bundle latest --export

If the stability export exists, this is probably worth a GitHub issue with the bundle + CIAO PROBING CANCELLED logs: https://github.com/openclaw/openclaw/issues