#gateway not connecting
1 messages ¡ Page 1 of 1 (latest)
That error (gateway closed (1006 abnormal closure)) means the CLI tried to open a WebSocket to the Gateway and the connection got dropped without a clean close â most commonly:
- the Gateway isnât running / crashes immediately
- the CLI is pointing at the wrong URL (remote mode / wrong host/port)
- auth/token mismatch (gateway closes the WS)
- service is running but RPC probe fails (config/service mismatch, bind/auth guardrails, port conflict)
Can you run these in order on the machine where the Gateway should be running, and paste the output?
openclaw --version
openclaw status --all
openclaw gateway status
openclaw logs --follow
openclaw doctor
A couple notes:
openclaw status --allis the best thing to share in Discord (itâs meant to be shareable; tokens get redacted).- In
openclaw gateway status, tell us specifically whether it saysRuntime: runningand whetherRPC probe: okor failed.
If you want a quick âtry this firstâ while you gather output:
openclaw gateway restart
openclaw logs --follow
Docs that match this exact symptom/runbook:
- https://docs.openclaw.ai/gateway/troubleshooting (command ladder + âGateway service not runningâ section)
- https://docs.openclaw.ai/help/faq (the âFirst 60 seconds if somethingâs brokenâ checklist)
Once you paste openclaw gateway status + the first relevant error lines from openclaw logs --follow, itâs usually obvious which bucket itâs in.
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Other gateway-like services detected (best effort):
- ai.openclaw.mac (user, plist: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.mac.plist)
Cleanup hint: launchctl bootout gui/$UID/ai.openclaw.gateway
Cleanup hint: rm ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Recommendation: run a single gateway per machine for most setups. One gateway supports multiple agents (see docs: /gateway#multiple-gateways-same-host).
If you need multiple gateways (e.g., a rescue bot on the same host), isolate ports + config/state (see docs: /gateway#multiple-gateways-same-host).
jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw logs --follow
Gateway not reachable. Is it running and accessible?
Gateway target: ws://127.0.0.1:19000
Source: local loopback
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Bind: loopback
That status output is super clear: the LaunchAgent is loaded but the Gateway process exited immediately, so the CLI tries to connect and gets the WS 1006 close because thereâs nothing healthy listening.
openclaw logs --follow wonât work until the Gateway is reachable â you need to look at the file logs / launchd stderr to see why it exited.
Please run these and paste the output (especially the first obvious error/stacktrace):
# 1) What did the gateway crash with?
tail -n 200 /tmp/openclaw/openclaw-2026-02-15.log
# 2) launchd captured stderr (often contains the real exception)
tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log
# 3) sanity: runtime versions
openclaw --version
node -v
Two common causes to check quickly:
A) Port 19000 is already in use
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
B) You accidentally have two gateway-ish services fighting (you have ai.openclaw.mac detected)
Run:
launchctl print gui/$UID/ai.openclaw.gateway | head -n 80
launchctl print gui/$UID/ai.openclaw.mac | head -n 80
If you want the fastest âsee the crash immediatelyâ path, stop the service and run the gateway in the foreground once:
openclaw gateway stop
openclaw gateway --port 19000
It should print the real error directly. Paste that, and we can tell you the exact fix.
Bad request.
Could not find service "ai.openclaw.mac" in domain for user gui: 501
jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw gateway stop
openclaw gateway --port 19000
đŚ OpenClaw 2026.2.13 (203b5bd) â Works on Android. Crazy concept, we know.
Stopped LaunchAgent: gui/501/ai.openclaw.gateway
đŚ OpenClaw 2026.2.13 (203b5bd)
Pairing codes exist because even bots believe in consentâand good security hygiene.
15:10:09 [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
15:10:10 [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
15:10:10 [heartbeat] started
15:10:10 [gateway] agent model: zai/glm-5
15:10:10 [gateway] listening on ws://127.0.0.1:19000 (PID 19309)
15:10:10 [gateway] listening on ws://[::1]:19000
15:10:10 [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
15:10:10 [browser/service] Browser control service ready (profiles=2)
15:10:10 [hooks:loader] Registered hook: boot-md -> gateway:startup
15:10:10 [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
15:10:10 [hooks:loader] Registered hook: command-logger -> command
15:10:10 [hooks:loader] Registered hook: session-memory -> command:new
02:10:10 â ď¸ Session file not found: gateway
02:10:10 Proceeding with reset...
02:10:10 EXECUTE_NEW
jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw --version
2026.2.13
jiwoongyoo@Jis-MacBook-Pro-2 ~ % node -v
v22.22.0
Nice â that confirms the install itself is fine (openclaw 2026.2.13, node v22, and the gateway can bind + start on 127.0.0.1:19000).
Now the key question is: did openclaw gateway --port 19000 keep running, or did it exit back to your shell on its own? (In your paste it looks like you got your prompt back pretty quickly, which would explain why launchd also âexits immediatelyâ.)
Either way, the next step is to pull the real crash reason from the logs (because openclaw logs --follow is RPC-based and wonât work while the gateway is down).
Run and paste:
tail -n 200 /tmp/openclaw/openclaw-2026-02-15.log
tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log
Also worth checking (quick sanity):
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
One very common macOS pattern: works in your terminal, fails under LaunchAgent because launchd doesnât inherit your shell env. Since your default agent model is zai/glm-5, make sure the service can see ZAI_API_KEY (donât paste the key, just confirm it exists in one of these places):
~/.openclaw/.envcontainingZAI_API_KEY=...(recommended), or- config
env: { ZAI_API_KEY: "..." }, or - enable shell import:
{
env: { shellEnv: { enabled: true } }
}
(FAQ section: https://docs.openclaw.ai/help/faq#i-started-the-gateway-via-the-service-and-my-env-vars-disappeared-what-now)
After adding/fixing env, restart the service:
openclaw gateway restart
openclaw gateway status
Paste the log tail from those files and we can pinpoint the exact exit reason in one hop.
Service: LaunchAgent (not loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: unknown (Bad request.
Could not find service "ai.openclaw.gateway" in domain for user gui: 501)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service unit not found.
Service not installed. Run: openclaw gateway install
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Other gateway-like services detected (best effort):
- ai.openclaw.mac (user, plist: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.mac.plist)
Cleanup hint: launchctl bootout gui/$UID/ai.openclaw.gateway
Cleanup hint: rm ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Recommendation: run a single gateway per machine for most setups. One gateway supports multiple agents (see docs: /gateway#multiple-gateways-same-host).
If you need multiple gateways (e.g., a rescue bot on the same host), isolate ports + config/state (see docs: /gateway#multiple-gateways-same-host).
That output means the CLI is trying to probe ws://127.0.0.1:19000, but there is no LaunchAgent job loaded anymore (ai.openclaw.gateway not in launchd), and thereâs also no gateway process currently listening, so you get the 1006 close.
1) Re-install + start the LaunchAgent
Run:
openclaw gateway install --port 19000 --force
openclaw gateway start
openclaw gateway status
If that works, gateway status should show Service: loaded and RPC probe: ok.
2) Make sure the port isnât taken
If it still wonât stay up, check for a port conflict:
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
3) If youâre using --url, donât (or pass token)
Your status output says Source: cli --url. FYI: when you pass --url, the CLI does not fall back to creds from config/env. So after the gateway is running, if you keep using --url you may need to also pass --token (but do not paste tokens in Discord), or just omit --url and let it use your config.
4) If it immediately exits again: paste the crash
If after gateway start it still stops, paste the last ~100 lines:
tail -n 120 /tmp/openclaw/openclaw-2026-02-15.log
tail -n 120 ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
(That will show the actual reason launchd is quitting.)
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 19517, state active)
Warm-up: launch agents can take a few seconds. Try again shortly.
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Gateway port 19000 is not listening (service appears running).
Last gateway error: 2026-02-14T22:14:53.450+11:00 Gateway start blocked: set gateway.mode=local (current: unset) or pass --allow-unconfigured.
Logs: ~/.openclaw/logs/gateway.log
Errors: ~/.openclaw/logs/gateway.err.log
Other gateway-like services detected (best effort):
- ai.openclaw.mac (user, plist: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.mac.plist)
Cleanup hint: launchctl bootout gui/$UID/ai.openclaw.gateway
Cleanup hint: rm ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Recommendation: run a single gateway per machine for most setups. One gateway supports multiple agents (see docs: /gateway#multiple-gateways-same-host).
If you need multiple gateways (e.g., a rescue bot on the same host), isolate ports + config/state (see docs: /gateway#multiple-gateways-same-host).
That last line is the smoking gun:
Gateway start blocked: set
gateway.mode=local(current: unset) or pass--allow-unconfigured.
So launchd is starting the process, but the Gateway immediately refuses to run (guardrail), so nothing ends up listening on :19000 â CLI gets the 1006 WS close.
Fix (recommended): set gateway mode in config, then restart the service:
openclaw config set gateway.mode local
openclaw gateway restart
openclaw gateway status
If you want to confirm the value first:
openclaw config get gateway.mode
After that, openclaw gateway status should show RPC probe: ok and the port should be listening.
Refs:
- Config CLI: https://docs.openclaw.ai/cli/config
- Gateway note about
gateway.mode=local/--allow-unconfigured: https://docs.openclaw.ai/cli/gateway
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 19915, state active)
Warm-up: launch agents can take a few seconds. Try again shortly.
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Gateway port 19000 is not listening (service appears running).
Last gateway error: 2026-02-14T22:14:53.450+11:00 Gateway start blocked: set gateway.mode=local (current: unset) or pass --allow-unconfigured.
Logs: ~/.openclaw/logs/gateway.log
Errors: ~/.openclaw/logs/gateway.err.log
Other gateway-like services detected (best effort):
- ai.openclaw.mac (user, plist: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.mac.plist)
Cleanup hint: launchctl bootout gui/$UID/ai.openclaw.gateway
Cleanup hint: rm ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Recommendation: run a single gateway per machine for most setups. One gateway supports multiple agents (see docs: /gateway#multiple-gateways-same-host).
If you need multiple gateways (e.g., a rescue bot on the same host), isolate ports + config/state (see docs: /gateway#multiple-gateways-same-host).
jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw config get gateway.mode
local
Good â gateway.mode is set correctly now.
What youâre seeing in gateway status is just the last recorded failure from before that change. The LaunchAgent needs a restart to pick up the updated config and actually bind the port.
Run:
openclaw gateway restart
# wait ~5 seconds
openclaw gateway status
If it still says âport 19000 is not listeningâ, verify whether anything is listening:
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
âŚand paste the crash reason from the service logs (this is the real source of truth when RPC probe canât connect):
tail -n 120 ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
tail -n 120 ~/.openclaw/logs/gateway.log 2>/dev/null || true
tail -n 120 /tmp/openclaw/openclaw-2026-02-15.log
Once the gateway is actually listening, the 1006 WebSocket close will go away and RPC probe should flip to ok.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw gateway restart
wait ~5 seconds
openclaw gateway status
Restarted LaunchAgent: gui/501/ai.openclaw.gateway
zsh: not enough directory stack entries.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % lsof -nP -iTCP:19000 -sTCP:LISTEN || true
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
{"0":"Proceeding with reset...","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-14T15:23:38.667Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-14T15:23:38.667Z"}
{"0":"EXECUTE_NEW","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-14T15:23:38.667Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-14T15:23:38.667Z"}
Yep â lsof shows nothing is listening on 19000, so the LaunchAgent process is either:
- crash-looping very early, or
- exiting immediately (launchd may still show a âpidâ briefly)
The two JSON lines you pasted (Proceeding with reset... / EXECUTE_NEW) are not the actual failure â theyâre just startup/session init noise. We need the launchd stderr to see why it never binds the port.
Run these and paste the output (last ~80â200 lines):
tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log
tail -n 200 /tmp/openclaw/openclaw-2026-02-15.log
Also, that zsh: not enough directory stack entries. is coming from your shell config/plugins, not OpenClaw â just ignore it and run the commands on separate lines (or do a real wait like sleep 5).
One very likely macOS cause once gateway.mode=local is fixed: LaunchAgent doesnât inherit your shell env, so any model key you had in .zshrc wonât exist for the service. Your gateway log earlier said agent model: zai/glm-5, so if ZAI_API_KEY isnât available to launchd, startup can fail.
If the logs mention missing env/API key, fix by putting it in:
~/.openclaw/.env(recommended) e.g.ZAI_API_KEY=...- then:
openclaw gateway restart
Paste the gateway.err.log tail and weâll know which exact error it is.
{"0":"â ď¸ Session file not found: gateway","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-14T15:26:05.607Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-14T15:26:05.607Z"}
{"0":"Proceeding with reset...","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-14T15:26:05.607Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-14T15:26:05.607Z"}
{"0":"EXECUTE_NEW","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-14T15:26:05.608Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-14T15:26:05.608Z"}
Those 3 JSON lines are not the failure â theyâre just startup/session-init chatter. The important tell is: thereâs no later line like listening on ws://127.0.0.1:19000, and lsof confirms nothing is listening, so the launchd-run gateway is dying or getting stuck before it binds the port.
Next, we need the actual launchd stderr / gateway log, not just the last 3 lines.
Run these and paste the output:
ls -la ~/.openclaw/logs | sed -n '1,120p'
tail -n 200 ~/.openclaw/logs/gateway.err.log 2>/dev/null || echo "no gateway.err.log"
tail -n 200 ~/.openclaw/logs/gateway.log 2>/dev/null || echo "no gateway.log"
tail -n 200 /tmp/openclaw/openclaw-2026-02-15.log
Also: your zsh: not enough directory stack entries. is a shell init error (usually from a popd in .zshrc/plugin). If you have shell env import enabled, that can break the gateway when it starts under launchd.
Check:
openclaw config get env.shellEnv
- If it shows
enabled: true, try disabling it (and instead put keys in~/.openclaw/.env):
openclaw config set env.shellEnv.enabled false
openclaw gateway restart
Finally, grab launchdâs view of the job (this often shows exit reason / last status):
launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,220p'
ps -p 19915 -o pid,etime,command
Once we see gateway.err.log (or launchctl print output), weâll know exactly why it never reaches the âlistening on âŚâ step.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw config get env.shellEnv
Config path not found: env.shellEnv
Config path not found: env.shellEnv is totally fine â it just means you havenât enabled shell env import in your config (so thatâs not whatâs causing this).
Right now we still have the same core symptom: launchd says the job is ârunningâ, but nothing is actually listening on 19000, so the gateway is either crashing very early or stuck before bind. To see why, we need the LaunchAgent stdout/stderr logs (not the little âEXECUTE_NEWâ lines).
Please run these and paste the output:
ls -la ~/.openclaw/logs | sed -n '1,120p'
echo "---- gateway.err.log ----"
tail -n 200 ~/.openclaw/logs/gateway.err.log 2>/dev/null || echo "no gateway.err.log"
echo "---- gateway.log ----"
tail -n 200 ~/.openclaw/logs/gateway.log 2>/dev/null || echo "no gateway.log"
echo "---- /tmp log tail ----"
tail -n 200 /tmp/openclaw/openclaw-2026-02-15.log
And also launchdâs view of the job (this often shows the exit code / respawn loop):
launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,220p'
Once we have gateway.err.log (or the launchctl print snippet), we can tell exactly whatâs preventing it from reaching the normal line like listening on ws://127.0.0.1:19000.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,220p'
ps -p 19915 -o pid,etime,command
gui/501/ai.openclaw.gateway = {
active count = 0
path = /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist
type = LaunchAgent
state = spawn scheduled
program = /opt/homebrew/bin/node
arguments = {
/opt/homebrew/bin/node
/opt/homebrew/lib/node_modules/openclaw/dist/index.js
gateway
--port
19000
}
stdout path = /Users/jiwoongyoo/.openclaw/logs/gateway.log
stderr path = /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
inherited environment = {
SSH_AUTH_SOCK => /private/tmp/com.apple.launchd.adDrmHsp60/Listeners
}
default environment = {
PATH => /usr/bin:/bin:/usr/sbin:/sbin
}
environment = {
OSLogRateLimit => 64
OPENCLAW_GATEWAY_TOKEN => 6b4ed628d347085e040e90f776d6ef6ea9cfe12fda9101af
OPENCLAW_GATEWAY_PORT => 19000
OPENCLAW_SERVICE_VERSION => 2026.2.13
OPENCLAW_SYSTEMD_UNIT => openclaw-gateway.service
OPENCLAW_LAUNCHD_LABEL => ai.openclaw.gateway
PATH => /opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin
HOME => /Users/jiwoongyoo
OPENCLAW_SERVICE_KIND => gateway
OPENCLAW_SERVICE_MARKER => openclaw
XPC_SERVICE_NAME => ai.openclaw.gateway
}
domain = gui/501 [100022]
asid = 100022
minimum runtime = 10
exit timeout = 5
runs = 78
last exit code = 0
resource coalition = {
ID = 2124
type = resource
state = active
active count = 1
name = ai.openclaw.gateway
}
jetsam coalition = {
ID = 2125
type = jetsam
state = active
active count = 1
name = ai.openclaw.gateway
}
spawn type = daemon (3)
jetsam priority = 40
jetsam memory limit (active) = (unlimited)
jetsam memory limit (inactive) = (unlimited)
jetsamproperties category = daemon
jetsam thread limit = 32
cpumon = default
job state = exited
properties = partial import | keepalive | runatload | inferred program
}
PID ELAPSED COMMAND
Two important things from that launchctl print:
- Your Gateway token got posted (
OPENCLAW_GATEWAY_TOKEN=...). Thatâs effectively âadmin accessâ to your local gateway. Please delete/edit that message in Discord and rotate the token after weâre done debugging.
You can rotate it like this (donât paste the new token here):
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
- launchd says:
state = spawn scheduledactive count = 0
That usually means the job is crash-looping and launchd is throttling restarts (or itâs failing instantly). To see why, we need the part of launchctl print that includes last exit status / throttle info, plus the stderr log.
Paste these outputs
# show the rest of the job info (exit code / throttle / last spawn result)
launchctl print gui/$UID/ai.openclaw.gateway | sed -n '220,520p'
# the real error is almost always here:
tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log
Quick âforce start onceâ (optional but helpful)
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
Once we see gateway.err.log + the âlast exit codeâ section, weâll know exactly whatâs killing it under launchd (permissions, config parse error, missing file, etc.).
That launchctl print + the ps output is telling:
job state = exited,active count = 0,runs = 78ps -p 19915 âŚprinted only the header â that PID is gone- so launchd is basically spawn-looping the job and it exits almost immediately (oddly with
last exit code = 0).
We need the actual stdout/stderr from launchd to see why itâs exiting.
0) Security note: rotate your gateway token
You pasted OPENCLAW_GATEWAY_TOKEN earlier. Please delete/edit that Discord message, then rotate the token (donât paste the new one):
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
1) Show the service error logs (this is the key)
Paste these (they should contain the real reason it exits):
tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log
2) Force one immediate start, then re-tail logs
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
tail -n 200 ~/.openclaw/logs/gateway.err.log
Once we see gateway.err.log, we can stop guessing and tell you exactly whatâs making it exit before it ever reaches listening on ws://127.0.0.1:19000.
, autoRecall: true, autoCapture: true)
2026-02-14T15:36:10.484Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T15:36:10.523Z [heartbeat] started
2026-02-14T15:36:10.525Z [gateway] agent model: zai/glm-5
2026-02-14T15:36:10.526Z [gateway] listening on ws://127.0.0.1:19000 (PID 21236)
2026-02-14T15:36:10.526Z [gateway] listening on ws://[::1]:19000
2026-02-14T15:36:10.527Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T15:36:10.536Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T15:36:10.630Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T15:36:10.642Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T15:36:10.642Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T15:36:10.644Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T02:36:10.645+11:00 â ď¸ Session file not found: gateway
2026-02-15T02:36:10.646+11:00 Proceeding with reset...
2026-02-15T02:36:10.647+11:00 EXECUTE_NEW
Perfect â that log snippet shows the Gateway is now actually up:
[gateway] listening on ws://127.0.0.1:19000- browser service ready, hooks loaded, etc.
The â ď¸ Session file not found: gateway ⌠reset ⌠EXECUTE_NEW is normal on first boot / after a reset and not an error.
Next checks:
- Confirm the port is really listening now:
lsof -nP -iTCP:19000 -sTCP:LISTEN
- Confirm the CLI can probe it without a manual
--urloverride:
openclaw gateway status
openclaw status
If gateway status still shows Source: cli --url / still fails with 1006, that usually means youâre forcing --url somewhere, and when you do that the CLI wonât fall back to stored credentials. In that case, either:
- donât use
--url(preferred), or - use
--url ⌠--token âŚ(but do not paste the token in Discord).
Important: you accidentally posted OPENCLAW_GATEWAY_TOKEN earlier. Please delete/edit that message and rotate the token:
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Other gateway-like services detected (best effort):
- ai.openclaw.mac (user, plist: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.mac.plist)
Cleanup hint: launchctl bootout gui/$UID/ai.openclaw.gateway
Cleanup hint: rm ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Update â pnpm ¡ npm latest 2026.2.13 â
â Gateway â local ¡ ws://127.0.0.1:19000 (local loopback) ¡ unreachable (connect failed: â
â â connect ECONNREFUSED 127.0.0.1:19000) â
â Gateway service â LaunchAgent installed ¡ loaded ¡ stopped (state active) â
â Node service â LaunchAgent not installed â
â Agents â 1 ¡ 1 bootstrapping ¡ sessions 30 ¡ default main active 5h ago â
â Memory â enabled (plugin openclaw-mem0) â
â Probes â skipped (use --deep)
Security audit
Summary: 1 critical ¡ 2 warn ¡ 1 info
CRITICAL DANGEROUS: Control UI device auth disabled
gateway.controlUi.dangerouslyDisableDeviceAuth=true disables device identity checks for the Control UI.
Fix: Disable it unless you are in a short-lived break-glass scenario.
WARN Reverse proxy headers are not trusted
gateway.bind is loopback and gateway.trustedProxies is empty. If you expose the Control UI through a reverse proxy, configure trusted proxies so local-client câŚ
Fix: Set gateway.trustedProxies to your proxy IPs or keep the Control UI local-only.
WARN Extension plugin tools may be reachable under permissive tool policy
Enabled extension plugins: openclaw-mem0. Permissive tool policy contexts: - default
The snippet you pasted from gateway.log is the good part (it did bind and print listening on ws://127.0.0.1:19000). But your latest openclaw gateway status / openclaw status shows ECONNREFUSED â which means the process exited again after that.
So we need the end of the launchd logs (the lines right after it stops), not the startup lines.
0) Quick security thing (important)
You accidentally pasted your OPENCLAW_GATEWAY_TOKEN earlier. Please delete/edit that Discord message and rotate the token (donât paste the new one):
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
1) Reproduce + capture the exit reason
Run this as a bundle and paste the output:
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
echo "---- ERR (last 120) ----"
tail -n 120 ~/.openclaw/logs/gateway.err.log || true
echo "---- LOG (last 200) ----"
tail -n 200 ~/.openclaw/logs/gateway.log || true
What weâre looking for is anything like âshutting downâ, a stack trace, âunauthorizedâ, âconfig errorâ, etc. (Right now we only see it starting, not why it stops.)
2) Also: list any other OpenClaw launchd jobs (possible conflict)
launchctl list | grep -i openclaw || true
Once you paste the tail of gateway.err.log + the last ~200 lines of gateway.log, itâll be obvious whatâs killing it.
That security audit output is worth fixing ASAP â especially because you already pasted a gateway token earlier.
Fix the CRITICAL: Control UI device auth disabled
You have:
gateway.controlUi.dangerouslyDisableDeviceAuth=trueâ break-glass only
Turn it off:
openclaw config set gateway.controlUi.dangerouslyDisableDeviceAuth false --json
openclaw gateway restart
Rotate your gateway token (since it was posted)
Please delete/edit the Discord message that contained the token, then rotate it (donât paste the new one):
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
The WARNs
- Reverse proxy headers not trusted: if youâre truly loopback-only (127.0.0.1) and not putting it behind a reverse proxy, you can ignore this. If you are proxying the Control UI, you should set
gateway.trustedProxiesto your proxy IPs. - Extension plugin tools reachable under permissive policy: mostly informational for local personal use. If this gateway is exposed to others, we can lock down tool policy later.
Separate issue: gateway keeps exiting (why you still get 1006 / ECONNREFUSED)
Your earlier gateway.log showed it did bind to :19000, but then later openclaw status shows ECONNREFUSED again â so itâs exiting after startup.
To find the exact reason, paste the tail of stderr, not the startup log:
tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log
If you want to force a fresh crash/repro right before tailing:
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
tail -n 200 ~/.openclaw/logs/gateway.err.log
Once we see gateway.err.log, weâll know exactly whatâs killing the service.
2026-02-14T15:43:18.583Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T15:43:18.965Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T15:43:19.005Z [heartbeat] started
2026-02-14T15:43:19.007Z [gateway] agent model: zai/glm-5
2026-02-14T15:43:19.008Z [gateway] listening on ws://127.0.0.1:19000 (PID 21940)
2026-02-14T15:43:19.008Z [gateway] listening on ws://[::1]:19000
2026-02-14T15:43:19.009Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T15:43:19.018Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T15:43:19.111Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T15:43:19.122Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T15:43:19.122Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T15:43:19.125Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T02:43:19.125+11:00 â ď¸ Session file not found: gateway
2026-02-15T02:43:19.126+11:00 Proceeding with reset...
2026-02-15T02:43:19.127+11:00 EXECUTE_NEW
Those gateway.log lines look healthy (it does bind and prints listening on ws://127.0.0.1:19000 (PID âŚ)), but then your openclaw status immediately after shows ECONNREFUSED / âservice ⌠exited immediatelyâ â so itâs starting and then stopping a moment later.
Right now weâre missing the one thing that explains why: ~/.openclaw/logs/gateway.err.log (launchd stderr). The stdout log you pasted wonât show crashes.
Please paste these (important: redact tokens/keys if any show up):
# after it "stops", grab the tails:
tail -n 200 ~/.openclaw/logs/gateway.err.log
tail -n 200 ~/.openclaw/logs/gateway.log
# and confirm whether anything is listening right now:
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
If gateway.err.log is empty, also paste:
ls -la ~/.openclaw/logs
Two important side-notes:
- You previously pasted
OPENCLAW_GATEWAY_TOKENfromlaunchctl print. Thatâs effectively admin access to your gateway. Please delete/edit that Discord message and rotate the token (donât paste the new one):
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
- Your security audit flagged CRITICAL:
gateway.controlUi.dangerouslyDisableDeviceAuth=true. Turn that off unless you really need break-glass:
openclaw config set gateway.controlUi.dangerouslyDisableDeviceAuth false --json
openclaw gateway restart
Once you paste the gateway.err.log tail, we should be able to point to the exact line thatâs making launchd exit the gateway.
026-02-14T15:46:08.197Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T15:46:08.603Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T15:46:08.643Z [heartbeat] started
2026-02-14T15:46:08.645Z [gateway] agent model: zai/glm-5
2026-02-14T15:46:08.646Z [gateway] listening on ws://127.0.0.1:19000 (PID 22419)
2026-02-14T15:46:08.646Z [gateway] listening on ws://[::1]:19000
2026-02-14T15:46:08.647Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T15:46:08.656Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T15:46:08.751Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T15:46:08.762Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T15:46:08.762Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T15:46:08.764Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T02:46:08.765+11:00 â ď¸ Session file not found: gateway
2026-02-15T02:46:08.767+11:00 Proceeding with reset...
2026-02-15T02:46:08.767+11:00 EXECUTE_NEW
jiwoongyoo@Jis-MacBook-Pro-2 ~ % lsof -nP -iTCP:19000 -sTCP:LISTEN || true
jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -la ~/.openclaw/logs
total 64296
drwx------ 5 jiwoongyoo staff 160 14 Feb 15:56 .
drwx------@ 41 jiwoongyoo staff 1312 15 Feb 02:44 ..
-rw-------@ 1 jiwoongyoo staff 26829 15 Feb 02:42 config-audit.jsonl
-rwx------ 1 jiwoongyoo staff 27262236 15 Feb 01:36 gateway.err.log
-rwx------ 1 jiwoongyoo staff 4599414 15 Feb 02:46 gateway.log
jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw config set gateway.controlUi.dangerouslyDisableDeviceAuth false --json
Good: your gateway.log shows it does start and bind:
listening on ws://127.0.0.1:19000 (PID âŚ)
But then lsof shows nothing listening, so the process is exiting almost immediately after startup. The only place that will say why is gateway.err.log.
1) Paste the tail of stderr (redact any tokens/keys)
tail -n 120 ~/.openclaw/logs/gateway.err.log
If itâs super noisy, this often pulls the useful bits:
rg -n "ERROR|Error|FATAL|Unhandled|EADDR|ECONN|permission|ENOENT|EACCES" ~/.openclaw/logs/gateway.err.log | tail -n 60
2) Catch it âin the actâ (so we know if it lives for 0.2s vs 5s)
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
for i in {1..12}; do lsof -nP -iTCP:19000 -sTCP:LISTEN; sleep 0.25; done
3) You flipped the CRITICAL setting â now restart
You ran:
openclaw config set gateway.controlUi.dangerouslyDisableDeviceAuth false --json
Now do:
openclaw gateway restart
Also: you accidentally posted your OPENCLAW_GATEWAY_TOKEN earlier. Please delete/edit that Discord message and rotate the token (donât paste the new one):
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
Once you paste the gateway.err.log tail, weâll be able to tell exactly whatâs killing the LaunchAgent.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl kickstart -k gui/$UID/ai.openclaw.gateway
for i in {1..12}; do lsof -nP -iTCP:19000 -sTCP:LISTEN; sleep 0.25; done
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 23150 jiwoongyoo 16u IPv4 0x9d80409a76fdba6f 0t0 TCP 127.0.0.1:19000 (LISTEN)
node 23150 jiwoongyoo 17u IPv6 0xfcdf034f3e471dc7 0t0 TCP [::1]:19000 (LISTEN)
Nice â that loop shows the gateway is actually staying up and listening now (PID 23150 on both IPv4 + IPv6).
Next, verify the CLI can successfully RPC-probe it:
openclaw gateway status
openclaw status
If that now flips to RPC probe: ok, youâre done.
If gateway status still fails and says Source: cli --url: stop forcing --url (that bypasses normal credential fallback). Just run openclaw gateway status with no --url.
If you must use --url, you also need to pass auth explicitly (donât paste tokens in Discord):
openclaw gateway status --url ws://127.0.0.1:19000 --token "<your-token>"
If it dies again after a few seconds/minutes
Then itâs crash-looping after initial bind. Grab the actual error (stderr):
tail -n 120 ~/.openclaw/logs/gateway.err.log
tail -n 60 ~/.openclaw/logs/gateway.log
Important security cleanup
You previously posted your OPENCLAW_GATEWAY_TOKEN (from launchctl print). Please delete/edit that message and rotate the token:
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
Tell me what openclaw gateway status shows right now (especially whether RPC probe is ok).
026-02-15T02:53:06.932+11:00 â ď¸ Session file not found: gateway
2026-02-15T02:53:06.933+11:00 Proceeding with reset...
2026-02-15T02:53:06.933+11:00 EXECUTE_NEW
2026-02-14T15:53:16.867Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T15:53:17.249Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T15:53:17.290Z [heartbeat] started
2026-02-14T15:53:17.292Z [gateway] agent model: zai/glm-5
2026-02-14T15:53:17.293Z [gateway] listening on ws://127.0.0.1:19000 (PID 23487)
2026-02-14T15:53:17.293Z [gateway] listening on ws://[::1]:19000
2026-02-14T15:53:17.294Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T15:53:17.303Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T15:53:17.399Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T15:53:17.411Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T15:53:17.412Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T15:53:17.414Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T02:53:17.415+11:00 â ď¸ Session file not found: gateway
2026-02-15T02:53:17.416+11:00 Proceeding with reset...
2026-02-15T02:53:17.417+11:00 EXECUTE_NEW
Those lines are just the gateway startup log (and they look fine: it is binding and printing listening on ws://127.0.0.1:19000). The â ď¸ Session file not found: gateway â reset â EXECUTE_NEW is normal on first boot / after a restart.
Now letâs confirm the current state (right now), because previously you had âlisteningâŚâ in the log but ECONNREFUSED in openclaw status:
- Is it actually listening right now?
lsof -nP -iTCP:19000 -sTCP:LISTEN
- Does the CLI probe succeed without forcing
--url?
openclaw gateway status
Important: your earlier status outputs kept saying Source: cli --url. If you run any command with --url âŚ, the CLI wonât do its normal âuse the service/config credsâ behavior. So for debugging, run openclaw gateway status with no --url.
If lsof shows itâs listening but gateway status still fails, paste the output of openclaw gateway status (it wonât include secrets).
Security cleanup (please do this too):
- You posted your
OPENCLAW_GATEWAY_TOKENearlier vialaunchctl print. Delete/edit that message and rotate the token:openclaw config set gateway.auth.token "$(openssl rand -hex 32)" openclaw gateway restart
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
The key contradiction is:
~/.openclaw/logs/gateway.logshows it binds and starts (listening on ws://127.0.0.1:19000)- but
openclaw gateway statusshows ECONNREFUSED / Runtime: stopped â so itâs exiting shortly after startup
At this point the only thing that will tell us why it exits is the end of gateway.err.log (stderr). The stdout log youâre pasting wonât include crashes.
Run this to reproduce + capture the shutdown reason:
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
sleep 3
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
tail -n 120 ~/.openclaw/logs/gateway.err.log
- If the second
lsofgoes empty, weâve confirmed it dies within a few seconds. - Then the last ~120 lines of
gateway.err.logshould show the exact error/stacktrace.
One more thing: your gateway status output keeps saying Source: cli --url. If youâre running commands with --url, try without it for now:
openclaw gateway status
(Just in case thereâs a wrapper/alias injecting --url and confusing the probe behavior.)
(node:13520) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13534) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13614) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13636) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13651) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13665) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13681) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13695) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13709) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:13723) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
Those DEP0040 punycode lines are just Node deprecation warnings (noise). They donât explain the gateway dropping â they just spam gateway.err.log every time the process starts.
What we need now is to answer two questions:
1) Is the gateway actually up right now?
lsof -nP -iTCP:19000 -sTCP:LISTEN
2) If it is listening, can you successfully RPC into it when you include auth?
Run this (safe: it wonât print your token):
openclaw gateway call health \
--url ws://127.0.0.1:19000 \
--token "$(openclaw config get gateway.auth.token)" \
--timeout 3000
-
If that succeeds, but
openclaw gateway statusstill showsSource: cli --url+ 1006, then youâre almost certainly forcing--urlsomewhere without credentials (alias/script). Quick check:type -a openclaw alias openclaw 2>/dev/null || trueFix is: donât use
--url(preferred), or always pair it with--token âŚlike above. -
If itâs not listening, then we need the tail end of the logs right after it exits (your pastes so far are only the startup section). Grab:
tail -n 80 ~/.openclaw/logs/gateway.log tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
Security cleanup (important): you posted OPENCLAW_GATEWAY_TOKEN earlier â please delete/edit that message and rotate it:
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
jiwoongyoo@Jis-MacBook-Pro-2 ~ % lsof -nP -iTCP:19000 -sTCP:LISTEN
jiwoongyoo@Jis-MacBook-Pro-2 ~ % openclaw gateway call health
--url ws://127.0.0.1:19000
--token "$(openclaw config get gateway.auth.token)"
--timeout 3000
â
Gateway call failed: Error: gateway url override requires explicit credentials
Fix: pass --token or --password (or gatewayToken in tools).
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
2026-02-14T16:06:11.670Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T16:06:12.060Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T16:06:12.099Z [heartbeat] started
2026-02-14T16:06:12.101Z [gateway] agent model: zai/glm-5
2026-02-14T16:06:12.102Z [gateway] listening on ws://127.0.0.1:19000 (PID 24757)
2026-02-14T16:06:12.103Z [gateway] listening on ws://[::1]:19000
2026-02-14T16:06:12.104Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T16:06:12.112Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T16:06:12.207Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T16:06:12.219Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T16:06:12.219Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T16:06:12.222Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T03:06:12.222+11:00 â ď¸ Session file not found: gateway
2026-02-15T03:06:12.223+11:00 Proceeding with reset...
2026-02-15T03:06:12.224+11:00 EXECUTE_NEW
Two separate things going on there:
1) lsof shows nothing listening
So at the exact moment you ran it, the gateway wasnât up yet. Your gateway.log shows it came up a second later (listening on ws://127.0.0.1:19000 (PID 24757)).
Run this after you see the âlisteningâŚâ line (or just wait 2s):
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN
2) gateway call ⌠--url ⌠is failing because your --token "$(openclaw config get gateway.auth.token)" is coming through empty
That error is thrown by the CLI before it even tries to connect. It only happens when --url is set and the token/password is missing/empty.
Most likely: gateway.auth.token is not set in your config, because the token is currently only stored in the LaunchAgent environment.
Check without printing the token:
openclaw config get gateway.auth.token >/dev/null && echo "token_in_config=yes" || echo "token_in_config=no"
Fix (make token live in config + service consistently)
This also helps because a token was pasted earlier and should be rotated anyway:
NEW="$(openssl rand -hex 32)"
openclaw gateway stop
openclaw config set gateway.auth.token "$NEW"
openclaw gateway install --port 19000 --force --token "$NEW"
openclaw gateway start
Then the probe should work:
openclaw gateway status
openclaw gateway call health --timeout 3000
(And you wonât need --url at all if your config/service already points at 19000.)
About the punycode warnings
Those (DEP0040) lines are just Node 22 deprecation noise; safe to ignore. They can spam gateway.err.log, but they arenât the cause of the gateway not listening.
â
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 25420, state active)
Warm-up: launch agents can take a few seconds. Try again shortly.
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Gateway port 19000 is not listening (service appears running).
Last gateway error: 2026-02-14T22:14:53.450+11:00 Gateway start blocked: set gateway.mode=local (current: unset) or pass --allow-unconfigured.
Logs: ~/.openclaw/logs/gateway.log
Errors: ~/.openclaw/logs/gateway.err.log
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
Gateway call failed: Error: gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: local loopback
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Bind: loopback
Youâve got two different issues mixed together in that output:
- Your CLI is probing with a
--urloverride (Source: cli --url) - Your Gateway is using a token (service env has
OPENCLAW_GATEWAY_TOKEN), but your CLI likely doesnât have a token in config, so the probe/auth fails and you see the generic WS1006.
Also, that âLast gateway error: ⌠gateway.mode=local unsetâ timestamp is from earlier â donât trust it as the current reason; itâs just the last recorded failure.
Step A â stop forcing --url (this is key)
Run exactly this (no --url):
openclaw gateway status
If it still says Source: cli --url, you have an alias/wrapper injecting it. Check:
type -a openclaw
alias openclaw 2>/dev/null || true
Step B â ensure the token is in your config (so the CLI can auth)
Right now launchd has a token in the service environment, but your openclaw config get gateway.auth.token is probably empty (your earlier --token "$(openclaw config get âŚ)" ended up treated as âno tokenâ).
Donât paste the token in Discord, just run this and tell me whether it prints yes:
openclaw config get gateway.auth.token >/dev/null && echo yes || echo no
If it prints no, fix it like this (this also rotates the token, which you should do anyway since one got pasted earlier):
NEW="$(openssl rand -hex 32)"
openclaw config set gateway.auth.token "$NEW"
openclaw gateway install --port 19000 --force --token "$NEW"
openclaw gateway restart
Step C â verify itâs actually listening, then do a health call
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN
openclaw gateway call health --timeout 3000
If lsof is empty again (flapping), then we need the actual crash reason from stderr (filtering out the punycode spam):
tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
Reply with:
- whether
gateway.auth.tokenisyes/no - output of
openclaw gateway statuswithout--url - and (if flapping) the
gateway.err.logtail above (with secrets redacted)
gateway.auth.token is yes
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
jiwoongyoo@Jis-MacBook-Pro-2 ~ % type -a openclaw
alias openclaw 2>/dev/null || true
openclaw is a shell function from /Users/jiwoongyoo/.zshrc
openclaw is /opt/homebrew/bin/openclaw
Gateway call failed: Error: gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: local loopback
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Bind: loopback
You found the real culprit:
openclaw is a shell function from /Users/jiwoongyoo/.zshrc
That function is almost certainly injecting --url ⌠(hence Source: cli --url) and once --url is involved the CLI wonât reliably use your saved creds unless the wrapper also passes --token/--password explicitly. So you end up with confusing 1006 probe failures even when the gateway is fine.
1) Bypass the .zshrc function (for this terminal)
Run:
unset -f openclaw
hash -r
(or just always use the full path /opt/homebrew/bin/openclaw)
Confirm youâre using the real binary:
type -a openclaw
2) Restart + verify itâs actually listening
/opt/homebrew/bin/openclaw gateway restart
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
3) Probe with the real CLI (no --url)
/opt/homebrew/bin/openclaw gateway status
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
4) If it still flaps/exits, grab the real error (stderr) minus punycode spam
tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
(Optional but recommended) Fix it permanently
Show what the function is doing:
typeset -f openclaw
If itâs wrapping openclaw --url âŚ, delete/adjust that function in ~/.zshrc (or rename it), so openclaw resolves to /opt/homebrew/bin/openclaw.
Paste:
- output of
lsof âŚ19000âŚafter the restart - output of
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
đŚ OpenClaw 2026.2.13 (203b5bd) â I read logs so you can keep pretending you don't have to.
â
â
Gateway call failed: Error: gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: local loopback
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Bind: loopback
Youâre still not running the real CLI in that output:
Source: cli --urlis coming from your.zshrcopenclaw()shell function.- And
type -a openclawconfirmed you have both a function and/opt/homebrew/bin/openclaw.
1) Bypass the function (donât edit anything yet)
Run everything with command openclaw (this skips functions/aliases):
command openclaw gateway status
If that no longer says Source: cli --url, weâve confirmed the wrapper was the problem.
2) Now check whether the gateway is actually staying up
Kick it, then watch the port for 3 seconds:
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
for i in {1..12}; do lsof -nP -iTCP:19000 -sTCP:LISTEN; sleep 0.25; done
3) If it disappears (crash/exits), we need the real error (stderr)
Your gateway.err.log is huge and full of punycode warnings, so filter those out:
tail -n 400 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 120
4) Fix permanently (optional): show what your wrapper does
typeset -f openclaw
Paste:
- output of
command openclaw gateway status - the 12-line
lsofloop output - the filtered
gateway.err.logtail
Then we can tell if itâs (a) wrapper URL override, or (b) the LaunchAgent genuinely crash-looping and why.
it still says "source: cli --url"
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
If gateway.auth.token is set and youâre still seeing Source: cli --url, then something is still supplying a URL override, and itâs not the token problem anymore.
There are only two realistic sources:
- your
.zshrcopenclaw()function (even if you think you bypassed it), or - config has
gateway.remote.urlset (CLI treats that as an âoverride URLâ path)
Letâs disambiguate cleanly.
1) Run the binary by absolute path (bypasses the function 100%)
/opt/homebrew/bin/openclaw gateway status
If that still says Source: cli --url, then itâs coming from config, not your shell function.
2) Check whether you have gateway.remote.url set
/opt/homebrew/bin/openclaw config get gateway.remote.url
- If it prints something (like
ws://127.0.0.1:19000), unset it:/opt/homebrew/bin/openclaw config unset gateway.remote.url /opt/homebrew/bin/openclaw gateway restart
Then re-check:
/opt/homebrew/bin/openclaw gateway status
3) Separate issue: your Gateway service is currently stopped
To see if itâs crash-looping or just not started, do:
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
If itâs still not listening, grab the actual error (filtering out the punycode spam):
tail -n 400 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 120
Paste:
- output of
/opt/homebrew/bin/openclaw config get gateway.remote.url - output of
/opt/homebrew/bin/openclaw gateway status - and (if not listening) the filtered
gateway.err.logtail above (redact secrets)
still says "source:cli --url"
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw config get gateway.remote.url
Config path not found: gateway.remote.url
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
2026-02-15T03:25:56.125+11:00 Gateway failed to start: another gateway instance is already listening on ws://127.0.0.1:19000
If the gateway is supervised, stop it with: openclaw gateway stop
2026-02-15T03:25:56.163+11:00 Port 19000 is already in use.
2026-02-15T03:25:56.164+11:00 - pid 26808 jiwoongyoo: openclaw-gateway (127.0.0.1:19000)
2026-02-15T03:25:56.164+11:00 - Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
2026-02-15T03:25:56.169+11:00 Gateway service appears loaded. Stop it first.
2026-02-15T03:25:56.169+11:00 Tip: openclaw gateway stop
2026-02-15T03:25:56.170+11:00 Or: launchctl bootout gui/$UID/ai.openclaw.gateway
gateway.remote.url being unset is good â so if youâre still seeing Source: cli --url, that means the process making the RPC call is still passing --url on the command line.
Since you confirmed you have an openclaw() function in ~/.zshrc, the fastest way to prove (and fix) this is:
1) Show what your openclaw() function is doing
Please run:
typeset -f openclaw | sed -n '1,160p'
Iâm expecting to see it append something like --url ws://127.0.0.1:19000 (or similar). If so, that explains everything: the CLI treats that as a URL override, and then auth/token fallback behavior changes.
2) In this shell, disable the function and retest
unset -f openclaw
hash -r
type -a openclaw
openclaw gateway status
After unsetting, Source: should switch to something like local loopback (not cli --url).
3) Separate issue: your LaunchAgent is currently not listening
Your last paste didnât include any lsof output after kickstart, so itâs likely exiting again. Run:
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
for i in {1..12}; do lsof -nP -iTCP:19000 -sTCP:LISTEN || true; sleep 0.25; done
tail -n 120 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
tail -n 80 ~/.openclaw/logs/gateway.log
Paste:
- the
typeset -f openclawoutput - the 12-line
lsofloop - the filtered
gateway.err.logtail
Then we can pin down (a) the --url injection, and (b) why the LaunchAgent keeps dying.
There we go â this is the actual reason the LaunchAgent keeps flapping:
Gateway failed to start: another gateway instance is already listening on ws://127.0.0.1:19000
Port 19000 is already in use ⌠pid 26808 ⌠openclaw-gateway
So youâve got two gateway instances fighting:
- a manual/foreground (or leftover) gateway process already bound to
19000(pid 26808) - launchd keeps trying to start its own gateway on the same port â it fails â CLI probes get weird/unstable.
Fix: pick ONE gateway and kill the other
Option A (recommended): use the LaunchAgent only
# stop both cleanly
/opt/homebrew/bin/openclaw gateway stop
pkill -f 'openclaw.*gateway.*--port 19000' || true # if one is still hanging around
# then start the service
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway status
Option B: keep the manual gateway, disable the LaunchAgent
/opt/homebrew/bin/openclaw gateway stop
launchctl bootout gui/$UID/ai.openclaw.gateway
# then run manually:
openclaw gateway --port 19000
Also: your âSource: cli --urlâ problem is separate
You still have an openclaw() shell function injecting --url. To stop that permanently, run:
typeset -f openclaw
Then remove/rename that function in ~/.zshrc, or in the meantime bypass it with:
unset -f openclaw
hash -r
Quick verification checklist
After youâve stopped the duplicate gateway and have exactly one running:
lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway status
If you paste the output of lsof âŚ19000⌠and openclaw gateway status after doing Option A, we can confirm itâs stable.
Service: LaunchAgent (not loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: unknown (Bad request.
Could not find service "ai.openclaw.gateway" in domain for user gui: 501)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service unit not found.
Service not installed. Run: openclaw gateway install
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Good â youâve successfully booted out / removed the LaunchAgent, so now thereâs no background service (thatâs why it says âService not installed / not loadedâ). At this point you just need to choose what you want:
Option 1 (recommended): put the LaunchAgent back (one gateway, always-on)
/opt/homebrew/bin/openclaw gateway install --port 19000 --force
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway status
Option 2: run the gateway manually (no LaunchAgent)
In a terminal, run:
/opt/homebrew/bin/openclaw gateway --port 19000
Leave that terminal open. In a second terminal:
lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
About âSource: cli --urlâ
Thatâs still your .zshrc openclaw() function injecting --url. Fix by removing/renaming it, or in the current terminal:
unset -f openclaw
hash -r
type -a openclaw
Then rerun openclaw gateway status and it should no longer show cli --url.
If you tell me whether you want LaunchAgent (Option 1) or manual (Option 2), Iâll keep the steps tight and youâll be stable from here.
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
jiwoongyoo@Jis-MacBook-Pro-2 ~ % unset -f openclaw
hash -r
type -a openclaw
unset: no such hash table element: openclaw
openclaw is /opt/homebrew/bin/openclaw
Good â type -a openclaw now shows youâre using the real binary (/opt/homebrew/bin/openclaw). That should eliminate the confusing âSource: cli --urlâ once you re-run the command.
Now we just need to get the LaunchAgent actually running (right now itâs loaded but exited).
Run these exactly and paste the outputs:
# 1) Re-run status now that the shell function is gone
/opt/homebrew/bin/openclaw gateway status
# 2) Check if something else is already holding the port
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# 3) Try starting the service again
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# 4) If it still exits, grab the real error (filtering punycode spam)
tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
tail -n 120 ~/.openclaw/logs/gateway.log | tail -n 80
What Iâm expecting weâll see in either lsof or gateway.err.log is one of:
- port already in use (another gateway instance still running), or
- a concrete startup error we can fix.
If lsof shows a PID listening on 19000, paste that line â then weâll decide whether to stop that process or move the service to a different port.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw gateway status
đŚ OpenClaw 2026.2.13 (203b5bd) â Ship fast, log faster.
â
â
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl unload ~/Library/LaunchAgents/ai.openclaw.gateway.plist 2>/dev/null
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl enable gui/$UID/ai.openclaw.gateway
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw gateway install --port 19000 --force
đŚ OpenClaw 2026.2.13 (203b5bd)
WhatsApp automation without the "please accept our new privacy policy".
Installed LaunchAgent: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist
Logs: /Users/jiwoongyoo/.openclaw/logs/gateway.log
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl bootstrap gui/$UID ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
launchctl bootstrap ⌠returning âBootstrap failed: 5: Input/output errorâ almost always means launchd thinks thereâs already a job with that label loaded/stuck, or the plist is invalid/unreadable. Letâs reset the launchd job cleanly and avoid the deprecated unload.
Run these exactly (use the real binary path):
# 1) Make sure no other gateway is still holding the port
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# 2) Boot out any existing/stuck job (ignore errors)
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true
# 3) Sanity-check the plist
plutil -lint ~/Library/LaunchAgents/ai.openclaw.gateway.plist
# 4) Re-install + start via the CLI (preferred)
/opt/homebrew/bin/openclaw gateway install --port 19000 --force
/opt/homebrew/bin/openclaw gateway start
# 5) Verify itâs listening
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
If plutil -lint reports anything other than âOKâ, paste that output.
If gateway start still fails, paste:
launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,140p'
tail -n 120 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
One more thing: you previously had a stray gateway already listening on 19000. If lsof shows any PID on 19000 before starting the service, stop it first:
/opt/homebrew/bin/openclaw gateway stop
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Youâre good on the shell side now (type -a openclaw shows only /opt/homebrew/bin/openclaw). The output you pasted above still has Source: cli --url, but you didnât re-run gateway status after removing the function â so letâs get a clean read, and also see why the LaunchAgent immediately exits.
Run these 3 commands and paste outputs:
# 1) Clean status read (must be the real binary)
/opt/homebrew/bin/openclaw gateway status --no-probe
# 2) Try to start it, then check if anything is actually listening
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# 3) If itâs not listening, this tail usually contains the real reason it exited
tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
Two common outcomes:
- If
lsofshows something listening on 19000 already â you still have another gateway instance running and the service will keep failing. Paste thelsofline (PID). - If
lsofis empty âgateway.err.logtail will tell us the exact crash/start-block reason.
Also: you pasted a gateway token earlier in the thread. Please rotate it once things are stable (donât paste the new one).
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
2026-02-15T03:25:56.125+11:00 Gateway failed to start: another gateway instance is already listening on ws://127.0.0.1:19000
If the gateway is supervised, stop it with: openclaw gateway stop
2026-02-15T03:25:56.163+11:00 Port 19000 is already in use.
2026-02-15T03:25:56.164+11:00 - pid 26808 jiwoongyoo: openclaw-gateway (127.0.0.1:19000)
2026-02-15T03:25:56.164+11:00 - Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
2026-02-15T03:25:56.169+11:00 Gateway service appears loaded. Stop it first.
2026-02-15T03:25:56.169+11:00 Tip: openclaw gateway stop
2026-02-15T03:25:56.170+11:00 Or: launchctl bootout gui/$UID/ai.openclaw.gateway
That log tail is the whole problem:
- Port 19000 is already in use
- by pid 26808 (
openclaw-gateway) - so the LaunchAgent canât start, and it exits immediately.
You need exactly one gateway on that port.
Fix (use LaunchAgent, kill the stray gateway process)
# confirm whatâs holding the port
lsof -nP -iTCP:19000 -sTCP:LISTEN
# inspect the process (safe)
ps -p 26808 -o pid,ppid,etime,command
# stop it (graceful)
kill 26808
sleep 1
# verify the port is free
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# now start the LaunchAgent gateway
/opt/homebrew/bin/openclaw gateway start
sleep 2
/opt/homebrew/bin/openclaw gateway status
If kill 26808 doesnât stop it, do:
kill -9 26808
After this, gateway status should flip to RPC probe: ok and lsof should show a listener on 127.0.0.1:19000.
(And separately: since a gateway token was pasted earlier, rotate it once youâre stable.)
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
jiwoongyoo@Jis-MacBook-Pro-2 ~ % kill -9 26808
kill: kill 26808 failed: no such process
Yep â that just means PID 26808 was already gone (so the âport in useâ blocker is likely cleared now).
Now do this sequence (use the absolute path so weâre definitely not hitting any wrapper that adds --url):
# 1) confirm the port is actually free
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# 2) start the LaunchAgent gateway
/opt/homebrew/bin/openclaw gateway start
sleep 2
# 3) confirm itâs listening
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# 4) re-check status (fresh output)
/opt/homebrew/bin/openclaw gateway status
If step (3) still shows nothing listening, paste the latest stderr tail (that will contain the real reason it exited):
tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
Also: if gateway status still says Source: cli --url even when you run /opt/homebrew/bin/openclaw âŚ, then you are literally passing --url somewhere (script/alias). In that case paste:
/opt/homebrew/bin/openclaw gateway status --json | head -n 40
(That will show the resolved URL source cleanly, without depending on shell functions.)
2026-02-15T03:25:56.125+11:00 Gateway failed to start: another gateway instance is already listening on ws://127.0.0.1:19000
If the gateway is supervised, stop it with: openclaw gateway stop
2026-02-15T03:25:56.163+11:00 Port 19000 is already in use.
2026-02-15T03:25:56.164+11:00 - pid 26808 jiwoongyoo: openclaw-gateway (127.0.0.1:19000)
2026-02-15T03:25:56.164+11:00 - Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
2026-02-15T03:25:56.169+11:00 Gateway service appears loaded. Stop it first.
2026-02-15T03:25:56.169+11:00 Tip: openclaw gateway stop
2026-02-15T03:25:56.170+11:00 Or: launchctl bootout gui/$UID/ai.openclaw.gateway
"service": {
"label": "LaunchAgent",
"loaded": true,
"loadedText": "loaded",
"notLoadedText": "not loaded",
"command": {
"programArguments": [
"/opt/homebrew/bin/node",
"/opt/homebrew/lib/node_modules/openclaw/dist/index.js",
"gateway",
"--port",
"19000"
],
"environment": {
"OPENCLAW_GATEWAY_PORT": "19000"
},
"sourcePath": "/Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist"
},
"runtime": {
"status": "stopped",
"state": "active",
"cachedLabel": false
},
"configAudit": {
"ok": true,
"issues": []
}
},
"config": {
"cli": {
"path": "/Users/jiwoongyoo/.openclaw/openclaw.json",
"exists": true,
"valid": true,
"controlUi": {
"dangerouslyDisableDeviceAuth": false
}
},
"daemon": {
"path": "/Users/jiwoongyoo/.openclaw/openclaw.json",
The JSON confirms a few good things:
- LaunchAgent is loaded but runtime is stopped (so itâs not currently running).
- Your config is valid and
dangerouslyDisableDeviceAuthis now false (good). - The âPort already in use / pid 26808â message you keep seeing is old log output â itâs not proof that the port is still in use right now.
So we need current port ownership + start attempt.
Run these (and paste output):
# 1) who is listening RIGHT NOW?
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# 2) force-restart the LaunchAgent
/opt/homebrew/bin/openclaw gateway restart
sleep 2
# 3) check again
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# 4) show only the newest errors (not the old 03:25 ones)
tail -n 80 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 40
tail -n 80 ~/.openclaw/logs/gateway.log | tail -n 40
If lsof shows something listening on 19000 after restart, paste that line (PID + command). If itâs empty and the logs donât show a clear error, weâll also pull the launchd job state:
launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,220p'
(That will show last exit status / throttling info.)
2026-02-15T04:04:47.305+11:00 â ď¸ Session file not found: gateway
2026-02-15T04:04:47.306+11:00 Proceeding with reset...
2026-02-15T04:04:47.306+11:00 EXECUTE_NEW
2026-02-14T17:04:57.229Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T17:04:57.621Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T17:04:57.661Z [heartbeat] started
2026-02-14T17:04:57.663Z [gateway] agent model: zai/glm-5
2026-02-14T17:04:57.664Z [gateway] listening on ws://127.0.0.1:19000 (PID 30807)
2026-02-14T17:04:57.664Z [gateway] listening on ws://[::1]:19000
2026-02-14T17:04:57.665Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T17:04:57.675Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T17:04:57.768Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T17:04:57.779Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T17:04:57.780Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T17:04:57.782Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T04:04:57.783+11:00 â ď¸ Session file not found: gateway
2026-02-15T04:04:57.784+11:00 Proceeding with reset...
2026-02-15T04:04:57.785+11:00 EXECUTE_NEW
gui/501/ai.openclaw.gateway = {
active count = 1
path = /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist
type = LaunchAgent
state = running
program = /opt/homebrew/bin/node
arguments = {
/opt/homebrew/bin/node
/opt/homebrew/lib/node_modules/openclaw/dist/index.js
gateway
--port
19000
}
stdout path = /Users/jiwoongyoo/.openclaw/logs/gateway.log
stderr path = /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
inherited environment = {
SSH_AUTH_SOCK => /private/tmp/com.apple.launchd.adDrmHsp60/Listeners
}
default environment = {
PATH => /usr/bin:/bin:/usr/sbin:/sbin
}
environment = {
OSLogRateLimit => 64
OPENCLAW_GATEWAY_TOKEN => private
OPENCLAW_GATEWAY_PORT => 19000
OPENCLAW_SERVICE_VERSION => 2026.2.13
OPENCLAW_SYSTEMD_UNIT => openclaw-gateway.service
OPENCLAW_LAUNCHD_LABEL => ai.openclaw.gateway
PATH => /opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin
HOME => /Users/jiwoongyoo
OPENCLAW_SERVICE_KIND => gateway
OPENCLAW_SERVICE_MARKER => openclaw
XPC_SERVICE_NAME => ai.openclaw.gateway
}
domain = gui/501 [100022]
asid = 100022
minimum runtime = 10
exit timeout = 5
runs = 97
pid = 30859
immediate reason = inefficient
forks = 0
execs = 1
initialized = 1
trampolined = 1
started suspended = 0
proxy started suspended = 0
checked allocations = 0 (queried = 1)
checked allocations reason = no host
checked allocations flags = 0x0
last exit code = 0
resource coalition = {
ID = 2443
type = resource
state = active
active count = 1
name = ai.openclaw.gateway
}
Those logs are the âgoodâ case â your Gateway is up and actually listening on 127.0.0.1:19000 (PID 30807). The Session file not found ⌠reset ⌠EXECUTE_NEW lines are normal.
Now we just need to confirm the CLI can reach it right now:
# should show node listening on 19000
lsof -nP -iTCP:19000 -sTCP:LISTEN
# should succeed if the gateway is reachable + auth is correct
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
# should show RPC probe: ok
/opt/homebrew/bin/openclaw gateway status
If lsof shows itâs listening but gateway status still claims âRuntime stopped / probe failedâ, paste the output of:
/opt/homebrew/bin/openclaw gateway status --json | head -n 80
That will tell us exactly what URL/auth source itâs using (and whether itâs still being forced via --url somewhere).
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Great â that launchctl print confirms the LaunchAgent gateway is actually running now:
state = runningactive count = 1pid = 30859OPENCLAW_GATEWAY_PORT = 19000
So the gateway service side is healthy.
Final verification from the CLI side (run these and you should see âokâ):
lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
/opt/homebrew/bin/openclaw gateway status
If gateway status still shows Source: cli --url, it just means somewhere youâre still invoking the CLI with --url. It wonât prevent things from working as long as you also have credentials, but itâs confusing. Now that you removed the openclaw() function, it should go away.
One more important thing: earlier in this thread you pasted your gateway token once. Even though you redacted it now, please rotate it anyway:
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
(Do not paste the new token.)
That output is still consistent with âgateway isnât actually up right nowâ (LaunchAgent loaded, but runtime stopped, and nothing is answering on :19000, hence the 1006).
Two things to keep in mind:
- The âpid 26808â / port-in-use message you pasted earlier was from an older log line â it doesnât prove the port is currently in use.
- The only reliable âis it up?â check is
lsofright now.
Run this exact block and paste the output:
# 1) Is anything listening right now?
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# 2) Force launchd to start it
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 2
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 31397, state active)
Warm-up: launch agents can take a few seconds. Try again shortly.
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Gateway port 19000 is not listening (service appears running).
Last gateway error: 2026-02-14T22:14:53.450+11:00 Gateway start blocked: set gateway.mode=local (current: unset) or pass --allow-unconfigured.
Logs: ~/.openclaw/logs/gateway.log
Errors: ~/.openclaw/logs/gateway.err.log
# 3) Is it listening now?
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# 4) What does launchd think?
launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,120p'
# 5) Show the *newest* failure reason (ignore punycode spam)
tail -n 120 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
What weâre looking for:
- If step (3) shows a PID listening â the gateway is up, and then we can run
/opt/homebrew/bin/openclaw gateway call health --timeout 3000. - If step (3) is empty â step (5) should contain the real exit reason (port conflict, config/start blocked, missing deps, etc.).
One more security cleanup once things are stable: you pasted a gateway token earlier in the thread; rotate it after youâre connected again (donât paste the new one).
2026-02-15T03:25:56.125+11:00 Gateway failed to start: another gateway instance is already listening on ws://127.0.0.1:19000
If the gateway is supervised, stop it with: openclaw gateway stop
2026-02-15T03:25:56.163+11:00 Port 19000 is already in use.
2026-02-15T03:25:56.164+11:00 - pid 26808 jiwoongyoo: openclaw-gateway (127.0.0.1:19000)
2026-02-15T03:25:56.164+11:00 - Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
2026-02-15T03:25:56.169+11:00 Gateway service appears loaded. Stop it first.
2026-02-15T03:25:56.169+11:00 Tip: openclaw gateway stop
2026-02-15T03:25:56.170+11:00 Or: launchctl bootout gui/$UID/ai.openclaw.gateway
Runtime: running (pid 31397) but âport 19000 is not listeningâ means launchd thinks the job is alive, but the gateway either:
- is stuck before binding, or
- is crashing/exiting immediately (launchd can briefly show a pid), or
- is binding somewhere else than expected (rare)
The âLast gateway error: set gateway.mode=local ⌠unsetâ line is old (timestamped) â ignore that for current diagnosis.
Run these and paste the output (this will tell us whatâs actually happening with pid 31397 and why it wonât listen):
# 1) Is anything listening right now?
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# 2) Is that pid really alive?
ps -p 31397 -o pid,ppid,etime,command || echo "pid 31397 not running"
# 3) What did the gateway log right before it stopped / got stuck?
tail -n 80 ~/.openclaw/logs/gateway.log
# 4) Actual errors (filter out punycode spam)
tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
# 5) launchdâs view often includes exit status / throttle
launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,220p'
If you want the ânuke from orbitâ restart (safe, common fix) while we wait for logs:
/opt/homebrew/bin/openclaw gateway stop
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true
launchctl bootstrap gui/$UID ~/Library/LaunchAgents/ai.openclaw.gateway.plist
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
Once you paste the gateway.err.log tail + launchctl print snippet, itâll usually be immediately obvious (port conflict again, missing permission/key, config parse, etc.).
Those lines are from 03:25 and are almost certainly stale at this point. We need to see whatâs holding 19000 right now (if anything), because thatâs what decides whether launchd can start.
Run these and paste the output:
# 1) who is listening on 19000 RIGHT NOW?
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# 2) show the *latest* error lines (not the old 03:25 ones)
tail -n 60 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 30
tail -n 60 ~/.openclaw/logs/gateway.log | tail -n 30
If lsof shows a listener (PID), do:
/opt/homebrew/bin/openclaw gateway stop
# re-check
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
If itâs still listening after gateway stop, paste the lsof line (PID/command) and weâll tell you the cleanest way to stop that specific process (thatâs the âtwo gateways fightingâ situation).
Once lsof is empty, starting the service should work:
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
2026-02-15T03:25:56.125+11:00 Gateway failed to start: another gateway instance is already listening on ws://127.0.0.1:19000
If the gateway is supervised, stop it with: openclaw gateway stop
2026-02-15T03:25:56.163+11:00 Port 19000 is already in use.
2026-02-15T03:25:56.164+11:00 - pid 26808 jiwoongyoo: openclaw-gateway (127.0.0.1:19000)
2026-02-15T03:25:56.164+11:00 - Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
2026-02-15T03:25:56.169+11:00 Gateway service appears loaded. Stop it first.
2026-02-15T03:25:56.169+11:00 Tip: openclaw gateway stop
2026-02-15T03:25:56.170+11:00 Or: launchctl bootout gui/$UID/ai.openclaw.gateway
2026-02-14T17:16:06.967Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T17:16:07.365Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T17:16:07.404Z [heartbeat] started
2026-02-14T17:16:07.407Z [gateway] agent model: zai/glm-5
2026-02-14T17:16:07.407Z [gateway] listening on ws://127.0.0.1:19000 (PID 31981)
2026-02-14T17:16:07.408Z [gateway] listening on ws://[::1]:19000
2026-02-14T17:16:07.409Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T17:16:07.418Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T17:16:07.514Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T17:16:07.526Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T17:16:07.527Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T17:16:07.529Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T04:16:07.530+11:00 â ď¸ Session file not found: gateway
2026-02-15T04:16:07.531+11:00 Proceeding with reset...
2026-02-15T04:16:07.531+11:00 EXECUTE_NEW
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw gateway stop
re-check
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
đŚ OpenClaw 2026.2.13 (203b5bd) â curl for conversations.
Stopped LaunchAgent: gui/501/ai.openclaw.gateway
zsh: command not found: #
Your latest gateway.log lines show the good state:
listening on ws://127.0.0.1:19000 (PID 31981)
âŚbut your gateway status probe still sometimes says ârunning pid ⌠but port not listening / 1006â. That usually happens when the Gateway is flapping (start/stop quickly) or when the service token and CLI token donât match.
Letâs pin this down with two checks + one âmake it consistentâ fix.
1) Confirm whatâs listening on 19000 right now
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
- If this prints a PID, the gateway is actually up at that moment.
- If it prints nothing, itâs not actually bound (flapping/exit).
2) If it IS listening, test a direct health call (no --url)
Use the real binary (since you removed the zsh function):
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
3) Fix the most common cause: token mismatch (and rotate token)
Since a gateway token got exposed earlier, rotate it and make the service + config match in one go:
NEW="$(openssl rand -hex 32)"
# write token into config
/opt/homebrew/bin/openclaw config set gateway.auth.token "$NEW"
# reinstall the LaunchAgent so it uses the same token + port
/opt/homebrew/bin/openclaw gateway install --port 19000 --force --token "$NEW"
That zsh: command not found: # just means you pasted my comment line (# re-check) into the terminal â zsh tried to run # as a command. No big deal.
Now that youâve stopped the LaunchAgent, do the checks on separate lines:
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
- If this shows anything listening, you still have a stray/manual gateway (or something else) holding the port.
- If it shows nothing, the port is free and you can start the service cleanly:
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
If lsof still shows a listener even after gateway stop, paste the single lsof line (PID/command) and weâll kill the right process (thatâs the âtwo gateways fightingâ situation that causes the 1006 errors).
/opt/homebrew/bin/openclaw gateway restart
Then re-test:
lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
/opt/homebrew/bin/openclaw gateway status
If after restart lsof is empty again, paste the last ~40 non-punycode lines of stderr (that will contain the real exit reason):
tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 40
Once itâs stable, you should see RPC probe: ok and the 1006 errors stop.
you're going round and round with no fix. is it possible to reset or reinstall the gateway and anything that's involved with the recent update without losing openclaw data accumulated with personal data and skills and memory?
Yes â you can do a âclean reinstall of the Gateway/service + CLIâ without losing your OpenClaw data. The important thing is to not run openclaw reset --scope full (that one really does wipe state/workspace).
What counts as âyour dataâ (the stuff you want to keep)
By default it lives under:
- State dir:
~/.openclaw/(config, auth profiles, sessions, device identity, etc.) - Workspace: often
~/.openclaw/workspace/(yourAGENTS.md,SOUL.md,USER.md, memory files, skills youâve installed into the workspace, etc.)
Reinstalling the LaunchAgent/service does not need to delete any of that.
Safe âreinstall gateway serviceâ (keeps all data)
Do this on the gateway Mac:
0) Backup first (strongly recommended)
tar -czf ~/openclaw-backup-$(date +%Y%m%d-%H%M%S).tgz ~/.openclaw
1) Stop + uninstall the LaunchAgent (service only)
/opt/homebrew/bin/openclaw gateway stop
/opt/homebrew/bin/openclaw gateway uninstall
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist
2) Make sure nothing else is holding the port
(Replace 19000 if you use a different port.)
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
If that prints a PID, kill that process (itâs the âtwo gateways fightingâ situation that caused your 1006 errors).
3) Reinstall + start the service fresh
/opt/homebrew/bin/openclaw gateway install --port 19000 --force
/opt/homebrew/bin/openclaw gateway start
4) Repair/migrate config safely
/opt/homebrew/bin/openclaw doctor --repair
If you want to reinstall the OpenClaw CLI code too (still keep data)
Your data is in ~/.openclaw, so removing/reinstalling the npm package is usually fine:
npm uninstall -g openclaw
npm install -g openclaw@2026.2.13 # or @latest
openclaw doctor --repair
openclaw gateway restart
(Still: keep the backup step.)
Two âdonât do thisâ warnings
- Donât run
openclaw reset --scope full(that wipes state/workspace). - Donât paste tokens in Discord. If you already did earlier, rotate:
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
If you run the âservice reinstallâ steps above and paste the output of:
/opt/homebrew/bin/openclaw gateway status
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
we can confirm itâs stable and actually listening.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % tar -czf ~/openclaw-backup-$(date +%Y%m%d-%H%M%S).tgz ~/.openclaw
tar: Removing leading '/' from member names
tar: Could not pack extended attributes: Operation not supported
: Users/jiwoongyoo/.openclaw/exec-approvals.sock: pax format cannot archive sockets
Thatâs normal-ish: tar canât archive Unix sockets, and exec-approvals.sock is exactly that. Itâs ephemeral runtime state, safe to exclude (itâll be recreated).
Also:
Removing leading '/'is harmless.- The âextended attributesâ warning is usually harmless for OpenClaw (OpenClaw doesnât rely on xattrs for state), but if you want a âmac-nativeâ backup that preserves them, use
ditto(see below).
Option A (simple): tar backup, excluding sockets
# (optional) see any sockets under ~/.openclaw
find ~/.openclaw -type s -maxdepth 3 2>/dev/null || true
# make a tarball, excluding the socket
tar --exclude="$HOME/.openclaw/exec-approvals.sock" \
-czf ~/openclaw-backup-$(date +%Y%m%d-%H%M%S).tgz \
~/.openclaw
If there are other .sock files, you can exclude them too (repeat --exclude=... for each).
Option B (mac recommended): ditto zip backup (keeps metadata better)
ditto -c -k --sequesterRsrc --keepParent \
~/.openclaw \
~/openclaw-backup-$(date +%Y%m%d-%H%M%S).zip
Either backup is fine for âdonât lose my OpenClaw dataâ.
Once you have the backup file created successfully, tell me which one you used and weâll proceed with the safe gateway/service reinstall steps (keeps your skills/memory/sessions).
I used option b but it's still not finised backing up I think
Let it finish â ditto can take a while if ~/.openclaw has a lot of sessions/logs.
Run this to see if itâs still actively writing:
ls -lh ~/openclaw-backup-*.zip | tail -n 5
If the file size is still increasing every time you re-run that, itâs still working.
If you want a âprogress-ishâ view (crude but useful):
while true; do
ls -lh ~/openclaw-backup-*.zip | tail -n 1
sleep 2
done
Stop it with Ctrl+C when youâre satisfied.
If it looks stuck (size not changing for ~2â3 minutes), tell me:
- the current size shown by
ls -lh ⌠- how long itâs been sitting at that size
âŚand we can either (a) wait, (b) redo the backup excluding large logs/transcripts, or (c) do a faster tar backup excluding sockets/logs.
what do I do after it's backed up
After the backup finishes, do this service-only reinstall. It keeps your ~/.openclaw data (memory/skills/sessions/config).
1) Stop the Gateway + remove the LaunchAgent (safe)
/opt/homebrew/bin/openclaw gateway stop
/opt/homebrew/bin/openclaw gateway uninstall
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist
2) Make sure nothing is still listening on your gateway port
(Youâve been using 19000.)
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
If that prints a PID, kill it (itâs the âextra gateway instanceâ problem):
kill <pid>
# if it refuses:
kill -9 <pid>
Re-run the lsof check until it prints nothing.
3) Reinstall the LaunchAgent cleanly + start it
/opt/homebrew/bin/openclaw gateway install --port 19000 --force
/opt/homebrew/bin/openclaw gateway start
4) Run Doctor repair (safe migrations) + restart once
/opt/homebrew/bin/openclaw doctor --repair
/opt/homebrew/bin/openclaw gateway restart
5) Verify itâs healthy
lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway status
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
If itâs working, you should see the port listening and RPC probe: ok.
One more thing: you pasted a gateway token earlier in the thread â once everything is stable, rotate it:
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
Paste the output of openclaw gateway status if anything still says unreachable.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw gateway stop
/opt/homebrew/bin/openclaw gateway uninstall
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true
rm -f ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Gateway service not loaded.
LaunchAgent remains at /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist (could not move)
That message is from the uninstall step trying to âmoveâ the plist out of the way. Itâs not fatal â we just need to confirm whether the plist is actually gone now (your rm -f ⌠line should have removed it).
Run these checks:
# 1) Is the plist still there?
ls -la ~/Library/LaunchAgents/ai.openclaw.gateway.plist || echo "plist is gone â
"
# 2) Does launchd still think the job exists?
launchctl print gui/$UID/ai.openclaw.gateway 2>/dev/null | head -n 20 || echo "launchd job not found â
"
# 3) Make sure nothing is listening on 19000
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
If (3) shows a PID listening on 19000
Thatâs a stray gateway process. Kill it:
kill <pid>
# if needed:
kill -9 <pid>
Re-run the lsof check until it prints nothing.
Then reinstall + start the LaunchAgent fresh
/opt/homebrew/bin/openclaw gateway install --port 19000 --force
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
Paste the output of the three checks at the top (ls âŚplist, launchctl print âŚ, lsof âŚ19000). Thatâll tell us if anything is still stuck in launchd or if itâs just a leftover process on the port.
LaunchAgent remains at /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist (could not move)
jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -la ~/Library/LaunchAgents/ai.openclaw.gateway.plist || echo "plist is gone â
"
ls: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist: No such file or directory
plist is gone â
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl print gui/$UID/ai.openclaw.gateway 2>/dev/null | head -n 20 || echo "launchd job not found â
"
jiwoongyoo@Jis-MacBook-Pro-2 ~ % lsof -nP -iTCP:19000 -sTCP:LISTEN || true
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
Perfect â youâre in the clean state we want:
- plist is gone â
- nothing listening on 19000 â
- (and launchd doesnât seem to have the job anymore)
Now reinstall + start the gateway service fresh:
/opt/homebrew/bin/openclaw gateway install --port 19000 --force
/opt/homebrew/bin/openclaw gateway start
sleep 2
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
If lsof still shows nothing listening after gateway start, paste:
tail -n 80 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 60
tail -n 80 ~/.openclaw/logs/gateway.log | tail -n 60
Once itâs up, run the safe repair/migration and restart once:
/opt/homebrew/bin/openclaw doctor --repair
/opt/homebrew/bin/openclaw gateway restart
And because a gateway token got posted earlier in the thread, rotate it when stable:
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
2026-02-15T10:16:39.855+11:00 â ď¸ Session file not found: gateway
2026-02-15T10:16:39.856+11:00 Proceeding with reset...
2026-02-15T10:16:39.857+11:00 EXECUTE_NEW
2026-02-14T23:16:49.754Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T23:16:50.182Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T23:16:50.225Z [heartbeat] started
2026-02-14T23:16:50.227Z [gateway] agent model: zai/glm-5
2026-02-14T23:16:50.227Z [gateway] listening on ws://127.0.0.1:19000 (PID 36489)
2026-02-14T23:16:50.229Z [gateway] listening on ws://[::1]:19000
2026-02-14T23:16:50.230Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T23:16:50.239Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T23:16:50.341Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T23:16:50.352Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T23:16:50.353Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T23:16:50.355Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T10:16:50.357+11:00 â ď¸ Session file not found: gateway
2026-02-15T10:16:50.358+11:00 Proceeding with reset...
2026-02-15T10:16:50.358+11:00 EXECUTE_NEW
Thatâs the success signal.
listening on ws://127.0.0.1:19000 (PID 36489)â Gateway is up.- The
Session file not found: gateway â reset â EXECUTE_NEWlines are normal after a fresh service reinstall.
Now finish the last two âwrap upâ steps:
1) Verify from the CLI
lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway status
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
2) Run Doctor repair + rotate token (since one was pasted earlier)
/opt/homebrew/bin/openclaw doctor --repair
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
After the restart, openclaw gateway status should show RPC probe: ok.
If it does: youâre done. If anything still fails, paste the output of openclaw gateway status and weâll nail the last mile.
If this fixed it, please mark the solution message so Answer Overflow indexes it (rightâclick the solution message â Apps â â Mark Solution).
2026-02-15T03:25:56.125+11:00 Gateway failed to start: another gateway instance is already listening on ws://127.0.0.1:19000
If the gateway is supervised, stop it with: openclaw gateway stop
2026-02-15T03:25:56.163+11:00 Port 19000 is already in use.
2026-02-15T03:25:56.164+11:00 - pid 26808 jiwoongyoo: openclaw-gateway (127.0.0.1:19000)
2026-02-15T03:25:56.164+11:00 - Gateway already running locally. Stop it (openclaw gateway stop) or use a different port.
2026-02-15T03:25:56.169+11:00 Gateway service appears loaded. Stop it first.
2026-02-15T03:25:56.169+11:00 Tip: openclaw gateway stop
2026-02-15T03:25:56.170+11:00 Or: launchctl bootout gui/$UID/ai.openclaw.gateway
2026-02-14T17:16:59.292Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T17:16:59.681Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T17:16:59.721Z [heartbeat] started
2026-02-14T17:16:59.723Z [gateway] agent model: zai/glm-5
2026-02-14T17:16:59.724Z [gateway] listening on ws://127.0.0.1:19000 (PID 32061)
2026-02-14T17:16:59.724Z [gateway] listening on ws://[::1]:19000
2026-02-14T17:16:59.725Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T17:16:59.734Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T17:16:59.832Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T17:16:59.844Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T17:16:59.845Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T17:16:59.847Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T04:16:59.848+11:00 â ď¸ Session file not found: gateway
Those lines contain both:
- an old failure at
03:25(âport 19000 already in use, pid 26808â), and - a successful start later (âlistening on âŚ19000 (PID 32061)â).
So the âalready in useâ part is almost certainly just stale log history thatâs still sitting in gateway.err.log / gateway.log â it does not mean itâs currently broken.
To know the truth right now, donât look at old log tails; run these live checks:
# is anything listening right now?
lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# does the CLI successfully RPC into the gateway?
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
# does the status probe succeed?
/opt/homebrew/bin/openclaw gateway status
If lsof shows a listener and gateway call health works, youâre done â the gateway is healthy.
If you want to stop the old âport already in useâ message from confusing you, you can optionally archive the logs so new errors are obvious:
mv ~/.openclaw/logs/gateway.err.log ~/.openclaw/logs/gateway.err.log.old
mv ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.log.old
/opt/homebrew/bin/openclaw gateway restart
One more important cleanup: you pasted a gateway token earlier in the thread. Once you confirm the gateway is healthy, rotate it:
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
Paste the output of openclaw gateway status if it still shows RPC probe: failed.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % lsof -nP -iTCP:19000 -sTCP:LISTEN
/opt/homebrew/bin/openclaw gateway status
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
đŚ OpenClaw 2026.2.13 (203b5bd) â Your config is valid, your assumptions are not.
â
â
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
đŚ OpenClaw 2026.2.13 (203b5bd)
Welcome to the command line: where dreams compile and confidence segfaults.
â
â
Gateway call failed: Error: gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: local loopback
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Bind: loopback
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
Youâre not crazy â whatâs been tripping you up is that the gateway log contains old failures mixed with new successes, and the gateway can also fail to start if anything is already bound to 19000. The only âtruthâ is: is something listening on 19000 right now, and does the process stay up?
Hereâs the cleanest, âone-shotâ way to get to a stable state without losing any data (you already backed up, so we can be a bit more decisive):
A) Make logs âfreshâ so we stop chasing stale messages
mv ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.log.old.$(date +%s) 2>/dev/null || true
mv ~/.openclaw/logs/gateway.err.log ~/.openclaw/logs/gateway.err.log.old.$(date +%s) 2>/dev/null || true
B) Stop the service and ensure NOTHING is on port 19000
/opt/homebrew/bin/openclaw gateway stop
# On macOS itâs worth using sudo so you see root-owned listeners too:
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
If lsof prints a listener, only kill it if itâs actually OpenClaw / node on that port:
sudo kill <pid>
# if it wonât die:
sudo kill -9 <pid>
Re-run the sudo lsof âŚ19000⌠until it prints nothing.
C) Reinstall the LaunchAgent using the SAME token your CLI uses
This prevents âservice token vs config tokenâ weirdness.
TOKEN="$(/opt/homebrew/bin/openclaw config get gateway.auth.token)"
/opt/homebrew/bin/openclaw gateway install --port 19000 --force --token "$TOKEN"
/opt/homebrew/bin/openclaw gateway start
sleep 2
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
D) Verify (this should now succeed)
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
/opt/homebrew/bin/openclaw gateway status
If it still fails
Paste just these (theyâll now be âfreshâ and not mixed with old stuff):
tail -n 120 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
tail -n 120 ~/.openclaw/logs/gateway.log | tail -n 80
One more important cleanup: you posted a gateway token earlier in the thread. Once the gateway is stable, rotate it:
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
If you paste the output of the sudo lsof âŚ19000⌠line after step C, I can tell immediately whether youâre stable or still colliding with another process.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % tail -n 120 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
tail -n 120 ~/.openclaw/logs/gateway.log | tail -n 80
2026-02-14T23:29:15.756Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T23:29:15.758Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T10:29:15.759+11:00 â ď¸ Session file not found: gateway
2026-02-15T10:29:15.760+11:00 Proceeding with reset...
2026-02-15T10:29:15.761+11:00 EXECUTE_NEW
2026-02-14T23:29:25.656Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-14T23:29:26.049Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-14T23:29:26.088Z [heartbeat] started
2026-02-14T23:29:26.090Z [gateway] agent model: zai/glm-5
2026-02-14T23:29:26.091Z [gateway] listening on ws://127.0.0.1:19000 (PID 37774)
2026-02-14T23:29:26.091Z [gateway] listening on ws://[::1]:19000
2026-02-14T23:29:26.092Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-14T23:29:26.101Z [browser/service] Browser control service ready (profiles=2)
2026-02-14T23:29:26.196Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-14T23:29:26.207Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-14T23:29:26.208Z [hooks:loader] Registered hook: command-logger -> command
2026-02-14T23:29:26.210Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T10:29:26.211+11:00 â ď¸ Session file not found: gateway
jiwoongyoo@Jis-MacBook-Pro-2 ~ % sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
Yes â you can âreinstall the gateway/serviceâ without losing data, and you already did the right thing by backing up ~/.openclaw.
Whatâs still causing the â1006 / not listeningâ loop is almost always one of these:
- Another gateway process (or the mac app) is stopping/starting it, or
- Two gateway processes fight over port 19000, or
- Youâre probing a gateway that isnât actually bound right now.
Hereâs the most reliable âget me to one stable gatewayâ procedure (data-safe):
0) If the OpenClaw macOS app is running: quit it for now
It can manage launchd and cause confusing restarts.
1) Hard-stop all gateway instances
Run these lines one by one:
/opt/homebrew/bin/openclaw gateway stop || true
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true
# show any stray gateway processes (if you see any, weâll kill them)
ps aux | egrep 'openclaw-gateway|dist/index\.js gateway' | grep -v egrep || true
# check the port (use sudo so you donât miss listeners)
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
If sudo lsof âŚ19000⌠prints a PID, kill that PID:
sudo kill <pid>
# if it won't die:
sudo kill -9 <pid>
Re-run the sudo lsof ⌠until it prints nothing.
2) Reinstall + start ONE launchd service
/opt/homebrew/bin/openclaw gateway install --port 19000 --force
/opt/homebrew/bin/openclaw gateway start
sleep 2
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN
3) Verify with a direct RPC call
/opt/homebrew/bin/openclaw gateway call health --timeout 3000
/opt/homebrew/bin/openclaw gateway status
If it still fails
Paste these two outputs (theyâll show the real reason immediately):
launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,140p'
tail -n 120 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
Once itâs stable, rotate the gateway token (since one got pasted earlier in the thread):
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
If you paste the output of sudo lsof -nP -iTCP:19000 -sTCP:LISTEN after step 2, I can tell you in one glance whether youâre finally down to one gateway or still colliding.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl print gui/$UID/ai.openclaw.gateway | sed -n '1,140p'
tail -n 120 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
gui/501/ai.openclaw.gateway = {
active count = 0
path = /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist
type = LaunchAgent
state = spawn scheduled
program = /opt/homebrew/bin/node
arguments = {
/opt/homebrew/bin/node
/opt/homebrew/lib/node_modules/openclaw/dist/index.js
gateway
--port
19000
}
stdout path = /Users/jiwoongyoo/.openclaw/logs/gateway.log
stderr path = /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
inherited environment = {
SSH_AUTH_SOCK => /private/tmp/com.apple.launchd.adDrmHsp60/Listeners
}
default environment = {
PATH => /usr/bin:/bin:/usr/sbin:/sbin
}
environment = {
OSLogRateLimit => 64
OPENCLAW_GATEWAY_TOKEN => ee5d2d72f4ccc33859a759eaa9211da39dbb6e31165169660b011095135d2b17
OPENCLAW_GATEWAY_PORT => 19000
OPENCLAW_SERVICE_VERSION => 2026.2.13
OPENCLAW_SYSTEMD_UNIT => openclaw-gateway.service
OPENCLAW_LAUNCHD_LABEL => ai.openclaw.gateway
PATH => /opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin
HOME => /Users/jiwoongyoo
OPENCLAW_SERVICE_KIND => gateway
OPENCLAW_SERVICE_MARKER => openclaw
XPC_SERVICE_NAME => ai.openclaw.gateway
}
domain = gui/501 [100022]
asid = 100022
minimum runtime = 10
exit timeout = 5
runs = 5
last exit code = 0
resource coalition = {
ID = 4643
type = resource
state = active
active count = 1
name = ai.openclaw.gateway
}
jetsam coalition = {
ID = 4644
type = jetsam
state = active
active count = 1
name = ai.openclaw.gateway
}
Two urgent things from what you pasted:
-
Your
launchctl print âŚoutput contains yourOPENCLAW_GATEWAY_TOKENagain. Please delete/edit that Discord message (anyone with that token can control your gateway). After we get you stable, rotate the token. -
launchctlshows the job is âspawn scheduledâ withactive count = 0andlast exit code = 0â the gateway is starting and then exiting immediately (cleanly). When that happens, the reason is almost always in:
- the rest of the
launchctl printoutput (exit status / throttle info), and/or - the newest lines of
gateway.err.log.
Do these 3 checks (no comments, one by one) and paste output
- Confirm the gateway is allowed to run (this was the earlier blocker):
/opt/homebrew/bin/openclaw config get gateway.mode
- Show the rest of the launchd job (this is the missing part):
launchctl print gui/$UID/ai.openclaw.gateway | sed -n '140,260p'
- Show the newest real error lines (not the old ones):
tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
After itâs stable: rotate token (donât paste it)
Once openclaw gateway status shows RPC probe: ok, rotate:
openclaw config set gateway.auth.token "$(openssl rand -hex 32)"
openclaw gateway restart
If you paste those three outputs, I can tell you exactly why launchd is exiting immediately (and the one specific fix), without going in circles.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw config get gateway.mode
đŚ OpenClaw 2026.2.13 (203b5bd)
WhatsApp automation without the "please accept our new privacy policy".
local
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl print gui/$UID/ai.openclaw.gateway | sed -n '140,260p'
jiwoongyoo@Jis-MacBook-Pro-2 ~ % tail -n 200 ~/.openclaw/logs/gateway.err.log | grep -v punycode | tail -n 80
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
all three commands showed nothing
I have rotated gateway token
can you give me alternative suggestions? It seems that you are going in circles and none of my settings change. I don't understand why openclaw doctor --fix doesn't solve the problem
That âLaunchAgent runs, then exits immediately with exit code 0â pattern usually means launchd is not actually running the gateway process â itâs running a command that returns quickly (most commonly openclaw gateway start / ⌠status / a wrapper), so launchd thinks âcool, doneâ and schedules another spawn.
Two things to do next that are safe to paste here (no tokens), and will tell us exactly whatâs happening:
1) Verify which LaunchAgent plist(s) you actually have
macOS docs note the label/plist can be bot.molt.gateway (legacy com.openclaw.* may exist too), so itâs easy to be looking at the wrong service.
Run:
ls -1 ~/Library/LaunchAgents | egrep -i 'openclaw|molt|gateway' || true
launchctl list | egrep -i 'openclaw|molt|gateway' || true
If you see more than one matching plist/label, thatâs a big hint for the ârandomly works / randomly 1006â behavior.
2) Print ONLY the ProgramArguments (no env vars â no token leaks)
Pick the plist you think is active (e.g. ~/Library/LaunchAgents/ai.openclaw.gateway.plist) and run:
PL=~/Library/LaunchAgents/ai.openclaw.gateway.plist
/usr/libexec/PlistBuddy -c "Print :Label" "$PL"
/usr/libexec/PlistBuddy -c "Print :ProgramArguments" "$PL"
/usr/libexec/PlistBuddy -c "Print :StandardOutPath" "$PL" 2>/dev/null || true
/usr/libexec/PlistBuddy -c "Print :StandardErrorPath" "$PL" 2>/dev/null || true
What we want to see in ProgramArguments is something like:
/opt/homebrew/bin/openclawgateway(orgateway run)--port 19000(and usually--bind loopback)
What would explain your exact symptom immediately:
⌠gateway start(returns right away â exit 0 loop)ProgramArguments[0]is justopenclaw(no absolute path; launchd PATH issues)- itâs pointing at an old nvm/global-node path that no longer exists
3) Check the actual launchd stdout/err log path
On macOS the gateway service often logs to /tmp/openclaw/openclaw-gateway.log (not always ~/.openclaw/logs/gateway.err.log).
So after you find StandardOutPath / StandardErrorPath, tail that file. If those keys arenât present, try:
ls -t /tmp/openclaw/openclaw-*.log 2>/dev/null | head -5
tail -n 200 /tmp/openclaw/openclaw-gateway.log 2>/dev/null | tail -n 80
Security follow-up (important)
Since the gateway token was pasted publicly: please delete those Discord messages and rotate the token when youâre ready. (Rotating now is fine too, but it can add noise while debugging service config.)
If you paste back:
- the
ls ~/Library/LaunchAgents | egrep âŚoutput, and - the
PlistBuddy :ProgramArgumentsoutput,
we can usually pinpoint the fix in one shot (either âwrong service labelâ, âwrong argumentsâ, or âlaunchd PATH/old nvm nodeâ).
jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -1 ~/Library/LaunchAgents | egrep -i 'openclaw|molt|gateway' || true
launchctl list | egrep -i 'openclaw|molt|gateway' || true
ai.openclaw.gateway.plist
- 0 ai.openclaw.gateway
jiwoongyoo@Jis-MacBook-Pro-2 ~ % PL=~/Library/LaunchAgents/ai.openclaw.gateway.plist
/usr/libexec/PlistBuddy -c "Print :Label" "$PL"
/usr/libexec/PlistBuddy -c "Print :ProgramArguments" "$PL"
/usr/libexec/PlistBuddy -c "Print :StandardOutPath" "$PL" 2>/dev/null || true
/usr/libexec/PlistBuddy -c "Print :StandardErrorPath" "$PL" 2>/dev/null || true
ai.openclaw.gateway
Array {
/opt/homebrew/bin/node
/opt/homebrew/lib/node_modules/openclaw/dist/index.js
gateway
--port
19000
}
/Users/jiwoongyoo/.openclaw/logs/gateway.log
/Users/jiwoongyoo/.openclaw/logs/gateway.err.log
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
Nice â that plist looks correct now:
- itâs launching Node directly (
/opt/homebrew/bin/node) - with the OpenClaw entrypoint (
âŚ/openclaw/dist/index.js gateway --port 19000) - and logs go to
~/.openclaw/logs/gateway*.log
So if launchd still shows âspawn scheduled / exit 0â, the next most likely cause is: it starts, immediately decides it canât/shouldnât bind, and exits cleanly (common reasons: port already in use or a config guardrail).
Can you run these and paste the output (theyâre token-safe):
A) Is anything already listening on 19000?
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
B) Force launchd to start it right now, then re-check the port
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
C) Tail the error log (paste last ~80 lines)
tail -n 200 ~/.openclaw/logs/gateway.err.log | tail -n 80
If (A) shows another PID on 19000, that explains the whole loop (gateway exits immediately because it canât bind). If (C) shows EADDRINUSE / âanother gateway instance is already listeningâ, same story.
Also: please donât paste launchctl print ⌠output here (it can include env vars/tokens depending on how it was installed). The commands above avoid that.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
Password:
jiwoongyoo@Jis-MacBook-Pro-2 ~ % sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
jiwoongyoo@Jis-MacBook-Pro-2 ~ % tail -n 200 ~/.openclaw/logs/gateway.err.log | tail -n 80
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
Cool â no listener on 19000 + empty gateway.err.log even after kickstart means launchd is most likely failing to spawn the process at all (or it spawns and exits before printing anything, which is rarer).
Letâs narrow it down with 3 very targeted, token-safe checks:
1) Confirm the exact binaries in ProgramArguments actually exist
ls -l /opt/homebrew/bin/node
ls -l /opt/homebrew/lib/node_modules/openclaw/dist/index.js
/opt/homebrew/bin/node -v
If either ls says âNo such fileâ, that explains the silent non-start immediately (launchd canât exec â nothing reaches the log files).
2) Run the exact same command manually (this bypasses launchd)
This is the fastest way to see the real reason if itâs exiting cleanly:
OPENCLAW_SKIP_CHANNELS=1 OPENCLAW_SKIP_CANVAS_HOST=1 \
/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js \
gateway --port 19000 --bind loopback --verbose
- If it stays running: in another terminal run
lsof -nP -iTCP:19000 -sTCP:LISTENand we know the gateway itself is fine â launchd is the problem. - If it exits, copy/paste the output (it should say why).
3) Get launchdâs spawn error without printing env vars
This should show âspawn failedâ, throttle, etc., but wonât leak tokens:
launchctl print gui/$UID/ai.openclaw.gateway | egrep -i 'state|pid|last exit|spawn|error|errno|reason|throttle|failed|program|arguments|disabled'
Paste that output.
Once we see (1)-(3), weâll know which bucket youâre in:
- missing path / moved install (common after node/npm changes),
- gateway exits immediately due to config guardrail (manual run will show),
- or launchd spawn failure/throttling (print output will show).
lrwxr-xr-x 1 jiwoongyoo admin 34 15 Feb 01:37 /opt/homebrew/bin/node -> ../Cellar/node@22/22.22.0/bin/node
-rwxr-xr-x 1 root admin 241515 14 Feb 15:54 /opt/homebrew/lib/node_modules/openclaw/dist/index.js
v22.22.0
jiwoongyoo@Jis-MacBook-Pro-2 ~ % OPENCLAW_SKIP_CHANNELS=1 OPENCLAW_SKIP_CANVAS_HOST=1
/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js
gateway --port 19000 --bind loopback --verbose
00:06:10 [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
11:06:11 bonjour: starting (hostname=openclaw, instance="Jiâs MacBook Pro (2) (OpenClaw)", gatewayPort=19000, minimal=true)
00:06:11 [heartbeat] started
00:06:11 [gateway] agent model: zai/glm-5
00:06:11 [gateway] listening on ws://127.0.0.1:19000 (PID 41119)
00:06:11 [gateway] listening on ws://[::1]:19000
00:06:11 [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
00:06:11 [browser/service] Browser control service ready (profiles=2)
00:06:11 [hooks:loader] Registered hook: boot-md -> gateway:startup
00:06:11 [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
00:06:11 [hooks:loader] Registered hook: command-logger -> command
00:06:11 [hooks:loader] Registered hook: session-memory -> command:new
11:06:11 â ď¸ Session file not found: gateway
11:06:11 Proceeding with reset...
11:06:11 EXECUTE_NEW
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl print gui/$UID/ai.openclaw.gateway | egrep -i 'state|pid|last exit|spawn|error|errno|reason|throttle|failed|program|arguments|disabled'
state = spawn scheduled
program = /opt/homebrew/bin/node
arguments = {
last exit code = 0
state = active
state = active
spawn type = daemon (3)
job state = exited
properties = partial import | keepalive | runatload | inferred program
Perfect signal: the gateway runs fine manually and binds ws://127.0.0.1:19000. So this is now 100% a launchd/service issue, not OpenClaw core.
Next we need to figure out why launchd canât spawn it / or spawns then instantly kills it.
0) First: stop the manual gateway
In the terminal where itâs running: Ctrl+C (otherwise launchd canât bind the port if it does start).
1) Check if launchd is failing to open the log files (super common)
If ~/.openclaw/logs/gateway*.log are accidentally root-owned or the dir isnât writable, launchd will fail to start the job.
Run:
ls -ld ~/.openclaw ~/.openclaw/logs
ls -l ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
If you see root as owner anywhere in that chain, tell me â thatâs almost certainly the bug.
2) Kickstart again, then check whether the log timestamps moved
stat -f "%m %N" ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
stat -f "%m %N" ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
If timestamps donât change at all, launchd likely failed before it could even redirect stdout/err.
3) Get the launchd error without leaking tokens
(Please paste output; this filtered view should be safe.)
launchctl print gui/$UID/ai.openclaw.gateway | egrep -i 'state|pid|last exit|exit|errno|error|failed|spawn|throttle|program|arguments'
That usually contains the smoking gun like âCould not open stdout pathâ, âbad executableâ, âthrottledâ, etc.
Once you paste those 2â3 outputs, we can give the exact fix (often a simple chown on ~/.openclaw/logs, or a bootout/bootstrap of the job).
That launchctl print ⌠snippet is the key: launchd is running /opt/homebrew/bin/node ⌠gateway --port 19000, but the process is exiting cleanly (exit 0) almost immediately.
Since the exact same command stays up when you run it manually, the two most common differences are:
- launchd canât write to stdout/err paths (
~/.openclaw/logs/gateway*.log) due to ownership/permissions, or - the gateway is exiting early only in âfull modeâ (because launchd doesnât set your
OPENCLAW_SKIP_*env vars), and the reason is ingateway.logor the/tmp/openclaw/openclaw-*.logfile.
Run these (safe to paste; no tokens):
1) Check log directory/file ownership + permissions
ls -ld ~/.openclaw ~/.openclaw/logs
ls -l ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
If anything there is owned by root (or not writable), launchd jobs often âstart then exitâ with basically no output.
2) After a kickstart, see if either log got anything
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
tail -n 80 ~/.openclaw/logs/gateway.log 2>/dev/null || true
tail -n 80 ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
ls -t /tmp/openclaw/openclaw-*.log 2>/dev/null | head -3
tail -n 80 "$(ls -t /tmp/openclaw/openclaw-*.log 2>/dev/null | head -1)" 2>/dev/null || true
3) Run the manual gateway without the skip env vars (to match launchd)
Stop any running gateway first (Ctrl+C), then:
/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js \
gateway --port 19000 --bind loopback --verbose
If this version exits quickly, itâll finally print why (channels/auth/model/etc).
Paste outputs from (1) + (2) (and (3) only if it exits). Thatâll tell us whether itâs a permissions/log-path issue vs âfull startup exitsâ issue.
state = spawn scheduled
program = /opt/homebrew/bin/node
arguments = {
last exit code = 0
state = active
state = active
spawn type = daemon (3)
job state = exited
properties = partial import | keepalive | runatload | inferred program
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -ld ~/.openclaw ~/.openclaw/logs
ls -l ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
drwx------@ 40 jiwoongyoo staff 1280 15 Feb 10:45 /Users/jiwoongyoo/.openclaw
drwx------ 7 jiwoongyoo staff 224 15 Feb 10:26 /Users/jiwoongyoo/.openclaw/logs
-rw-r--r-- 1 jiwoongyoo staff 0 15 Feb 10:26 /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
-rw-r--r-- 1 jiwoongyoo staff 290880 15 Feb 11:09 /Users/jiwoongyoo/.openclaw/logs/gateway.log
jiwoongyoo@Jis-MacBook-Pro-2 ~ % stat -f "%m %N" ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
stat -f "%m %N" ~/.openclaw/logs/gateway.log ~/.openclaw/logs/gateway.err.log 2>/dev/null || true
1771114235 /Users/jiwoongyoo/.openclaw/logs/gateway.log
1771111586 /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
1771114255 /Users/jiwoongyoo/.openclaw/logs/gateway.log
1771111586 /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl print gui/$UID/ai.openclaw.gateway | egrep -i 'state|pid|last exit|exit|errno|error|failed|spawn|throttle|program|arguments'
state = spawn scheduled
program = /opt/homebrew/bin/node
arguments = {
exit timeout = 5
last exit code = 0
state = active
state = active
spawn type = daemon (3)
job state = exited
properties = partial import | keepalive | runatload | inferred program
Good â permissions look fine, and gateway.logâs mtime changes when you kickstart, so launchd is starting something that writes at least a little⌠then exits 0.
Next step is simply: read what it wrote right before exiting.
1) Paste the last ~120 lines of gateway.log
tail -n 120 ~/.openclaw/logs/gateway.log
If it contains anything about tokens/passwords (unlikely, but just in case), redact that line before pasting.
2) Also paste the tail of the real â/tmpâ log (this is often the best one)
ls -t /tmp/openclaw/openclaw-*.log 2>/dev/null | head -3
tail -n 120 "$(ls -t /tmp/openclaw/openclaw-*.log 2>/dev/null | head -1)"
3) Reproduce âlaunchd-likeâ startup manually (no SKIP flags)
You proved it runs with OPENCLAW_SKIP_CHANNELS=1. Now test the same as launchd:
/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js \
gateway --port 19000 --bind loopback --verbose
- If this one exits quickly, paste the output (it will usually explain exactly what launchd is hitting: missing env creds, channel init failure, config guardrail, etc.).
- If it stays running, then the difference is almost certainly launchd environment / working directory (e.g. secrets living only in a
.envthat launchd never loads).
Once I see the tail of gateway.log + the /tmp/openclaw/openclaw-*.log tail, weâll know the precise reason for the clean exit.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % tail -n 120 ~/.openclaw/logs/gateway.log
2026-02-15T00:13:24.428Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-15T00:13:24.870Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-15T00:13:24.912Z [heartbeat] started
2026-02-15T00:13:24.914Z [gateway] agent model: zai/glm-5
2026-02-15T00:13:24.915Z [gateway] listening on ws://127.0.0.1:19000 (PID 41738)
2026-02-15T00:13:24.915Z [gateway] listening on ws://[::1]:19000
2026-02-15T00:13:24.916Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-15T00:13:24.926Z [browser/service] Browser control service ready (profiles=2)
2026-02-15T00:13:25.034Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-15T00:13:25.045Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-15T00:13:25.046Z [hooks:loader] Registered hook: command-logger -> command
2026-02-15T00:13:25.048Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T11:13:25.049+11:00 â ď¸ Session file not found: gateway
2026-02-15T11:13:25.051+11:00 Proceeding with reset...
{"0":"â ď¸ Session file not found: gateway","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T00:16:54.774Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-15T00:16:54.774Z"}
{"0":"Proceeding with reset...","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T00:16:54.775Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-15T00:16:54.775Z"}
{"0":"EXECUTE_NEW","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T00:16:54.775Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js
gateway --port 19000 --bind loopback --verbose
đŚ OpenClaw 2026.2.13 (203b5bd) â I'm the assistant your terminal demanded, not the one your sleep schedule requested.
00:17:45 [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
00:17:45 [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
11:17:45 bonjour: starting (hostname=openclaw, instance="Jiâs MacBook Pro (2) (OpenClaw)", gatewayPort=19000, minimal=true)
00:17:45 [heartbeat] started
00:17:45 [gateway] agent model: zai/glm-5
00:17:45 [gateway] listening on ws://127.0.0.1:19000 (PID 42102)
00:17:45 [gateway] listening on ws://[::1]:19000
00:17:45 [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
00:17:45 [browser/service] Browser control service ready (profiles=2)
00:17:45 [hooks:loader] Registered hook: boot-md -> gateway:startup
00:17:45 [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
00:17:45 [hooks:loader] Registered hook: command-logger -> command
00:17:45 [hooks:loader] Registered hook: session-memory -> command:new
11:17:45 â ď¸ Session file not found: gateway
11:17:45 Proceeding with reset...
11:17:45 EXECUTE_NEW
can you suggests something new, I feel that I have given you enough information and my assessment is that it can't be fixed so can we try and resolve it without further diagnosing as it doesn't seem to make any difference
are you still able to help me
are you still there
Yep â still here.
Your last paste shows launchd starts the gateway, it binds to 19000, then exits. The missing piece is the tail of /tmp/openclaw/openclaw-2026-02-15.log (thatâs where the shutdown reason usually is).
Can you run + paste:
tail -n 120 /tmp/openclaw/openclaw-2026-02-15.log
(If the file name differs, do:)
tail -n 120 "$(ls -t /tmp/openclaw/openclaw-*.log | head -1)"
Also quick check (no secrets):
ls -la ~/.env ~/.openclaw/.env 2>/dev/null || true
{"0":"â ď¸ Session file not found: gateway","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T00:28:08.447Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-15T00:28:08.447Z"}
{"0":"Proceeding with reset...","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T00:28:08.448Z","logLevelId":3,"logLevelName":"INFO","path":
{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-15T00:28:08.448Z"}
{"0":"EXECUTE_NEW","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T00:28:08.449Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716:46","fileName":"subsystem-QRNIBE7-.js","fileNameWithLine":"subsystem-QRNIBE7-.js:716","fileColumn":"46","fileLine":"716","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-QRNIBE7-.js:716","method":"console.log"}},"time":"2026-02-15T00:28:08.449Z"}
jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -la ~/.env ~/.openclaw/.env 2>/dev/null || true
-rw-r--r--@ 1 jiwoongyoo staff 210 14 Feb 18:08 /Users/jiwoongyoo/.openclaw/.env
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
Yep, still here.
That /tmp/openclaw/openclaw-2026-02-15.log snippet you pasted only shows the reset message, but not why the gateway exits right after. The easiest âsafe to pasteâ thing (tokens redacted) is:
/opt/homebrew/bin/openclaw status --all
Paste that output (or at least the Gateway / service section + the log tail it includes).
Also, quick env-file check (often the difference between âworks in terminalâ vs âdies under launchdâ):
ls -la ~/.env ~/.openclaw/.env 2>/dev/null || true
If ~/.env exists but ~/.openclaw/.env does not, copy it (donât paste contents):
cp ~/.env ~/.openclaw/.env
chmod 600 ~/.openclaw/.env
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
Send the results of openclaw status --all + the ls -la ⌠and we can pin down the exact exit cause.
Diagnosis (read-only)
Gateway connection details:
Gateway target: ws://127.0.0.1:19000
Source: local loopback
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Bind: loopback
â Config: /Users/jiwoongyoo/.openclaw/openclaw.json
! Restart sentinel present
Gateway restart config-patch ok (config.patch) ¡ 14h ago
Gateway logs (tail, summarized): /Users/jiwoongyoo/.openclaw/logs
stderr: /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
stdout: /Users/jiwoongyoo/.openclaw/logs/gateway.log
2026-02-15T00:33:02.306Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-15T00:33:02.315Z [browser/service] Browser control service ready (profiles=2)
2026-02-15T00:33:02.414Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-15T00:33:02.427Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-15T00:33:02.427Z [hooks:loader] Registered hook: command-logger -> command
2026-02-15T00:33:02.430Z [hooks:loader] Registered hook: session-memory -> command:new
⌠18 lines omitted âŚ
2026-02-15T00:33:22.822Z [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
2026-02-15T00:33:23.230Z [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
2026-02-15T00:33:23.271Z [heartbeat] started
2026-02-15T00:33:23.273Z [gateway] agent model: zai/glm-5
2026-02-15T00:33:23.273Z [gateway] listening on ws://127.0.0.1:19000 (PID 43410)
2026-02-15T00:33:23.274Z [gateway] listening on ws://[::1]:19000
2026-02-15T00:33:23.275Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-15T00:33:23.284Z [browser/service] Browser control service ready (profiles=2)
2026-02-15T00:33:23.401Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-15T00:33:23.412Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-15T00:33:23.412Z [hooks:loader] Registered hook: command-logger -> command
2026-02-15T00:33:23.415Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T11:33:23.416+11:00 â ď¸ Session file not found: gateway
2026-02-15T11:33:23.417+11:00 Proceeding with reset...
2026-02-15T11:33:23.418+11:00 EXECUTE_NEW
! Channel issues skipped (gateway unreachable)
Gateway health:
connect failed: connect ECONNREFUSED 127.0.0.1:19000
jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -la ~/.env ~/.openclaw/.env 2>/dev/null || true
-rw-r--r--@ 1 jiwoongyoo staff 210 14 Feb 18:08 /Users/jiwoongyoo/.openclaw/.env
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -la ~/.env ~/.openclaw/.env 2>/dev/null || true
-rw-r--r--@ 1 jiwoongyoo staff 210 14 Feb 18:08 /Users/jiwoongyoo/.openclaw/.env
jiwoongyoo@Jis-MacBook-Pro-2 ~ % cp ~/.env ~/.openclaw/.env
chmod 600 ~/.openclaw/.env
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
cp: /Users/jiwoongyoo/.env: No such file or directory
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
Still here.
That /tmp/openclaw/openclaw-2026-02-15.log tail is only:
- âSession file not foundâŚâ
- âProceeding with resetâŚâ
- âEXECUTE_NEWâ
âŚand then nothing. So weâre not seeing a crash reason yet.
Since you do have ~/.openclaw/.env (great â launchd runs will pick it up), the cleanest next test is:
A/B test: skip channels temporarily (to see if a channel init is what makes launchd exit)
- Edit
~/.openclaw/.envlocally and add this line (donât paste the file contents):
OPENCLAW_SKIP_CHANNELS=1
- Restart the LaunchAgent:
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
- Check service view:
/opt/homebrew/bin/openclaw gateway status --no-probe
What this tells us
- If it stays listening on 19000 with channels skipped â something in channel startup (Discord/Telegram/etc) is causing the service to exit, and we can narrow it from there.
- If it still exits â itâs not channels; weâll move on to the next subsystem.
If it does stay up with OPENCLAW_SKIP_CHANNELS=1, reply with:
- the output of
openclaw gateway status --no-probe - and whether
lsofshows a listener
Then weâll re-enable channels and isolate which one triggers the exit (without leaking any tokens).
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw gateway status --no-probe
đŚ OpenClaw 2026.2.13 (203b5bd) â I'll do the boring stuff while you dramatically stare at the logs like it's cinema.
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Youâre good â we finally have a concrete weird thing to poke:
Your openclaw status --all shows:
- Restart sentinel present (from a config.patch 14h ago)
- Gateway starts and binds to
127.0.0.1:19000 - then soon after, health is ECONNREFUSED (so the process is gone again)
A very plausible cause is: the Gateway is doing some âpost-restartâ bookkeeping on boot (restart sentinel / boot hooks), and something in that path is making it exit cleanly before it settles.
1) Quick, safe test: temporarily remove the restart sentinel
This does not delete your data; itâs just a restart report file.
mv ~/.openclaw/restart-sentinel.json ~/.openclaw/restart-sentinel.json.bak 2>/dev/null || true
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
If lsof shows a listener and gateway status shows RPC probe: ok, we found the culprit.
2) If it still exits: run the âskip channelsâ A/B test (also safe)
Edit ~/.openclaw/.env and add these lines:
OPENCLAW_SKIP_CHANNELS=1
OPENCLAW_SKIP_CANVAS_HOST=1
Then:
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
This tells us whether some provider/plugin startup is whatâs killing it.
If you run step (1), paste just:
- the
lsof âŚ19000âŚoutput (should be short), and - the
openclaw gateway statusoutput
(And yep: donât paste any raw launchctl print env vars.)
Yeah â that openclaw gateway status --no-probe output confirms what we suspected:
- LaunchAgent is loaded
- but the gateway process exits immediately (cleanly), so you get
ECONNREFUSEDon127.0.0.1:19000.
And your logs show it gets as far as âlistening âŚâ and then stops right after:
Session file not found: gateway â Proceeding with reset⌠â EXECUTE_NEW
Letâs do two quick isolation tests.
1) Clear the ârestart sentinelâ (safe, doesnât delete data)
openclaw status --all says a restart sentinel is present. Move it aside and restart the agent:
ls -la ~/.openclaw/restart-sentinel.json 2>/dev/null || true
mv ~/.openclaw/restart-sentinel.json ~/.openclaw/restart-sentinel.json.bak 2>/dev/null || true
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
If this suddenly stays up (RPC probe: ok), weâve found the trigger.
2) If it still exits: skip channels to see if a provider init is killing it
Edit ~/.openclaw/.env (you already have it) and add:
OPENCLAW_SKIP_CHANNELS=1
OPENCLAW_SKIP_CANVAS_HOST=1
Then:
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
Reply with:
- the
lsof âŚ19000âŚline(s), and - the
openclaw gateway statussummary
and weâll know which branch to go down next.
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
jiwoongyoo@Jis-MacBook-Pro-2 ~ % sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
đŚ OpenClaw 2026.2.13 (203b5bd) â Chat automation for people who peaked at IRC.
â
â
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
jiwoongyoo@Jis-MacBook-Pro-2 ~ % ~/.openclaw/.env
zsh: permission denied: /Users/jiwoongyoo/.openclaw/.env
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
~/.openclaw/.env is a config file, not a command â thatâs why you got permission denied when you typed it.
Right now the key fact is: launchd starts the gateway, it binds, then it exits almost immediately (so lsof shows nothing and gateway status ends up with 1006/ECONNREFUSED).
Letâs isolate it cleanly:
0) (Quick sanity) make sure youâre not still using a wrapper that injects --url
In the same terminal where you run openclaw âŚ, run:
type -a openclaw
echo "OPENCLAW_GATEWAY_URL=$OPENCLAW_GATEWAY_URL"
Paste that output (it should not contain secrets).
1) Temporarily move the restart-sentinel out of the way (safe)
ls -la ~/.openclaw/restart-sentinel.json 2>/dev/null || true
mv ~/.openclaw/restart-sentinel.json ~/.openclaw/restart-sentinel.json.bak 2>/dev/null || true
Then restart + check if anything is listening:
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status --no-probe
2) If it still exits: skip channels + canvas host via .env (safe, reversible)
Append two lines to ~/.openclaw/.env (donât paste the file contents):
printf "\nOPENCLAW_SKIP_CHANNELS=1\nOPENCLAW_SKIP_CANVAS_HOST=1\n" >> ~/.openclaw/.env
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status --no-probe
Reply with:
- the
type -a openclaw+OPENCLAW_GATEWAY_URL=... - the
lsofoutput (even if empty) - the
gateway status --no-probeoutput
If it stays up with OPENCLAW_SKIP_CHANNELS=1, weâll know a channel/provider init is whatâs killing the service, and we can narrow down which one without touching your data.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % type -a openclaw
echo "OPENCLAW_GATEWAY_URL=$OPENCLAW_GATEWAY_URL"
openclaw is a shell function from /Users/jiwoongyoo/.zshrc
openclaw is /opt/homebrew/bin/openclaw
OPENCLAW_GATEWAY_URL=
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
jiwoongyoo@Jis-MacBook-Pro-2 ~ % printf "\nOPENCLAW_SKIP_CHANNELS=1\nOPENCLAW_SKIP_CANVAS_HOST=1\n" >> ~/.openclaw/.env
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status --no-probe
đŚ OpenClaw 2026.2.13 (203b5bd) â I can grep it, git blame it, and gently roast itâpick your coping mechanism.
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Thereâs your smoking gun:
openclaw is a shell function from /Users/jiwoongyoo/.zshrc
So when you type openclaw ⌠you are not reliably running /opt/homebrew/bin/openclaw. That also explains the weird status line:
Source: cli --url
Step 1 (right now, in this terminal): bypass the function
unset -f openclaw
type -a openclaw
After that, only use /opt/homebrew/bin/openclaw ⌠(or make sure type -a no longer shows the function).
Step 2 (permanent fix): remove the function from ~/.zshrc
Open ~/.zshrc in an editor and delete/comment the openclaw() { ⌠} function block.
Then restart your shell:
exec zsh
type -a openclaw
(Please donât paste the function here â it might contain tokens/URLs.)
After the wrapper is gone: re-run the service tests (this time with the real CLI)
First check status (no probe):
/opt/homebrew/bin/openclaw gateway status --no-probe
Then do the 2 isolation tests:
A) Move the restart sentinel out of the way (safe)
mv ~/.openclaw/restart-sentinel.json ~/.openclaw/restart-sentinel.json.bak 2>/dev/null || true
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
B) If it still exits: skip channels + canvas host via .env
printf "\nOPENCLAW_SKIP_CHANNELS=1\nOPENCLAW_SKIP_CANVAS_HOST=1\n" >> ~/.openclaw/.env
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
Post back:
- the
type -a openclawresult after fixing, and - the
lsof âŚ19000âŚ+openclaw gateway statusoutput from test (A) (and (B) if needed).
Thatâs progress: even with OPENCLAW_SKIP_CHANNELS=1 + OPENCLAW_SKIP_CANVAS_HOST=1, the LaunchAgent still exits immediately. So itâs not channels/canvas killing it.
Given your earlier openclaw status --all showed âRestart sentinel presentâ, the most likely culprit now is:
The gateway is crashing shortly after startup while trying to process ~/.openclaw/restart-sentinel.json
Thereâs a âwake from restart sentinelâ task that runs ~750ms after boot. If the sentinel references a session that no longer exists, it can throw before it reaches the try/catch, and (depending on runtime settings) that can take the whole gateway down.
Do this (safe, does not delete your OpenClaw data)
- Move the sentinel out of the way:
ls -la ~/.openclaw/restart-sentinel.json 2>/dev/null || true
mv ~/.openclaw/restart-sentinel.json ~/.openclaw/restart-sentinel.json.bak 2>/dev/null || true
- Restart the LaunchAgent and check if it stays up:
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
If it works
Great â then remove the temporary skip flags you appended to ~/.openclaw/.env (otherwise channels wonât start). Easiest is to edit the file and delete these lines:
OPENCLAW_SKIP_CHANNELS=1OPENCLAW_SKIP_CANVAS_HOST=1
Then restart the agent again.
Also: please fix the openclaw shell function
You still have openclaw as a shell function in ~/.zshrc, which will keep causing âSource: cli --urlâ weirdness. At minimum in your current terminal do:
unset -f openclaw
type -a openclaw
(And then remove that function from ~/.zshrc permanently.)
Reply with the lsof output + openclaw gateway status after moving the sentinel.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % ls -la ~/.openclaw/restart-sentinel.json 2>/dev/null || true
mv ~/.openclaw/restart-sentinel.json ~/.openclaw/restart-sentinel.json.bak 2>/dev/null || true
jiwoongyoo@Jis-MacBook-Pro-2 ~ % launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status
â
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: stopped (state active)
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Launchd stdout (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.log
Launchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
jiwoongyoo@Jis-MacBook-Pro-2 ~ % unset -f openclaw
type -a openclaw
unset: no such hash table element: openclaw
openclaw is /opt/homebrew/bin/openclaw
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
are you still there? I need help
Still here.
Good news: you fixed the shell-function override (now openclaw resolves to /opt/homebrew/bin/openclaw). That removes a whole class of âSource: cli --urlâ weirdness going forward (but you should still delete that openclaw() { ⌠} block from ~/.zshrc so it doesnât come back in new terminals).
Bad news: the LaunchAgent still exits immediately even with channels/canvas skipped, so the killer is something else in gateway startup.
Next isolation (super common culprit): disable sidecars
Append these to ~/.openclaw/.env (donât run the file, just add lines):
printf "\nOPENCLAW_SKIP_BROWSER_CONTROL_SERVER=1\nOPENCLAW_SKIP_GMAIL_WATCHER=1\nOPENCLAW_SKIP_CRON=1\n" >> ~/.openclaw/.env
Then restart + check if anything is listening:
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
/opt/homebrew/bin/openclaw gateway status --no-probe
Also paste this log tail (this is where the âwhy it exitedâ line usually shows up):
tail -n 200 ~/.openclaw/logs/gateway.log | tail -n 80
tail -n 200 /tmp/openclaw/openclaw-2026-02-15.log | tail -n 80
If it still exits with all those sidecars skipped, Iâll have you grab one macOS unified-log query for launchd (safe, no tokens) â but letâs try the sidecars first.
{"0":"\u001b[38;2;226;61;45mLaunchd stderr (if installed): /Users/jiwoongyoo/.openclaw/logs/gateway.err.log\u001b[39m","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T01:16:06.909Z","logLevelId":5,"logLevelName":"ERROR","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1165:68","fileName":"entry.js","fileNameWithLine":"entry.js:1165","fileColumn":"68","fileLine":"1165","filePath":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js","filePathWithLine":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1165","method":"console.error"}},"time":"2026-02-15T01:16:06.909Z"}
{"0":"","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T01:16:06.909Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1163:46","fileName":"entry.js","fileNameWithLine":"entry.js:1163","fileColumn":"46","fileLine":"1163","filePath":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js","filePathWithLine":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1163","method":"console.log"}},"time":"2026-02-15T01:16:06.909Z"}
{"0":"\u001b[38;2;139;127;119mTroubles:\u001b[39m run openclaw status","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T01:16:06.909Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1163:46","fileName":"entry.js","fileNameWithLine":"entry.js:1163","fileColumn":"46","fileLine":"1163","filePath":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js","filePathWithLine":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1163","method":"console.log"}},"time":"2026-02-15T01:16:06.909Z"}
{"0":"\u001b[38;2;139;127;119mTroubleshooting:\u001b[39m https://docs.openclaw.ai/troubleshooting","_meta":{"runtime":"node","runtimeVersion":"22.22.0","hostname":"unknown","name":"openclaw","date":"2026-02-15T01:16:06.909Z","logLevelId":3,"logLevelName":"INFO","path":
{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1163:46","fileName":"entry.js","fileNameWithLine":"entry.js:1163","fileColumn":"46","fileLine":"1163","filePath":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js","filePathWithLine":"/opt/homebrew/lib/node_modules/openclaw/dist/entry.js:1163","method":"console.log"}},"time":"2026-02-15T01:16:06.909Z"}
jiwoongyoo@Jis-MacBook-Pro-2 ~ % tail -n 200 ~/.openclaw/logs/gateway.log | tail -n 80
tail -n 200 /tmp/openclaw/openclaw-2026-02-15.log | tail -n 80
2026-02-15T01:15:00.204Z [gateway] agent model: zai/glm-5
2026-02-15T01:15:00.205Z [gateway] listening on ws://127.0.0.1:19000 (PID 47244)
2026-02-15T01:15:00.206Z [gateway] listening on ws://[::1]:19000
2026-02-15T01:15:00.207Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-15T01:15:00.216Z [browser/service] Browser control service ready (profiles=2)
2026-02-15T01:15:00.321Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-15T01:15:00.332Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-15T01:15:00.333Z [hooks:loader] Registered hook: command-logger -> command
2026-02-15T01:15:00.335Z [hooks:loader] Registered hook: session-memory -> command:new
2026-02-15T12:15:00.336+11:00 â ď¸ Session file not found: gateway
2026-02-15T12:15:00.337+11:00 Proceeding with reset...
2026-02-15T12:15:00.337+11:00 EXECUTE_NEW
Still here â and that JSON line you pasted is just the CLI printing an error banner (âLaunchd stderr âŚâ), not the root cause.
At this point weâve proven:
- the LaunchAgent can start, even binds to
127.0.0.1:19000 - but it exits almost immediately
- it still exits even when you skip channels + canvas (so itâs not Discord/Telegram/etc)
Now we need one decisive A/B test:
Test: does the gateway stay up when run manually for 15â30s?
- Stop/unload the LaunchAgent so it doesnât fight you:
/opt/homebrew/bin/openclaw gateway stop || true
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true
- Run the exact gateway command in the foreground:
/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js \
gateway --port 19000 --bind loopback --verbose
- While that is running, in a second terminal:
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
Tell me which outcome you get
- If manual run stays up (you keep seeing logs, command doesnât return): this is a launchd-specific kill/exit, and next weâll pull the macOS unified logs for why launchd is terminating it.
- If manual run also exits quickly (prompt returns): itâs OpenClaw exiting itself right after that
EXECUTE_NEW, and weâll focus on that code path / state dir.
Also: good catch fixing the openclaw function â keep it that way (remove it from ~/.zshrc so it doesnât come back).
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/openclaw gateway stop || true
launchctl bootout gui/$UID/ai.openclaw.gateway 2>/dev/null || true
đŚ OpenClaw 2026.2.13 (203b5bd) â Your AI assistant, now without the $3,499 headset.
Stopped LaunchAgent: gui/501/ai.openclaw.gateway
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js
gateway --port 19000 --bind loopback --verbose
đŚ OpenClaw 2026.2.13 (203b5bd) â Pairing codes exist because even bots believe in consentâand good security hygiene.
01:20:26 [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
12:20:26 bonjour: starting (hostname=openclaw, instance="Jiâs MacBook Pro (2) (OpenClaw)", gatewayPort=19000, minimal=true)
01:20:26 [heartbeat] started
01:20:26 [gateway] agent model: zai/glm-5
01:20:26 [gateway] listening on ws://127.0.0.1:19000 (PID 47753)
01:20:26 [gateway] listening on ws://[::1]:19000
01:20:26 [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
01:20:26 [hooks:loader] Registered hook: boot-md -> gateway:startup
01:20:26 [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
01:20:26 [hooks:loader] Registered hook: command-logger -> command
01:20:26 [hooks:loader] Registered hook: session-memory -> command:new
12:20:26 â ď¸ Session file not found: gateway
12:20:26 Proceeding with reset...
12:20:26 EXECUTE_NEW
Still here â and youâre not crazy: the logs stop at EXECUTE_NEW with no stacktrace, which strongly suggests the gateway is being terminated externally (often by launchd), or itâs instantly self-restarting in a way that doesnât get logged.
Two things to do next that will finally tell us âwho killed itâ:
1) Check if your .env skip flags are actually taking effect (duplicates matter)
dotenv wonât override an already-set var, and if your .env already had OPENCLAW_SKIP_* earlier, appending new ones may do nothing.
Run:
grep -n '^OPENCLAW_SKIP' ~/.openclaw/.env
If you see duplicates, edit ~/.openclaw/.env and keep only one line per key.
2) Ask macOS launchd why itâs stopping the job (safe; no tokens)
Right after a kickstart:
launchctl kickstart -k gui/$UID/ai.openclaw.gateway
sleep 1
log show --style syslog --last 2m \
--predicate '(subsystem == "com.apple.xpc.launchd") && (eventMessage CONTAINS "ai.openclaw.gateway")' \
| tail -n 80
Paste that output. It usually contains the smoking gun like âexited due to signalâ, âkilledâ, âthrottledâ, etc.
Also: good job fixing the openclaw shell function
In this terminal itâs gone (openclaw is /opt/homebrew/bin/openclaw). Make it permanent by removing the openclaw() { ⌠} block from ~/.zshrc so it doesnât come back in new terminals.
Send the grep output + the log show ⌠tail and we can tell you exactly what to fix next.
Still here â and this is actually a useful result: youâve now reproduced the same âstops at EXECUTE_NEWâ behavior without launchd, so we can debug it like a normal process.
Right now your gateway command might be either:
- still running (just not printing more logs), or
- already exited right after
EXECUTE_NEW.
Do this while that terminal is sitting at EXECUTE_NEW
Open a second Terminal window/tab and run:
# 1) Is the gateway process still alive?
ps -p 47753 -o pid,etime,command || echo "PID 47753 not running"
# 2) Is anything listening on the port?
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# 3) Does the HTTP dashboard respond at all?
curl -I http://127.0.0.1:19000/ 2>/dev/null | head -20 || echo "curl failed"
(Replace 47753 if your PID changed â itâs the one printed in listening on ⌠(PID âŚ).)
Paste those 3 outputs.
If PID is running + port is listening
Then the gateway is actually up, and the next step is figuring out why openclaw gateway status gives 1006 (usually wrapper/URL/auth mismatch â which youâve mostly fixed by removing the shell function).
If PID is gone / no listener
Then we need a crash reason. In that case weâll re-run once with strict Node crash output enabled:
NODE_OPTIONS="--trace-uncaught --trace-warnings --unhandled-rejections=strict" \
/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js \
gateway --port 19000 --bind loopback --verbose
But first: run the 3 checks above so we know which branch weâre on.
jiwoongyoo@Jis-MacBook-Pro-2 ~ % NODE_OPTIONS="--trace-uncaught --trace-warnings --unhandled-rejections=strict"
/opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js
gateway --port 19000 --bind loopback --verbose
đŚ OpenClaw 2026.2.13 (203b5bd) â IPC, but it's your phone.
01:27:56 [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
12:27:57 bonjour: starting (hostname=openclaw, instance="Jiâs MacBook Pro (2) (OpenClaw)", gatewayPort=19000, minimal=true)
01:27:57 [heartbeat] started
01:27:57 [gateway] agent model: zai/glm-5
01:27:57 [gateway] listening on ws://127.0.0.1:19000 (PID 47797)
01:27:57 [gateway] listening on ws://[::1]:19000
01:27:57 [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
01:27:57 [hooks:loader] Registered hook: boot-md -> gateway:startup
01:27:57 [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
01:27:57 [hooks:loader] Registered hook: command-logger -> command
01:27:57 [hooks:loader] Registered hook: session-memory -> command:new
12:27:57 â ď¸ Session file not found: gateway
12:27:57 Proceeding with reset...
12:27:57 EXECUTE_NEW
Still here â and the fact you see the same âEXECUTE_NEWâ line even when running the gateway manually is actually good: it means this isnât launchd doing something weird, itâs either:
- the gateway is still running fine (and just has no more logs), or
- itâs exiting cleanly right after that line.
We need to determine which one.
While that node ⌠gateway ⌠process is sitting there at EXECUTE_NEW
Open a second Terminal and run:
# Is the PID still alive?
ps -p 47797 -o pid,etime,command || echo "PID not running"
# Is it still listening?
sudo lsof -nP -iTCP:19000 -sTCP:LISTEN || true
# Does the dashboard respond at all?
curl -I http://127.0.0.1:19000/ 2>/dev/null | head -20 || echo "curl failed"
(Use the PID you see in your log: PID 47797.)
If PID is alive + lsof shows LISTEN
Then the gateway is actually up, and weâll switch to âwhy does openclaw gateway status / Control UI still failâ (usually auth/wrapper/env mismatch).
If PID is not running and no LISTEN
Then itâs doing a clean exit loop. In that case the next best move is Doctor repair, because this âSession file not found: gateway â resetâ smells like a busted session store/transcript reference:
/opt/homebrew/bin/openclaw doctor --repair
(Doctor output is designed to be shareable; secrets are redacted â but still donât paste anything that looks like a token.)
Also: great job fixing the shell function override â type -a openclaw now points to /opt/homebrew/bin/openclaw. Make that permanent by removing the openclaw() { ⌠} block from ~/.zshrc so it doesnât come back in new terminals.
Paste the ps + lsof + curl outputs and weâll go down the right branch.
â Gateway âââââââââââââââââââââââââŽ
â â
â Gateway service not installed. â
â â
ââââââââââââââââââââââââââââââââââââŻ
Installed LaunchAgent: /Users/jiwoongyoo/Library/LaunchAgents/ai.openclaw.gateway.plist
Logs: /Users/jiwoongyoo/.openclaw/logs/gateway.log
Config overwrite: /Users/jiwoongyoo/.openclaw/openclaw.json (TOKEN, backup=/Users/jiwoongyoo/.openclaw/openclaw.json.bak)
Updated ~/.openclaw/openclaw.json
Backup: ~/.openclaw/openclaw.json.bak
â
â Doctor complete.
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
Nice â openclaw doctor did the right kind of âsurgical resetâ:
- re-installed the LaunchAgent (
~/Library/LaunchAgents/ai.openclaw.gateway.plist) - rewrote
~/.openclaw/openclaw.jsonand saved a backup (openclaw.json.bak) - (and it likely generated/changed your gateway token, since it mentions
TOKEN)
Now do this exact sequence to see if the gateway finally stays up:
1) Remove any âskipâ flags you previously appended (important)
Those would make the gateway start âhalf disabledâ even after doctor.
grep -n '^OPENCLAW_SKIP' ~/.openclaw/.env || true
If you see any of these, delete those lines from ~/.openclaw/.env:
OPENCLAW_SKIP_CHANNELS
OPENCLAW_SKIP_CANVAS_HOSTOPENCLAW_SKIP_BROWSER_CONTROL_SERVEROPENCLAW_SKIP_GMAIL_WATCHEROPENCLAW_SKIP_CRON
2) Start the service + check status
/opt/homebrew/bin/openclaw gateway restart
/opt/homebrew/bin/openclaw gateway status
What we want: Runtime: running and RPC probe: ok.
3) If it still says âexited immediatelyâ, paste log tails
tail -n 120 ~/.openclaw/logs/gateway.err.log
tail -n 120 ~/.openclaw/logs/gateway.log
tail -n 120 "$(ls -t /tmp/openclaw/openclaw-*.log | head -1)"
4) One more thing: kill the old shell wrapper permanently
You previously had an openclaw() shell function in ~/.zshrc. Make sure itâs removed so it doesnât come back in new terminals:
type -a openclaw
Token note (donât paste it here)
Since doctor overwrote config with TOKEN, your Control UI may need the new token. Get it locally with:
/opt/homebrew/bin/openclaw config get gateway.auth.token
Copy/paste it into the Control UI on your Mac â but donât post it in Discord.
Send back the output of openclaw gateway status after step (2).
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-02-15.log
Command: /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=19000
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=19000 (service args)
Probe target: ws://127.0.0.1:19000
Dashboard: http://127.0.0.1:19000/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 48339, state active)
Warm-up: launch agents can take a few seconds. Try again shortly.
RPC probe: failed
RPC target: ws://127.0.0.1:19000
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:19000
Source: cli --url
Config: /Users/jiwoongyoo/.openclaw/openclaw.json
Gateway port 19000 is not listening (service appears running).
Last gateway error: 2026-02-15T12:37:43.909+11:00 EXECUTE_NEW
Logs: ~/.openclaw/logs/gateway.log
Errors: ~/.openclaw/logs/gateway.err.log
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
jiwoongyoo@Jis-MacBook-Pro-2 ~ % tail -n 120 ~/.openclaw/logs/gateway.err.log
jiwoongyoo@Jis-MacBook-Pro-2 ~ % tail -n 120 ~/.openclaw/logs/gateway.log
tail -n 120 "$(ls -t /tmp/openclaw/openclaw-*.log | head -1)"
2026-02-15T01:36:40.776Z [gateway] listening on ws://127.0.0.1:19000 (PID 48204)
2026-02-15T01:36:40.777Z [gateway] listening on ws://[::1]:19000
2026-02-15T01:36:40.778Z [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
2026-02-15T01:36:40.890Z [hooks:loader] Registered hook: boot-md -> gateway:startup
2026-02-15T01:36:40.902Z [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
2026-02-15T01:36:40.903Z [hooks:loader] Registered hook: command-logger -> command
2026-02-15T01:36:40.905Z [hooks:loader] Registered hook: session-memory -> command:new
what else should I try, I'm getting sick of going in circles with no progress
jiwoongyoo@Jis-MacBook-Pro-2 ~ % rm -f ~/.openclaw/cli.json
jiwoongyoo@Jis-MacBook-Pro-2 ~ % sudo killall -9 node
Password:
No matching processes were found
jiwoongyoo@Jis-MacBook-Pro-2 ~ % /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 19000
đŚ OpenClaw 2026.2.13 (203b5bd) â iMessage green bubble energy, but for everyone.
01:44:04 [gateway] openclaw-mem0: registered (mode: platform, user: ji, graph: false, autoRecall: true, autoCapture: true)
01:44:04 [canvas] host mounted at http://127.0.0.1:19000/__openclaw__/canvas/ (root /Users/jiwoongyoo/.openclaw/canvas)
01:44:04 [heartbeat] started
01:44:04 [gateway] agent model: zai/glm-5
01:44:04 [gateway] listening on ws://127.0.0.1:19000 (PID 48929)
01:44:04 [gateway] listening on ws://[::1]:19000
01:44:04 [gateway] log file: /tmp/openclaw/openclaw-2026-02-15.log
01:44:04 [browser/service] Browser control service ready (profiles=2)
01:44:04 [hooks:loader] Registered hook: boot-md -> gateway:startup
01:44:04 [hooks:loader] Registered hook: bootstrap-extra-files -> agent:bootstrap
01:44:04 [hooks:loader] Registered hook: command-logger -> command
01:44:04 [hooks:loader] Registered hook: session-memory -> command:new
12:44:04 â ď¸ Session file not found: gateway
12:44:04 Proceeding with reset...
12:44:04 EXECUTE_NEW
jiwoongyoo@Jis-MacBook-Pro-2 ~ %
what should I do
what's happening
â