【openclaw】Gateway start blocked: set gateway.mode=local (current: unset) or pass --allow-unconfigured.

(base) someone@loaclhost ~ % openclaw gateway status

🦞 OpenClaw 2026.3.13 (61d171a) — Open source means you can see exactly how I judge your config.

│
◇
Service: LaunchAgent (loaded)
File logs: /tmp/openclaw/openclaw-2026-03-16.log
Command: /opt/homebrew/opt/node@22/bin/node /opt/homebrew/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/Library/LaunchAgents/ai.openclaw.gateway.plist
Service env: OPENCLAW_GATEWAY_PORT=18789

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.

Runtime: running (pid 23729, state active)
Warm-up: launch agents can take a few seconds. Try again shortly.
RPC probe: failed
RPC target: ws://127.0.0.1:18789
  gateway closed (1006 abnormal closure (no close frame)): no close reason
  Gateway target: ws://127.0.0.1:18789
  Source: cli --url
  Config: /Users/lisai/.openclaw/openclaw.json

Gateway port 18789 is not listening (service appears running).
Last gateway error: 2026-03-16T11:25:26.624+08: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
(base) lisai@loaclhost ~ % openclaw config set gateway.mode local

可以看到如下错误日志:
Last gateway error: 2026-03-16T11:25:26.624+08:00 Gateway start blocked: set gateway.mode=local (current: unset) or pass --allow-unconfigured.

查看日志:more /tmp/openclaw/openclaw-2026-03-16.log
核心日志只有一条:
2026-03-16T11:04:40.785+08:00 Gateway start blocked: set gateway.mode=local (current: unset) or pass --allow-unconfigured.

参考文章
解决方案:
openclaw config set gateway.mode local

具体日志如下:

{"0":"(node:9272) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.\n(Use `node --trace-deprecation ...` to show where the warning was created)","_meta":{"runtime":"node","runtimeVersion":"22.22.1","hostname":"unknown","name":"openclaw","date":"2026-03-16T03:04:42.164Z","logLevelId":5,"logLevelName":"ERROR","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:854:68","fileName":"subsystem-D2xHvZZd.js","fileNameWithLine":"subsystem-D2xHvZZd.js:854","fileColumn":"68","fileLine":"854","filePath":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js","filePathWithLine":"opt/homebrew/lib/node_modules/openclaw/dist/subsystem-D2xHvZZd.js:854"}},"time":"2026-03-16T11:04:42.166+08:00"}
{"0":"{\n  \"service\": {\n    \"label\": \"LaunchAgent\",\n    \"loaded\": true,\n    \"loadedText\": \"loaded\",\n    \"notLoadedText\": \"not loaded\",\n    \"command\": {\n      \"programArguments\": [\n        \"/opt/homebrew/opt/node@22/bin/node\",\n        \"/opt/homebrew/lib/node_modules/openclaw/dist/index.js\",\n        \"gateway\",\n        \"--port\",\n        \"18789\"\n      ],\n      \"environment\": {\n        \"OPENCLAW_GATEWAY_PORT\": \"18789\"\n      },\n      \"sourcePath\": \"/Users/lisai/Library/LaunchAgents/ai.openclaw.gateway.plist\"\n    },\n    \"runtime\": {\n      \"status\": \"running\",\n      \"state\": \"active\",\n      \"pid\": 9272,\n      \"cachedLabel\": false\n    },\n    \"configAudit\": {\n      \"ok\": true,\n      \"issues\": []\n    }\n  },\n  \"config\": {\n    \"cli\": {\n      \"path\": \"/Users/lisai/.openclaw/openclaw.json\",\n      \"exists\": true,\n      \"valid\": true\n    },\n    \"daemon\": {\n      \"path\": \"/Users/lisai/.openclaw/openclaw.json\",\n      \"exists\": true,\n      \"valid\": true\n    }\n  },\n  \"gateway\": {\n    \"bindMode\": \"loopback\",\n    \"bindHost\": \"127.0.0.1\",\n    \"port\": 18789,\n    \"portSource\": \"service args\",\n    \"probeUrl\": \"ws://127.0.0.1:18789\",\n    \"probeNote\": \"Loopback-only gateway; only local clients can connect.\"\n  },\n  \"port\": {\n    \"port\": 18789,\n    \"status\": \"free\",\n    \"listeners\": [],\n    \"hints\": []\n  },\n  \"lastError\": \"2026-03-16T11:04:40.785+08:00 Gateway start blocked: set gateway.mode=local (current: unset) or pass --allow-unconfigured.\",\n  \"rpc\": {\n
   \"ok\": false,\n    \"error\": \"gateway closed (1006 abnormal closure (no close frame)): no close reason\\nGateway target: ws://127.0.0.1:18789\\nSource: cli --url\\nConfig: /Users/lisai/.openclaw/ope
nclaw.json\",\n    \"url\": \"ws://127.0.0.1:18789\"\n  },\n  \"extraServices\": []\n}","_meta":{"runtime":"node","runtimeVersion":"22.22.1","hostname":"unknown","name":"openclaw","date":"2026-03-16T03:04:42.524Z","logLevelId":3,"logLevelName":"INFO","path":{"fullFilePath":"file:///opt/homebrew/lib/node_modules/openclaw/dist/subsystem-BDbeCphF.js:944:46","fileName":"subsystem-BDbeCphF.js","fileNameWithLine":"subsystem-BDbeCphF.js:944","fileColumn":"46","fileLine":"944","filePath":"/opt/homebrew/lib/node_modules/openclaw/dist/subsystem-BDbeCphF.js","filePathWithLine":"/opt/homebrew/lib/node_modules/openclaw/dist/subsystem-BDbeCphF.js:944","method":"console.log"}},"time":"2026-03-16T11:04:42.525+08:00"}
posted @ 2026-03-16 11:50  lisacumt  阅读(385)  评论(0)    收藏  举报