#Unable to connect to Gateway
1 messages · Page 1 of 1 (latest)
Those errors mean your ~/.openclaw/openclaw.json no longer matches the schema, so the Gateway refuses to boot (strict validation).
Two quick things to do:
- Get the basics (version + which config the service is using)
Please paste the output of:
openclaw --version
openclaw gateway status
openclaw doctor
openclaw gateway status is especially useful because it often shows Config (cli) vs Config (service) (common gotcha with systemd).
- Fast “get it booting again” fix
Edit your config (JSON5) and either remove the offending keys entirely (safe defaults will apply), or set them to known-valid values:
{
gateway: {
mode: "local",
bind: "loopback",
},
}
Notes:
gateway.modeshould be "local" unless you intentionally run in remote-client mode. (Docs callout: “Gateway start blocked: set gateway.mode=local”.)gateway.bindis an enum (e.g.loopback,lan,tailnet,custom) — it’s not an IP like0.0.0.0, which commonly triggersgateway.bind: Invalid input.
Docs reference (for the runbook + these exact signatures):
https://docs.openclaw.ai/gateway/troubleshooting
If you paste the gateway: { ... } section from your openclaw.json (just that block), I can tell you exactly what value is tripping validation.
nvalid config at /home/kyle/.openclaw/openclaw.json:\n- gateway.mode: Invalid input
- gateway.bind: Invalid input
2026.2.26
Invalid config at /home/kyle/.openclaw/openclaw.json:\n- gateway.mode: Invalid input - gateway.bind: Invalid input
🦞 OpenClaw 2026.2.26 (bc50708) — IPC, but it's your phone.
│
◇ Config ───────────────────────────────────────────────────╮
│ │
│ Config invalid; doctor will run with best-effort config. │
│ │
├────────────────────────────────────────────────────────────╯
Config invalid
File: ~/.openclaw/openclaw.json
Problem:
- gateway.mode: Invalid input
- gateway.bind: Invalid input
Run: openclaw doctor --fix
│
â—‡
Service: systemd (enabled)
File logs: /tmp/openclaw/openclaw-2026-03-02.log
Command: /usr/bin/node /home/kyle/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json (invalid)
Config issue: gateway.mode: Invalid input
Config issue: gateway.bind: Invalid input
Config (service): ~/.openclaw/openclaw.json (invalid)
Service config issue: gateway.mode: Invalid input
Service config issue: gateway.bind: Invalid input
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: stopped (state activating, sub auto-restart, last exit 1, reason 1)
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: /home/kyle/.openclaw/openclaw.json
Yep — that output is actually super clear: your Gateway is failing to start because ~/.openclaw/openclaw.json is schema-invalid (strict validation), so systemd keeps auto-restarting and you get RPC probe: failed.
1) Quick fix (recommended): let Doctor repair the config
Run exactly what it suggests:
openclaw doctor --fix
Then restart the service:
systemctl --user restart openclaw-gateway
Then re-check:
openclaw gateway status
You want Runtime: running and RPC probe: ok.
2) If Doctor can’t fix it: manually correct the two keys
Open /home/kyle/.openclaw/openclaw.json and find the gateway block. The most common cause is someone set things like gateway.bind: "0.0.0.0" or similar — but gateway.bind is an enum, not an IP.
A safe “get me booting again” gateway block is:
{
gateway: {
mode: "local",
bind: "loopback",
},
}
(Or simplest: just delete gateway.mode and gateway.bind entirely and let defaults apply.)
3) One extra gotcha (after it boots)
Your status already says: “Loopback-only gateway; only local clients can connect.”
So the dashboard URL http://127.0.0.1:18789/ must be opened on that same Linux machine (or via SSH tunnel / Tailscale) — it won’t work directly from your phone.
If you paste just the gateway: { ... } section from your openclaw.json (redact any gateway.auth.* token/password), I can point out the exact invalid values.
sorry Im not technical you'll have to tell me what to do sgep by step just tried to use openclaw doctor --fix doesnt seem tow rok
work*
No worries — we can do this “copy/paste, one step at a time”.
Right now your Gateway won’t start because the config file has two wrong values (gateway.mode + gateway.bind). We’ll set them back to safe defaults, validate, then restart the service.
Step 1) Set the two config values (copy/paste)
Run these exactly:
openclaw config set gateway.mode local
openclaw config set gateway.bind loopback
Step 2) Check if the config is valid now
openclaw config validate
- If it says valid → go to Step 3.
- If it still shows errors → paste the output here (it will tell us what else is wrong).
Step 3) Restart the gateway service
systemctl --user restart openclaw-gateway
Step 4) Confirm it’s running
openclaw gateway status
You’re aiming for:
Runtime: runningRPC probe: ok
Important note (about the Dashboard + your phone)
Your status output says “Loopback-only gateway; only local clients can connect.”
So http://127.0.0.1:18789/ only works on the same machine that runs OpenClaw (unless you use SSH tunnel / Tailscale). But let’s first get the service running again.
If you run Step 2 and it still fails, paste the openclaw config validate output and I’ll tell you the next copy/paste fix.
Nice — if “work*” means the service is back up, can you paste the output of:
openclaw gateway status
If it shows Runtime: running and RPC probe: ok, then the config issue is solved.
Next: Dashboard access (the part that usually still confuses people)
Your earlier status said loopback-only (127.0.0.1). That means:
http://127.0.0.1:18789/works only on the same Linux machine- it will not open from your phone directly
Option A (simplest): open the dashboard on the server itself (or via remote desktop).
Option B: use an SSH tunnel from your laptop:
ssh -N -L 18789:127.0.0.1:18789 user@YOUR_SERVER
then open http://127.0.0.1:18789/ on your laptop browser.
If you tell me where you’re trying to open the dashboard from (same server / your laptop / your phone), I’ll give the exact next steps.
Also: if we’re good now, please mark the solution in the thread (right-click the solution message → Apps → ✅ Mark Solution) so Answer Overflow indexes it.
openclaw config set gateway.mode local
openclaw config set gateway.bind loopback
Invalid config at /home/kyle/.openclaw/openclaw.json:\n- gateway.mode: Invalid input
- gateway.bind: Invalid input
🦞 OpenClaw 2026.2.26 (bc50708) — Gateway online—please keep hands, feet, and appendages inside the shell at all times.
│
◇ Config ───────────────────────────────────────────────────╮
│ │
│ Config invalid; doctor will run with best-effort config. │
│ │
├────────────────────────────────────────────────────────────╯
Config invalid
File: ~/.openclaw/openclaw.json
Problem:
- gateway.mode: Invalid input
- gateway.bind: Invalid input
Run: openclaw doctor --fix
Invalid config at /home/kyle/.openclaw/openclaw.json:\n- gateway.mode: Invalid input
- gateway.bind: Invalid input
🦞 OpenClaw 2026.2.26 (bc50708) — It's not "failing," it's "discovering new ways to configure the same thing wrong."
│
◇ Config ───────────────────────────────────────────────────╮
│ │
│ Config invalid; doctor will run with best-effort config. │
│ │
├────────────────────────────────────────────────────────────╯
Config invalid
File: ~/.openclaw/openclaw.json
Problem:
- gateway.mode: Invalid input
- gateway.bind: Invalid input
Run: openclaw doctor --fix
kyle@ubuntu-4gb-hel1-1:~$ openclaw config validate
Invalid config at /home/kyle/.openclaw/openclaw.json:\n- gateway.mode: Invalid input
- gateway.bind: Invalid input
openclaw config set ... isn’t taking effect because your config file is already invalid, and the config CLI won’t rewrite it while it can’t validate it. So it just keeps printing the same error.
Fastest non-technical fix: backup the broken config, replace it with a tiny known-good config, then restart.
Step 0 (optional but helps): stop the restart loop
systemctl --user stop openclaw-gateway
Step 1: make a backup copy of your current config
Copy/paste this (it creates a backup file next to it):
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.backup
Step 2: replace ~/.openclaw/openclaw.json with a minimal valid config
Copy/paste this whole block:
cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "loopback",
},
}
JSON5
Step 3: validate (should now be OK)
openclaw config validate
Step 4: start the service again
systemctl --user start openclaw-gateway
Step 5: check status
openclaw gateway status
If Step 3 still says invalid, paste the output of openclaw config validate here.
After it works (important)
This minimal config may temporarily “forget” your channel/model settings (because we replaced the file). But nothing is lost — your old config is saved as:
~/.openclaw/openclaw.json.backup
Once the gateway is up, we can either:
- re-run the setup wizard:
openclaw configure(easiest), or - copy pieces from the backup back into the new config.
Also: if you’re trying to open the dashboard from your phone, note loopback (127.0.0.1) only works on the server itself — you’ll need an SSH tunnel or Tailscale for remote access.
kyle@ubuntu-4gb-hel1-1:~$ openclaw config validate
Invalid config at /home/kyle/.openclaw/openclaw.json:\n- gateway.mode: Invalid input
- gateway.bind: Invalid input
error: too many arguments for 'config'. Expected 0 arguments but got 1.
kyle@ubuntu-4gb-hel1-1:~$ systemctl --user stop openclaw-gateway
kyle@ubuntu-4gb-hel1-1:~$ cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.backup
kyle@ubuntu-4gb-hel1-1:~$ cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "loopback",
},
}
JSON5
kyle@ubuntu-4gb-hel1-1:~$ openclaw config validate
error: too many arguments for 'config'. Expected 0 arguments but got 1.
That “too many arguments for config” message is actually good news: it means on your OpenClaw version, openclaw config is only the interactive wizard (no validate subcommand). So ignore openclaw config validate — it won’t work on 2026.2.26.
Now that you replaced the file, let’s just start the service and check status.
Step 1) Start the gateway again
Copy/paste:
systemctl --user start openclaw-gateway
Step 2) Check if the config is still “invalid”
Copy/paste:
openclaw gateway status
Step 3) If it still won’t start, grab the log
Copy/paste:
openclaw logs --follow
(If that command doesn’t work, tell me and I’ll give a “tail the file” command.)
Step 4) Sanity check: show me your config file contents
Copy/paste:
cat ~/.openclaw/openclaw.json
Paste the output of Step 2 (openclaw gateway status) here first — that will tell us immediately whether the Gateway accepted the new config or if it’s somehow still reading the old/bad one.
It worked I managed to reconnect: Questions, so would i connect my openclaw dashboard control? I was using tailscale and previously the link worked but doesn;t anymore which led to this whole issue
That happened because we “reset” your ~/.openclaw/openclaw.json to a minimal working file — which fixed the crash, but it also removed your old Tailscale settings. So now the Gateway is basically back to local-only (or at least not being exposed the same way), and your old Tailscale URL won’t work.
You’ve got two good ways to connect the Dashboard over Tailscale:
Option A (recommended): Tailscale Serve (nice HTTPS URL, safest)
- On the VPS, check Tailscale is up:
tailscale status
- Replace your config with this (copy/paste):
cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "loopback",
tailscale: { mode: "serve" },
// Optional: lets the Control UI connect via Tailscale identity (no token prompt)
auth: { allowTailscale: true },
},
}
JSON5
- Restart the gateway:
systemctl --user restart openclaw-gateway
- Now open the dashboard from your laptop/phone (on the same tailnet):
https://<magicdns>/(no:18789in Serve mode)
Docs: https://docs.openclaw.ai/gateway/tailscale
Option B: Bind directly to Tailnet IP (HTTP + requires token)
Use this if you specifically want http://<tailscale-ip>:18789/.
You’d set:
{
gateway: {
mode: "local",
bind: "tailnet",
auth: { mode: "token", token: "YOUR_TOKEN_HERE" },
},
}
…but you must have a token configured, otherwise it’ll block remote binding.
Quick question so I can tell you the exact URL
Before it broke, were you opening something like:
https://something.ts.net/(Serve), orhttp://100.x.y.z:18789/(direct tailnet bind)?
If you paste your openclaw gateway status output now, I’ll tell you which mode you’re currently in and what exact link you should use.
for Option A do I just paste that in my SSH ? the entire code: cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "loopback",
tailscale: { mode: "serve" },
// Optional: lets the Control UI connect via Tailscale identity (no token prompt)
auth: { allowTailscale: true },
},
}
JSON5
In one prompt?
Yes — paste the whole block into your SSH terminal in one go. It’s designed to be pasted exactly like that.
Here’s the step-by-step:
1) SSH into the server
You’re already doing this.
2) Paste this whole block (exactly)
cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "loopback",
tailscale: { mode: "serve" },
// Optional: lets the Control UI connect via Tailscale identity (no token prompt)
auth: { allowTailscale: true },
},
}
JSON5
What it does: it replaces your OpenClaw config file with that content.
3) Restart OpenClaw
systemctl --user restart openclaw-gateway
4) Open the dashboard URL
On your laptop/phone (connected to the same Tailscale network), open:
https://<your-server-magicdns-name>/
If you don’t know the MagicDNS name, run this on the server and paste the output:
tailscale status
(And if something goes wrong, run openclaw gateway status and paste that.)
it stlll doesn't work as in the dashboard is not connected and this is the response: Current situation: - Gateway is running on localhost:18789 (working locally)
- Your tailnet URL won't work because it's bound to 127.0.0.1 only
- If you want to fix it later, just run: openclaw gateway restart with the right flags
Let it be if you don't need external access.
anything
We're all set - no changes made, your gateway is running on localhost:18789 and that's fine.
openclaw gateway status The fix is actually: openclaw gateway --bind tailnet
Yep — that message is basically saying: your Gateway is only reachable on the server itself (127.0.0.1), so your old Tailscale link won’t work until you expose it again.
There are 2 different “Tailscale ways”:
- Tailscale Serve → you open
https://<magicdns>/(no:18789), and the Gateway can still be bound to loopback. - Bind to tailnet (what your agent is suggesting) → you open
http://<tailscale-ip>:18789/(orhttp://<magicdns>:18789/), but you must set an auth token/password.
From your description (“previously the link worked”), you very likely used the bind tailnet style. Here’s the simplest step-by-step to restore that:
Restore “open dashboard via Tailscale IP:18789” (bind tailnet)
1) On the server, generate a Gateway token (DON’T paste it into Discord)
openssl rand -hex 32
Copy the long hex string it prints somewhere safe.
2) Put that token into your OpenClaw config (paste this whole block)
Replace PASTE_TOKEN_HERE with your token:
cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "tailnet",
auth: {
mode: "token",
token: "PASTE_TOKEN_HERE",
},
},
}
JSON5
3) Restart the gateway service
systemctl --user restart openclaw-gateway
4) Get your Tailscale IP / name
tailscale status
5) Open the dashboard from your laptop/phone (on the same tailnet)
Open in browser:
http://<tailscale-ip>:18789/
If the dashboard asks for a token: paste the same token you generated.
If you paste your openclaw gateway status output now, I can tell you exactly which URL you should use (MagicDNS vs tailnet IP) and whether it’s actually listening on tailnet.
where do i generate a gateway token in Tailscale?
You don’t generate the Gateway token in Tailscale — it’s an OpenClaw token (separate from Tailscale). Tailscale just gives you the private network connection.
Generate a Gateway token (on the server, in SSH)
Option 1 (easiest):
openclaw doctor --generate-gateway-token
openclaw gateway restart
Option 2 (manual, also fine):
- Generate a random token:
openssl rand -hex 32
- Put it into your OpenClaw config as
gateway.auth.token(I can give you the exact paste block again if you want).
Then how you use it
When you open the dashboard via Tailscale (tailnet bind), the Control UI will ask for auth. You paste that OpenClaw gateway token into the dashboard’s Gateway Token field.
Docs (Tailscale modes + auth): https://docs.openclaw.ai/gateway/tailscale
If you paste your current openclaw gateway status output, I’ll tell you whether you should use Serve (https://...) or tailnet bind (http://100.x.x.x:18789).
is this okay to proceed:
- Gateway service OPENCLAW_GATEWAY_TOKEN does not match gateway.auth.token in │
│ openclaw.json (service token is stale)
Yes — that warning is exactly what you need to fix, and it’s safe to proceed.
It means you currently have two different tokens:
- one token stored in the systemd service environment (
OPENCLAW_GATEWAY_TOKEN) - a different token stored in your config file (
gateway.auth.tokenin~/.openclaw/openclaw.json)
When those don’t match, the Dashboard will keep saying “unauthorized” / won’t connect.
Fix (easy): make them match using Doctor
On the server (SSH), run:
openclaw doctor --fix
systemctl --user restart openclaw-gateway
Then check:
openclaw gateway status
If you want the “manual” fix instead
Tell me which one you prefer to keep:
- Use the service token (OPENCLAW_GATEWAY_TOKEN), or
- Use the config token (gateway.auth.token)
…and I’ll give you the exact copy/paste commands for that option.
Also: don’t paste the actual token value into Discord (keep it private).
I've restatred the gateway but i dont know which is my token?
The “token” here is not a Tailscale token — it’s your OpenClaw Gateway auth token.
Easiest way to find the right token (no guessing)
On the server (SSH), run:
openclaw dashboard --no-open
It will print the dashboard URL using your current auth. If it includes a #token=... part, that’s the token you need (copy it into the browser / Control UI).
Don’t paste that URL/token into Discord.
If you want to see what systemd is using (also don’t paste output here)
systemctl --user show openclaw-gateway -p Environment
Look for OPENCLAW_GATEWAY_TOKEN=...
If Doctor warned “service token is stale”
That means your systemd token and your config token don’t match, so the UI can’t auth reliably.
Fast fix: set a fresh token and make the service use it:
- Generate a new token:
openssl rand -hex 32
(copy the output somewhere safe)
- Reinstall the service with that token (paste your token in):
openclaw gateway install --force --token "PASTE_TOKEN_HERE"
openclaw gateway restart
Then open the dashboard again (via your Tailscale URL / tailnet IP) and paste that same token into Gateway Token in the Control UI.
If you tell me whether you’re using Serve (https://…) or tailnet bind (http://100.x.x.x:18789), I can tell you the exact URL you should be opening.
is this the new token it will say config overwrite XXXXXXX -> XXXXXXXX (is this the new token?)
Yes — when Doctor (or install) says something like:
config overwrite <old> -> <new>
…the value on the right-hand side (-> <new>) is the new token it wrote.
Two important bits:
- That token is your Gateway token (the one you paste into the Control UI “Gateway Token” field when connecting remotely).
- Make sure the service and config match after this. The easiest check is:
openclaw gateway status
If it no longer warns that OPENCLAW_GATEWAY_TOKEN is stale/mismatched, you’re good.
And reminder: don’t paste the actual token into Discord.
there's no warning, what next
Cool — no warning means the service token and config token now match, so auth is no longer fighting itself.
Next step depends on how you want to reach the dashboard over Tailscale:
1) First: confirm what the gateway is listening on
Run on the server (SSH) and paste the output (it’s safe — it won’t print the token):
openclaw gateway status
Look for the line that says something like bind=...:
If it says bind=tailnet
Then from your laptop/phone (on the same tailnet) open:
http://<tailscale-ip>:18789/(orhttp://<magicdns>:18789/)
If the Control UI asks for a token, paste the token you just updated (the “new” one).
If it says bind=loopback (127.0.0.1)
Then it’s still local-only. You have two choices:
A) Use Tailscale Serve (recommended HTTPS URL):
- Make sure config has
tailscale: { mode: "serve" } - Restart gateway
- Open:
https://<magicdns>/
B) Switch to tailnet bind:
- Set
bind: "tailnet"in config - Restart gateway
- Open:
http://<tailscale-ip>:18789/
2) Get your tailnet address
On the server:
tailscale status
That shows your server’s MagicDNS name and 100.x IP.
Paste openclaw gateway status and I’ll tell you the exact URL to open next.
Service: systemd (enabled)
File logs: /tmp/openclaw/openclaw-2026-03-02.log
Command: /usr/bin/node /home/kyle/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 253297, state active, sub running, last exit 0, reason 0)
RPC probe: ok
Listening: 127.0.0.1:18789
You’re 100% healthy now (RPC probe: ok) — but you’re still in loopback mode, so it will only work on the server itself. That’s why your Tailscale dashboard link still won’t connect.
To use the dashboard over Tailscale again, you need to expose the gateway. Easiest is “bind to tailnet”.
Option 1 (simplest): bind to Tailnet + use your token
Step 1) Edit config to bind to tailnet (copy/paste)
cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "tailnet",
auth: { mode: "token" },
},
}
JSON5
Step 2) Restart gateway
systemctl --user restart openclaw-gateway
Step 3) Find your server’s Tailscale IP
tailscale status
Step 4) Open dashboard from your laptop/phone (on Tailnet)
Open:
http://<tailscale-ip>:18789/
When it asks for Gateway Token, paste the token you just fixed (don’t post it in Discord).
Option 2 (nicer URL + HTTPS): Tailscale Serve
If you’d rather use https://<magicdns>/ (no port), we can do Serve instead — but since your status currently says loopback and nothing about Serve, you probably weren’t using Serve before.
Tell me which you prefer:
- A)
http://100.x.x.x:18789/(tailnet bind) — quickest - B)
https://something.ts.net/(Serve) — nicer URL/HTTPS
Also, once you switch to bind: "tailnet", run openclaw gateway status again — it should no longer say “Loopback-only”.
I absolutely dont understand didn't we do this just now? how do I do the bind? that seems to be the easiest
Yep — we fixed the crash earlier by putting the gateway back into safe local-only mode (bind=loopback). That’s why your openclaw gateway status currently says:
bind=loopback (127.0.0.1)→ only works on the server itself
To make the Dashboard reachable over Tailscale again, you now need to change that one word to tailnet.
Do the bind change (easiest way)
1) SSH into the server, then open the config editor
nano ~/.openclaw/openclaw.json
2) Find this line and change it
Change:
bind: "loopback",
to:
bind: "tailnet",
Also make sure you have auth enabled (this is important). If you don’t see an auth block, add this inside gateway: { ... }:
auth: { mode: "token" },
When you’re done, the file should look roughly like:
{
gateway: {
mode: "local",
bind: "tailnet",
auth: { mode: "token" },
},
}
Save + exit nano:
- Press
Ctrl + O, thenEnter(save) - Press
Ctrl + X(exit)
3) Restart the gateway
systemctl --user restart openclaw-gateway
4) Confirm it worked
openclaw gateway status
You want it to say bind=tailnet (instead of loopback).
Now open the dashboard over Tailscale
On the server, get its tailnet IP:
tailscale ip -4
Then on your laptop/phone (connected to Tailscale) open:
http://<that-100.x.x.x-ip>:18789/
If the dashboard asks for a token and you’re not sure which one: run on the server:
openclaw dashboard --no-open
It prints the correct URL/token for your current setup. (Don’t paste the token into Discord.)
If you paste your updated openclaw gateway status after the restart, I’ll tell you exactly what URL to use.
wait can I just confirm the new token is " config overwrite XXXXXXX -> XXXXXXXX (is this the new token?)
To paste this in there?
Yes: in a line like
config overwrite OLD -> NEW
the NEW value (the one after the ->) is the new token.
But don’t paste it into Discord. Paste it only on your server / into your dashboard.
Where you paste it (2 common places)
A) Into the config file (~/.openclaw/openclaw.json) as:
gateway: {
auth: {
mode: "token",
token: "PASTE_NEW_TOKEN_HERE"
}
}
B) Or into the Dashboard UI when it asks for Gateway Token.
Quick check (safe)
If you want to confirm the token the config currently has (without editing anything), run on the server:
openclaw dashboard --no-open
It prints the dashboard URL it expects you to use (often includes the token in the URL fragment). Again: keep that private.
If you want, paste your config contents with the token redacted (replace it with ***) and I’ll tell you if it’s placed in the right spot.
I dont think that was right: gateway connect failed: Error: unauthorized: gateway token mismatch (provide gateway auth token)──────────────────────────────────────────────────────────────────────────────────────────────────────────
That error means you reached the gateway, but the token you’re using in the Dashboard doesn’t match the token the Gateway expects.
Most common cause: your browser/dashboard has the old token saved, but you rotated it during the fixes.
Fix it (Dashboard side)
- Open your dashboard URL again (over Tailscale):
- if you’re using tailnet bind:
http://<tailscale-ip>:18789/
-
In the Control UI, go to:
Control → Overview → Gateway Access -
In the Gateway Token box:
- delete whatever is there
- paste the new token (the one shown after the
->inconfig overwrite OLD -> NEW)
Then click Connect.
Tip: if you can’t find where it’s saving the old token, open the dashboard in a private/incognito window and paste the token there.
If that error was from the CLI (not the browser)
If you ran a command using a custom URL, you must pass the token explicitly, e.g.
openclaw gateway status --url ws://<tailscale-ip>:18789 --token "<YOUR_TOKEN>"
(Again: don’t paste the token into Discord.)
If you tell me: was this error from the web dashboard or from an openclaw command in SSH? That determines which of the two fixes applies.
My dashboard can't even connect now the page isnt working. How do i resolve this?
Your openclaw gateway status shows the key problem:
Listening: 127.0.0.1:18789 (loopback)
Only local clients can connect
So from your laptop/phone, the dashboard page will look “dead” because it’s not reachable over the network.
Here’s the easiest “bind to Tailscale” path, step by step.
1) Get your current Gateway token (on the server)
In SSH, run:
openclaw dashboard --no-open
It prints a URL. If you see #token=... in it, that is your token. Copy it somewhere private (don’t paste it in Discord).
2) Switch the Gateway to Tailnet bind (so other tailnet devices can reach it)
In SSH, paste this block, then replace PASTE_TOKEN_HERE with the token you copied:
cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "tailnet",
auth: {
mode: "token",
token: "PASTE_TOKEN_HERE",
},
},
}
JSON5
3) Restart the gateway
systemctl --user restart openclaw-gateway
4) Find your server’s Tailscale IP
tailscale ip -4
5) Open the dashboard from your laptop/phone (with Tailscale ON)
Open this in your browser (note it’s http, not https):
http://<100.x.x.x>:18789/
If it asks for a token, paste the same token.
Quick sanity check
After restart, run:
openclaw gateway status
You should no longer see bind=loopback. If you still do, paste the new openclaw gateway status output (no token included there).
I managed to do that but my url still doens;t work and when i typed gateway status:
SECURITY ERROR: Gateway URL "ws://100.118.245.26:18789" uses plaintext ws:// to a non-loopback address.
Both credentials and chat data would be exposed to network interception.
Source: cli --url
Config: /home/kyle/.openclaw/openclaw.json
Fix: Use wss:// for remote gateway URLs.
Safe remote access defaults:
- keep gateway.bind=loopback and use an SSH tunnel (ssh -N -L 18789:127.0.0.1:18789 user@gateway-host)
- or use Tailscale Serve/Funnel for HTTPS remote access
That message is coming from the CLI, not your gateway being “down”.
OpenClaw is refusing --url ws://100.x.x.x:18789 because it’s plaintext WebSocket to a non-local address (your gateway token + chat data could be sniffed). So the CLI blocks it on purpose.
You’ve got two “safe” ways to get the Dashboard working over Tailscale:
Option A (recommended): Tailscale Serve (HTTPS + wss, easiest)
On the server (SSH), replace your config with:
cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "loopback",
tailscale: { mode: "serve" },
auth: { allowTailscale: true },
},
}
JSON5
Restart:
systemctl --user restart openclaw-gateway
Now on your laptop/phone (with Tailscale on), open:
https://<your-server-magicdns>/
To find the MagicDNS name, run on the server:
tailscale status
Docs: https://docs.openclaw.ai/gateway/tailscale
Option B: SSH tunnel (also safe)
From your laptop:
ssh -N -L 18789:127.0.0.1:18789 kyle@<server>
Then open locally:
http://127.0.0.1:18789/
Important
Don’t try to use openclaw ... --url ws://100.x.x.x:18789 anymore — that’s what triggers the security error. If you want, paste what URL you’re trying to open in the browser (just the host/port, not any token), and I’ll tell you which option matches it.
Uhm i think lets forget it i've been doing this for an hour. I'll just try again tomorrrow. How do I atleast ensure my openclaw is still working?
To sanity‑check that OpenClaw is still working (without touching the Tailscale/dashboard stuff), do these on the server over SSH:
1) Check the gateway is up
openclaw gateway status
You want:
Runtime: runningRPC probe: ok
2) Tail logs for 10–20 seconds (look for errors/restart loops)
openclaw logs --follow
Press Ctrl+C to stop.
3) (Optional) Quick overall status
openclaw status
If gateway status is running + probe ok, your OpenClaw is basically fine — the dashboard access was just the remote/Tailscale part.
If you want, paste just the bottom part of openclaw gateway status tomorrow (Runtime + RPC probe + bind), and we’ll finish the remote access in 2–3 steps. Also, if we did solve the original “invalid config” crash, please mark the solution in the thread so it’s indexed.
Help me fix this first, I dont need to get access to my dashboard but I still want to be able to bring my gateway back online
Runtime: stopped (state activating, sub auto-restart, last exit 1, reason 1)
RPC probe: failed
Got it — forget the dashboard for now. Let’s just get the gateway service running again.
“Rescue” steps (puts you back to a safe local-only gateway)
1) Stop the restart loop
Run on the server (SSH):
systemctl --user stop openclaw-gateway
2) Backup your current config (so nothing is lost)
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak
3) Replace the config with a minimal known-good one
Paste this whole block:
cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "loopback",
},
}
JSON5
4) Start the service again
systemctl --user start openclaw-gateway
5) Check status
openclaw gateway status
If you now see Runtime: running and RPC probe: ok → you’re back online (locally).
If it’s STILL stopped after that
Paste the output of these two commands (they won’t include your token):
openclaw gateway status
journalctl --user -u openclaw-gateway -n 120 --no-pager
That log snippet will usually say exactly why it exits (bad config, port in use, missing auth for non-loopback bind, etc.).
Great thanks! Let's pick this up tomorrow. I'll just leave the case here?
Yep — you can leave it here and pick it up tomorrow.
Before you log off tonight, do one quick check so you know it’ll still be fine:
openclaw gateway status
If it shows Runtime: running and RPC probe: ok, you’re good.
Tomorrow, when you’re back, paste that openclaw gateway status output and we’ll continue from a clean starting point.
Also if the “minimal config” fix got you back online, please mark the solution in the thread (right‑click the solution message → Apps → ✅ Mark Solution). This helps others find it later.
yeap its running but my telegram bot isn't how do i get it back online
That’s expected after the “minimal config” rescue: it brought the Gateway back, but it also removed your Telegram channel settings, so the Telegram bot won’t start.
Step 1) Check if Telegram is configured at all
On the server (SSH), run:
openclaw channels status --probe
If you don’t see Telegram in the list (or it says disabled / missing token), do Step 2.
Step 2) Re-add Telegram the easy way (wizard)
On the server (SSH), run:
openclaw configure --section channels
In the wizard:
- choose Telegram
- paste your BotFather token
- keep DM policy as pairing (default is fine)
- save/finish
Then restart:
systemctl --user restart openclaw-gateway
Step 3) Approve pairing (otherwise it won’t reply in DMs)
- DM your Telegram bot from your phone.
- You should receive a pairing code in Telegram.
- On the server, run:
openclaw pairing list telegram
openclaw pairing approve telegram <CODE>
(Replace <CODE> with the code you got in Telegram.)
Step 4) Confirm it’s online
On the server:
openclaw channels status --probe
If Telegram still won’t come online, paste the Telegram lines from:
openclaw logs --follow
(You can Ctrl+C after ~10 seconds; and don’t paste your bot token.)
local or remote?
For Telegram, you want the Gateway in local mode.
- Local = the Gateway runs on this server and connects out to Telegram (normal setup).
- Remote = this machine is just a client connecting to a different Gateway somewhere else (not what you want here).
So in the config/wizard choose Local.
Quick check: your openclaw gateway status earlier showed Gateway: bind=loopback ... which also implies you’re running a local gateway on this box already.
Got it thanks! Let's try this tomorrow! Thanks!
Sounds good.
Before you stop for today, do one quick “all good” check on the server:
openclaw gateway status
If it shows Runtime: running + RPC probe: ok, you’re safe.
Tomorrow we’ll:
- run
openclaw configure --section channels - add your Telegram BotFather token
- restart the gateway
- approve the pairing code from Telegram
If the “minimal config” step got your gateway back online, please mark the solution in the thread (right‑click the solution message → Apps → ✅ Mark Solution) so others can find it.
Hello, let's try and bring my dashboard online
To get the Dashboard working from another device (phone/laptop) again, the easiest + safest path is Tailscale Serve. It keeps your gateway bound to 127.0.0.1 but exposes it over HTTPS on your tailnet.
Step 0 (on the server via SSH): confirm what you have now
Run:
openclaw gateway status
If it says bind=loopback (127.0.0.1), remote dashboard won’t work until you do Serve (or an SSH tunnel).
Option A (recommended): Tailscale Serve (HTTPS)
1) On the server: make sure Tailscale is up
tailscale status
You should see your machine listed (and ideally a MagicDNS name like something.tailnet-xyz.ts.net).
2) On the server: edit your OpenClaw config
Open:
nano ~/.openclaw/openclaw.json
Under gateway: { ... }, set it to this shape (you can copy/paste inside nano):
gateway: {
mode: "local",
bind: "loopback",
tailscale: { mode: "serve" },
auth: { allowTailscale: true },
},
Save/exit: Ctrl+O, Enter, then Ctrl+X.
3) Restart the gateway service
systemctl --user restart openclaw-gateway
4) Open the dashboard from your phone/laptop (on Tailscale)
Open:
https://<your-magicdns-name>/
If it still asks for a token, run this on the server (don’t paste the token here):
openclaw dashboard --no-open
…and use the token it indicates.
Option B (also safe): SSH tunnel (no Tailscale needed)
From your laptop:
ssh -N -L 18789:127.0.0.1:18789 kyle@<your-server>
Then open:
http://127.0.0.1:18789/
If you paste the top half of tailscale status (just the line showing your server’s MagicDNS name) and your latest openclaw gateway status (safe), I’ll tell you the exact URL you should be opening.
I don't understnad your step. regarding under gateway when you say set it to this shape, it is already gateway: bind =loopback (xxx.x.x.x)), port = xxxxxx
What do you mean
What you’re looking at (openclaw gateway status) is status output, not your config file.
When I said “set it to this shape”, I meant: edit ~/.openclaw/openclaw.json and make sure the gateway { ... } section contains the Tailscale settings.
Key idea
With Tailscale Serve, your gateway will still say bind=loopback in gateway status — that’s normal. Serve exposes it over HTTPS without binding the gateway to the network.
Do this (without deleting your other config like Telegram)
1) Open your config file
On the server (SSH):
nano ~/.openclaw/openclaw.json
2) Find the gateway: { ... } block
It will look something like this (yours may have more keys):
{
gateway: {
mode: "local",
bind: "loopback",
// ...
},
// other stuff like channels.telegram, etc...
}
3) Add these lines inside gateway: { ... }
Add:
tailscale: { mode: "serve" },
auth: { allowTailscale: true },
So it becomes roughly:
gateway: {
mode: "local",
bind: "loopback",
tailscale: { mode: "serve" },
auth: { allowTailscale: true },
},
Save + exit nano:
Ctrl + O, EnterCtrl + X
4) Restart the gateway
systemctl --user restart openclaw-gateway
5) Open the dashboard
Run this to find your MagicDNS name:
tailscale status
Then on your laptop/phone (on Tailscale) open:
https://<your-magicdns-name>/
If you paste your cat ~/.openclaw/openclaw.json with any tokens/passwords replaced by ***, I can point to the exact place to insert those two lines.
Can you guide me one step by one step pasying everything doesnt help
Yep. One step at a time. Do Step 1 only, then tell me what you see.
Step 1 — open your config file
On the server (SSH), run:
nano ~/.openclaw/openclaw.json
You should now see a file open in the terminal.
Reply with what happens:
- Do you see a file with text?
- Or does it say “No such file or directory” / permission denied / blank file?
Okay I see a file with text with tge gateway, mode and bind set to local and loopback, whag do i change it to
Great. Don’t change mode or bind.
We’re only going to add two lines inside the gateway: { ... } section.
Step 2 — add these 2 lines
Inside the gateway: { ... } block, add:
tailscale: { mode: "serve" },
auth: { allowTailscale: true },
So your gateway block should look like this (example):
gateway: {
mode: "local",
bind: "loopback",
tailscale: { mode: "serve" },
auth: { allowTailscale: true },
},
Step 3 — save and exit nano
- Press Ctrl + O (save)
- Press Enter
- Press Ctrl + X (exit)
Tell me when you’re out of nano (back at the normal command prompt).
that means you want me to add tailscale and auth. do i just copy and paste exactly that ?
Yes — copy/paste exactly those two lines.
Just make sure you paste them inside the gateway: { ... } section (between the { and the }), like this:
gateway: {
mode: "local",
bind: "loopback",
tailscale: { mode: "serve" },
auth: { allowTailscale: true },
},
After you paste, do:
- Ctrl + O → Enter (save)
- Ctrl + X (exit)
Tell me once you’re back at the normal SSH prompt.
okay i have pasted it
Perfect.
Step 4 — save + exit nano
- Press Ctrl + O
- Press Enter
- Press Ctrl + X
Tell me when you’re back at the normal SSH prompt (you should see something like kyle@...:~$).
yes
Great.
Step 5 — restart the gateway
Run this on the server:
systemctl --user restart openclaw-gateway
Tell me if it shows any error, or if it just returns to the prompt.
(Then we’ll do Step 6 to get the Tailscale URL.)
Gateway is running smoothly - up on port 18789 and probing successfully. It's configured to localhost-only right now, which is exactly what you want for development. The service is healthy (PID
256338) and all systems check out.
gateway disconnected: closed | idle
Good news: that output means the Gateway itself is healthy again.
The confusing part: even with Tailscale Serve, openclaw gateway status will still say “localhost-only / bind=loopback”. That’s normal — Serve is a separate Tailscale layer that forwards HTTPS → 127.0.0.1:18789.
Let’s check whether Serve is actually enabled.
Step 1 (server / SSH): check Tailscale + Serve status
Run these and paste the output (it’s safe):
tailscale status
tailscale serve status
- If
tailscale serve statuserrors with permissions, run:
sudo tailscale serve status
Step 2 (if Serve is enabled): open the right URL
From your laptop/phone (on Tailscale), open:
https://<your-server-magicdns-name>/
(The MagicDNS name is shown in tailscale status.)
If tailscale serve status shows NOTHING is being served
Then OpenClaw didn’t manage to configure Serve. We’ll fix that next, but first paste the outputs from Step 1 so I can tell you the exact next command (and whether you need sudo on this machine).
(Also, the gateway disconnected: closed | idle line is usually just the CLI connection closing — not a crash.)
Where do i get the magic dns link from
On your server (SSH), run this:
tailscale status
In the output, look for a hostname that ends with .ts.net — that’s your MagicDNS name.
Example of what you’re looking for (yours will be different):
ubuntu-4gb-hel1-1.tailnet-name.ts.net
That is the link you’ll use for Serve:
https://ubuntu-4gb-hel1-1.tailnet-name.ts.net/
If you paste the output of tailscale status (it’s fine), I can point to the exact line and URL.
yea it doesnt work
Ok — “doesn’t work” can mean 3 totally different things (DNS, Serve not actually enabled, or auth). Let’s pinpoint which one with two commands on the server.
Step 1 (on the server / SSH): confirm Tailscale + get the MagicDNS name
Run:
sudo tailscale status
In the output, find this server’s line and copy just the hostname ending in .ts.net (you can paste that hostname here).
Step 2 (on the server / SSH): check if Serve is actually serving anything
Run:
sudo tailscale serve status
If it shows nothing is being served
Then Serve isn’t enabled yet (OpenClaw didn’t manage to configure it). You can enable it manually:
sudo tailscale serve https / http://127.0.0.1:18789
sudo tailscale serve status
Step 3 (on your laptop/phone, with Tailscale ON)
Open exactly (note: https://, no port):
https://<that .ts.net hostname>/
Reply with:
- what you see when you open the URL (DNS error / can’t connect / unauthorized), and
- the output of
sudo tailscale serve status(safe to paste; don’t paste any tokens).
After pasting sudo tailscale i dont see any thing that ends with .ts.net, I only see 3 different IPs with a string of numbers
Got it — you’re not doing anything wrong. If tailscale status shows only 100.x IPs and no .ts.net name, that usually means MagicDNS isn’t enabled on your Tailscale network, so there’s no “MagicDNS link” to use.
We can still bring the dashboard online using the Tailscale IP (easiest, no MagicDNS needed).
Step 1 (on the server / SSH): get your Tailscale IP
Run:
tailscale ip -4
You’ll get something like 100.xxx.yyy.zzz. Keep it.
Step 2 (on the server / SSH): change OpenClaw to bind to tailnet
Run:
nano ~/.openclaw/openclaw.json
Inside the gateway: { ... } block:
- Change:
bind: "loopback",
to:
bind: "tailnet",
- Make sure you have token auth (add this if missing):
auth: { mode: "token" },
If you currently have the Serve lines (tailscale: { mode: "serve" } / allowTailscale), you can remove them for now to keep it simple.
So your gateway block should look like:
gateway: {
mode: "local",
bind: "tailnet",
auth: { mode: "token" },
},
Save + exit: Ctrl+O, Enter, Ctrl+X
Step 3: restart the gateway
systemctl --user restart openclaw-gateway
Step 4 (from your phone/laptop, with Tailscale ON): open the dashboard
Open in your browser:
http://<your-100.x.x.x-ip>:18789/
If it asks for a token and you’re not sure what it is, on the server run (keep it private):
openclaw dashboard --no-open
It will show you the token it expects.
If you want the nicer https://something.ts.net/ URL later, we can do that too — but you’ll need to enable MagicDNS in the Tailscale admin console first.
For this part" "gateway: {
mode: "local",
bind: "tailnet",
auth: { mode: "token" },
},"
Do you mean for me to input the token or jusy paste this. Currently i have this:
"gateway": {
"mode": "local",
"bind": "tailnet"
tailscale: { mode: "serve" },
auth: { allowTailscale: true },"
"
You’ve got the right idea, but your current block is not valid JSON5 (missing commas + mixing two different modes).
You need to pick ONE of these:
- Mode 1: tailnet bind (use
http://100.x.x.x:18789/+ token) - Mode 2: tailscale serve (use
https://…+ MagicDNS)
Since you don’t have a .ts.net / MagicDNS name, let’s do tailnet bind and remove the tailscale: { mode: "serve" } lines.
What to put in your config (tailnet bind)
In nano ~/.openclaw/openclaw.json, replace your current gateway: { ... } block with exactly this:
gateway: {
mode: "local",
bind: "tailnet",
auth: {
mode: "token",
token: "PASTE_YOUR_TOKEN_HERE",
},
},
Do you need to paste the token?
Yes — for this approach, you should paste it there (that token is what you’ll also paste into the dashboard when it asks).
If you don’t know your token, generate a new one on the server:
openssl rand -hex 32
Copy the output and use it for token: "..." above. (Don’t paste the token into Discord.)
After you edit
- Save/exit nano:
Ctrl+O, Enter,Ctrl+X - Restart gateway:
systemctl --user restart openclaw-gateway
Then open:
http://<your-tailscale-ip>:18789/
If you want, paste your config with the token replaced by ***, and I’ll tell you if the commas/braces are correct before you restart.
can you do one thing at at a time please.
Yep.
Step 1
On your server (SSH) run this one command:
openclaw gateway status
Copy/paste the output here (it’s safe — no tokens). Then I’ll tell you the single next step.
Is this correct:
},
"gateway": {
"mode": "local",
"bind": "tailnet",
auth: {
mode: "token",
token: "XXXXXXXXXX",
},
},
I can’t tell yet — your message got cut off after “Is this correct:”.
Please paste the output of:
openclaw gateway status
(or paste the exact lines you’re unsure about). It won’t include secrets, but if you see any token/password, redact it with *** before posting.
},
"gateway": {
"mode": "local",
"bind": "tailnet",
auth: {
mode: "token",
token: "XXXXXXXXXX",
},
},
Almost — the idea is right, but I want you to make the gateway block look exactly like this (JSON5 style), because your pasted snippet has mixed quoting/indentation and it’s easy to end up with a broken file.
Step 1 (in nano ~/.openclaw/openclaw.json)
Find your gateway section and replace it with exactly this (keep your real token, don’t post it here):
gateway: {
mode: "local",
bind: "tailnet",
auth: {
mode: "token",
token: "XXXXXXXXXX",
},
},
Important:
- This must be inside the outer top-level
{ ... }of the file. - Make sure the commas are exactly like above.
When you’ve done that, save + exit (Ctrl+O, Enter, Ctrl+X) and tell me “saved”.
can I check are you sure i dont need to "Gateway"? all the other text inside there have " " and the colour is different
Yep — do not change it to Gateway.
The config key is gateway (all lowercase). If you write Gateway, OpenClaw will treat it as an unknown key and your config can fail validation.
About the quotes + colors:
- Quotes are optional in JSON5.
- The different color is just your editor’s syntax highlighting — it doesn’t matter.
If you want it to match the rest of your file that uses quotes, you can write it like this instead (also valid):
"gateway": {
"mode": "local",
"bind": "tailnet",
"auth": {
"mode": "token",
"token": "XXXXXXXXXX"
}
},
Pick one style, but keep the key name gateway (lowercase). Then save (Ctrl+O, Enter) and exit (Ctrl+X).
okay I've done that and Cmd O, Enter, Cmd X. What next
Nice.
Next step (just one thing):
On the server (SSH), run:
systemctl --user restart openclaw-gateway
Tell me if it prints any error, or if it just goes back to the prompt.
no error so far nothing changed
Good.
Next step (one command)
Run this on the server and paste the output:
openclaw gateway status
We’re looking to see whether it now says bind=tailnet (instead of loopback) and whether RPC probe: ok.
Runtime: stopped (state activating, sub auto-restart, last exit 1, reason 1)
RPC probe: failed
Got it — the service is crashing on startup. Next we need the exact error message from systemd.
Next step (one command)
Run this on the server and paste the output:
journalctl --user -u openclaw-gateway -n 120 --no-pager
That log will tell us whether it’s:
- config parse/validation error,
- “refusing to bind without auth”,
- “can’t bind tailnet”,
- port conflict,
etc.
I cant upload all the files but :
Mar 03 14:21:53 ubuntu-4gb-hel1-1 node[16794]: │
Mar 03 14:21:53 ubuntu-4gb-hel1-1 node[16794]: ◇ Config ───────────────────────────────────────────────────╮
Mar 03 14:21:53 ubuntu-4gb-hel1-1 node[16794]: │ │
Mar 03 14:21:53 ubuntu-4gb-hel1-1 node[16794]: │ Config invalid; doctor will run with best-effort config. │
Mar 03 14:21:53 ubuntu-4gb-hel1-1 node[16794]: │ │
Mar 03 14:21:53 ubuntu-4gb-hel1-1 node[16794]: ├────────────────────────────────────────────────────────────╯
Mar 03 14:21:54 ubuntu-4gb-hel1-1 node[16794]: Config invalid
Mar 03 14:21:54 ubuntu-4gb-hel1-1 node[16794]: File: ~/.openclaw/openclaw.json
Mar 03 14:21:54 ubuntu-4gb-hel1-1 node[16794]: Problem:
Mar 03 14:21:54 ubuntu-4gb-hel1-1 node[16794]: - <root>: JSON5 parse failed: SyntaxError: JSON5: invalid character ',' at 32:4
Mar 03 14:21:54 ubuntu-4gb-hel1-1 node[16794]: Run: openclaw doctor --fix
Mar 03 14:21:54 ubuntu-4gb-hel1-1 systemd[821]: openclaw-gateway.service: Main process exited, code=exited, status=1/FAILURE
Mar 03 14:21:54 ubuntu-4gb-hel1-1 systemd[821]: openclaw-gateway.service: Failed with result 'exit-code'.
Mar 03 14:21:54 ubuntu-4gb-hel1-1 systemd[821]: openclaw-gateway.service: Consumed 2.590s CPU time.
Mar 03 14:21:59 ubuntu-4gb-hel1-1 systemd[821]: openclaw-gateway.service: Scheduled restart job, restart counter is at 1130.
Mar 03 14:21:59 ubuntu-4gb-hel1-1 systemd[821]: Started openclaw-gateway.service - OpenClaw Gateway (v2026.2.26).
Perfect — we have the exact reason: your ~/.openclaw/openclaw.json has a syntax error:
JSON5 parse failed … invalid character ',' at 32:4
That means there’s a stray comma around line 32 and the gateway will keep crash‑looping until we remove it.
Step 1 (do this now)
Stop the restart loop:
systemctl --user stop openclaw-gateway
Reply “stopped” when that’s done, and then I’ll walk you through fixing line 32 in nano (we’ll jump directly to 32,4 and delete the comma).
How do I know when its done? I don't understand
When you run:
systemctl --user stop openclaw-gateway
…it usually prints nothing. It’s “done” when you see your normal prompt again (like kyle@...:~$).
To confirm (one simple check)
Run:
systemctl --user is-active openclaw-gateway
If it prints inactive (or failed), the stop worked.
Tell me what it prints.
Nice.
Step 2
Open the config file:
nano ~/.openclaw/openclaw.json
Step 3 (jump straight to the error location)
Inside nano, press:
- Ctrl + _ (that’s “Control + underscore”, nano will ask for a line number)
- Type:
32,4 - Press Enter
You should land on the exact spot where the bad comma is.
Tell me what you see on that line (you can describe it in words — don’t paste your token).
That’s normal — it won’t print anything into the chat/terminal output.
Two quick checks:
Are you inside nano right now?
You should see the editor screen with text, and along the bottom something like:
^G Help ^O Write Out ^X Exit
If you don’t see that, tell me what you do see.
If you ARE inside nano: “Go to line” needs Shift on most keyboards
Ctrl + _ means Ctrl + underscore (underscore is usually Shift + -).
So press:
Ctrl + Shift + -
Then a prompt appears at the bottom: Enter line number, column number:
Type:
32,4 and press Enter
It won’t print — it should just move your cursor to that spot.
If that still doesn’t work, exit nano (Ctrl+X) and run this instead (it prints the exact lines with numbers):
nl -ba ~/.openclaw/openclaw.json | sed -n '28,36p'
(If it shows your token, don’t paste it — just tell me which line has a lone comma.)
"32,4" not found
No worries — that message means you accidentally used search in nano, not “go to line”.
Let’s do a simpler method that can’t go wrong.
Step 1 (run this on the server, at the normal prompt)
Exit nano first (Ctrl+X), then run:
nl -ba ~/.openclaw/openclaw.json | sed -n '28,36p' | sed -E 's/(token: \").*(\")/\1***\2/'
That will print lines 28–36 with line numbers, and it will hide your token.
Paste the output here — then I’ll tell you exactly which comma/line to delete.
it did not hide my token
Don’t paste it if the token is visible — totally fine.
Let’s use a stronger redaction command that hides both:
token: "..."and"token": "..."
Step 1 (run this on the server)
nl -ba ~/.openclaw/openclaw.json | sed -n '28,36p' | perl -pe 's/(\"?token\"?\\s*:\\s*\")[^\"]*(\")/$1***$2/g'
This should replace the token value with *** automatically.
Tell me:
- does the output now show
token: "***"(or"token": "***")? - if yes, paste the output here and we’ll delete the bad comma at line 32.
Dude this is getting ridiculous lets solve this in the next 5 mins if not forget it we've been at this for too long
nl -ba ~/.openclaw/openclaw.json | sed -n '28,36p' | sed -E 's/(token: ").(")/\1**\2/'
Yep. Fastest way to get this unstuck in <5 min: stop the service and replace the broken config with a known‑good minimal one. Your current problem is a JSON5 parse error, so anything we do is pointless until the file is valid again.
Do these 5 commands (copy/paste, on the server)
systemctl --user stop openclaw-gateway
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.broken
cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "loopback",
},
}
JSON5
systemctl --user start openclaw-gateway
openclaw gateway status
If openclaw gateway status shows Runtime: running + RPC probe: ok, you’re done — gateway is back online.
This will temporarily drop the Tailscale/dashboard stuff (and any channel config), but you’ll have the old file saved as ~/.openclaw/openclaw.json.broken so we can re-add things cleanly later.
one shot?
Yes — you can paste the whole block in one shot into your SSH terminal.
It’s just a sequence of normal shell commands; they’ll run top‑to‑bottom.
After you paste it, the last command (openclaw gateway status) will print the result — paste that output here.
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: /home/kyle/.openclaw/openclaw.json
Gateway port 18789 is not listening (service appears running).
Logs: journalctl --user -u openclaw-gateway.service -n 200 --no-pager
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
Good — the config parse issue is gone, but the gateway process is still not actually listening on 18789 (that’s why the RPC probe fails).
Next we need the service logs, exactly as the status message suggests.
Do this one command (on the server)
journalctl --user -u openclaw-gateway.service -n 200 --no-pager
Paste the last ~40 lines of that output here (it shouldn’t include secrets).
That will show the real crash reason (port in use, missing auth, exception, etc.).
how do i paste this all it will exceed all the lines
Mar 03 14:23:30 ubuntu-4gb-hel1-1 systemd[821]: openclaw-gateway.service: Scheduled restart job, restart counter is at 1143.
Mar 03 14:23:30 ubuntu-4gb-hel1-1 systemd[821]: Started openclaw-gateway.service - OpenClaw Gateway (v2026.2.26).
Mar 03 14:23:32 ubuntu-4gb-hel1-1 node[17000]: Failed to read config at /home/kyle/.openclaw/openclaw.json SyntaxError: JSON5: invalid character ',' at 32:4
Mar 03 14:23:32 ubuntu-4gb-hel1-1 node[17000]: at syntaxError (/home/kyle/.npm-global/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:1110:17)
Mar 03 14:23:32 ubuntu-4gb-hel1-1 node[17000]: at invalidChar (/home/kyle/.npm-global/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:1055:12)
Mar 03 14:23:32 ubuntu-4gb-hel1-1 node[17000]: at Object.end (/home/kyle/.npm-global/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:704:15)
Mar 03 14:23:32 ubuntu-4gb-hel1-1 node[17000]: at Object.default (/home/kyle/.npm-global/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:168:37)
Mar 03 14:23:32 ubuntu-4gb-hel1-1 node[17000]: at lex (/home/kyle/.npm-global/lib/node_modules/openclaw/node_modules/json5/lib/parse.jsđź’Ż42)
Mar 03 14:23:32 ubuntu-4gb-hel1-1 node[17000]: at Object.parse (/home/kyle/.npm-global/lib/node_modules/openclaw/node_modules/json5/lib/parse.js:25:17)
Mar 03 14:23:32 ubuntu-4gb-hel1-1 node[17000]: at Object.loadConfig (file:///home/kyle/.npm-global/lib/node_modules/openclaw/dist/model-selection-J6oFwo9y.js:9783:111)
Mar 03 14:23:32 ubuntu-4gb-hel1-1 node[17000]: at loadConfig (file:///home/kyle/.npm-global/lib/node_modules/openclaw/dist/model-selection-J6oFwo9y.js:10239:20)
Mar 03 14:23:32 ubuntu-4gb-hel1-1 node[17000]: at file:///home/kyle/.npm-global/lib/node_modules/openclaw/dist/reply-Deht_wOB.js:26661:9
Mar 03 14:23:32 ubuntu-4gb-hel1-1 node[17000]: at file:///home/kyle/.npm-global/lib/node_modules/openclaw/dist/reply-Deht_wOB.js:26681:3 {
No problem — just paste a smaller chunk.
Run this (it limits the output to the last 80 lines):
journalctl --user -u openclaw-gateway.service -n 80 --no-pager
Then copy/paste that whole output here.
If it’s still too long for Discord, do it in two parts:
Part 1 (last 40 lines):
journalctl --user -u openclaw-gateway.service -n 40 --no-pager
Part 2 (the 40 lines before that):
journalctl --user -u openclaw-gateway.service -n 80 --no-pager | head -n 40
That log is the smoking gun: the service is still reading a broken ~/.openclaw/openclaw.json with the same comma error at 32:4. So the gateway will never come up until we overwrite that file with a clean one.
Let’s fix it the fastest possible way (one paste).
Paste this whole block on the server
systemctl --user stop openclaw-gateway
cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "loopback",
},
}
JSON5
wc -l ~/.openclaw/openclaw.json
systemctl --user start openclaw-gateway
openclaw gateway status
What to look for:
wc -lshould print a small number (like 7). If it prints ~30+ lines, the overwrite didn’t happen.openclaw gateway statusshould end withRuntime: runningandRPC probe: ok.
Run that and paste the wc -l line + the last 6 lines of openclaw gateway status.
gateway closed (1006 abnormal closure (no close frame)): no close reason
Gateway target: ws://127.0.0.1:18789
Source: cli --url
Config: /home/kyle/.openclaw/openclaw.json
Gateway port 18789 is not listening (service appears running).
Logs: journalctl --user -u openclaw-gateway.service -n 200 --no-pager
We need one quick sanity check first: did the overwrite actually happen?
Step 1 (one command)
On the server, run:
wc -l ~/.openclaw/openclaw.json
Paste the output.
- If it’s something like 7 → the file is the minimal config (good).
- If it’s 30+ → the file is still the old broken one (overwrite didn’t take).
nothing happened
wc should always print something. If you saw absolutely nothing, one of these is true:
- you’re not at a normal shell prompt, or
- the command printed an error you didn’t copy, or
- you didn’t actually run it.
Step 1 (try this exactly)
At the SSH prompt, run:
wc -l ~/.openclaw/openclaw.json; echo DONE
Then paste exactly what shows up (including any “No such file” errors). The DONE guarantees we’ll see output even if wc doesn’t.
nothing happens
If literally nothing happens even for echo DONE, then you’re almost certainly not actually running these in an SSH shell.
Quick check:
Step 1
In your SSH terminal window (not Discord), type this and press Enter:
echo TEST123
You should immediately see:
TEST123
Tell me what you see.
If you’re pasting these commands into Discord, nothing will run — you have to run them in the terminal where you’re SSH’d into your server, then copy the output back here.
kyle@ubuntu-4gb-hel1-1:~$ echo TEST123
TEST123
Perfect — you’re in the right place.
Next step
Run this and paste the output:
wc -l ~/.openclaw/openclaw.json
kyle@ubuntu-4gb-hel1-1:~$ wc -l ~/.openclaw/openclaw.json
6 /home/kyle/.openclaw/openclaw.json
kyle@ubuntu-4gb-hel1-1:~$
Great — that means your config file is now clean/minimal (no more line 32 error).
Next step
Run this and paste the output:
systemctl --user status openclaw-gateway --no-pager -n 30
This will show whether the service is actually running or still crash-looping, and usually includes the exact error line.
Dude im sorry this is getting out of hand lets forget this. Please tell me how to reset my configurations so my openclaw tui works
Im not keen on fixing something and we keep going on circles
Yep — let’s stop debugging and just reset your config so the TUI works again.
Option A (recommended): reset config only (keeps your state/sessions)
Paste this on the server:
systemctl --user stop openclaw-gateway
mv ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak 2>/dev/null || true
openclaw configure
In the wizard, choose:
- Gateway mode: Local
- Bind: Loopback (safe default)
Then restart and test TUI:
systemctl --user restart openclaw-gateway
openclaw tui
Option B (nuclear): reset everything (fresh install)
Only do this if you’re OK losing pairing/auth/session state:
systemctl --user stop openclaw-gateway
mv ~/.openclaw ~/.openclaw.backup
openclaw onboard --install-daemon
If you tell me whether you want Option A or B, I’ll keep guiding you one step at a time.
Totally fair — at this point the fastest way out of the loop is to stop trying to “patch” and just do a clean reset.
If your goal is simply “make OpenClaw work again”, do this one-time clean reset (and keep a backup so nothing is truly lost):
systemctl --user stop openclaw-gateway
mv ~/.openclaw ~/.openclaw.backup-$(date +%Y%m%d-%H%M%S)
openclaw onboard --install-daemon
That gives you a fresh, known-good setup (TUI + gateway) in minutes.
If you don’t want to lose your current state, then we have to keep debugging—but that’s exactly the circle you’re describing.
Tell me which you want:
- Reset everything (recommended to end the pain), or
- Keep state (slower; requires more logs + config surgery).
whichever is faster i dont care
Fastest is the full reset (but safe because we move your old state to a backup folder instead of deleting it).
Paste this on the server:
systemctl --user stop openclaw-gateway || true
mv ~/.openclaw ~/.openclaw.backup
openclaw onboard --install-daemon
After the wizard finishes, run:
openclaw gateway status
openclaw tui
Notes:
- This will “factory reset” your OpenClaw config/auth/sessions/channels — you’ll re-enter things like your Telegram bot token during onboarding.
- Your old setup is still sitting in
~/.openclaw.backupif you ever want to restore it.
how do i set up openrouter as the back up model
To set OpenRouter as a backup (fallback) model, you need two things:
- an OpenRouter API key, and
- a fallback entry in
agents.defaults.model.fallbacks.
I won’t recommend specific models here (it changes fast) — but I can show you the exact wiring.
Step 1 — add your OpenRouter API key
Easiest is to put it in your config (on the server):
{
env: {
OPENROUTER_API_KEY: "sk-or-REPLACE-ME",
},
}
Docs: https://docs.openclaw.ai/providers/openrouter
Step 2 — set a fallback model to an OpenRouter model ref
OpenRouter model refs look like:
openrouter/<provider>/<model>
Add it as a fallback:
{
agents: {
defaults: {
// make sure both primary + fallback exist in the catalog/allowlist
models: {
"YOUR_PRIMARY_PROVIDER/YOUR_PRIMARY_MODEL": { alias: "primary" },
"openrouter/<provider>/<model>": { alias: "openrouter-backup" },
},
model: {
primary: "YOUR_PRIMARY_PROVIDER/YOUR_PRIMARY_MODEL",
fallbacks: ["openrouter/<provider>/<model>"],
},
},
},
}
Docs (how failover works): https://docs.openclaw.ai/concepts/model-failover
Step 3 — restart and verify
systemctl --user restart openclaw-gateway
openclaw models status
If you tell me what your current primary model provider is (Anthropic/OpenAI/etc.), I can tailor the snippet to match your setup — and for choosing which OpenRouter model to use as fallback, the best place is the server’s #models channel (fresh recommendations).
Command 'env:' not found, did you mean:
command 'envs' from snap envs (1.1.15)
command 'env' from deb coreutils (9.4-3ubuntu6.1)
command 'env2' from deb env2 (1.1.0-4)
See 'snap info <snapname>' for additional versions.
OPENROUTER_API_KEY:: command not found
You accidentally pasted the config snippet into your Linux shell. That’s why it says env: / OPENROUTER_API_KEY: “command not found”.
env: { … } is not a command — it’s something you put inside OpenClaw’s config (or an .env file).
Fastest way (recommended): put the key in ~/.openclaw/.env
Do this on the server:
- Open the env file:
nano ~/.openclaw/.env
- Add this single line (replace with your real key). Don’t post it in Discord:
OPENROUTER_API_KEY=sk-or-REPLACE-ME
-
Save + exit (
Ctrl+O, Enter,Ctrl+X) -
Restart OpenClaw:
systemctl --user restart openclaw-gateway
- Check it sees the provider:
openclaw models status
Docs reference: OpenClaw loads env vars from ~/.openclaw/.env (and from the parent process).
After that’s working, we’ll add the fallback model in ~/.openclaw/openclaw.json (that part is config, not a shell command).
Dude why did you get me to REDO everything. I meant just switch back or reset the bind. Does this mean I have to re-create my eholw bot?
No — you don’t have to recreate your whole bot, as long as you followed the step where we moved ~/.openclaw to a backup (we did that specifically so you could undo it).
Your “bot” is basically:
- your
~/.openclaw/openclaw.json - your credentials/state under
~/.openclaw/…
If those are in the backup folder, you can restore everything in 30 seconds.
Restore your old bot/state (safe undo)
On the server (SSH), run these:
systemctl --user stop openclaw-gateway || true
ls -la ~ | grep openclaw
Tell me what backup folder you see (e.g. ~/.openclaw.backup or ~/.openclaw.backup-<timestamp>), and I’ll give you the exact mv command to put it back.
If the backup folder is exactly ~/.openclaw.backup, then it’s usually:
mv ~/.openclaw ~/.openclaw.new
mv ~/.openclaw.backup ~/.openclaw
systemctl --user start openclaw-gateway
After that, your original bot config/tokens should be back, and we can only change gateway.bind (no more “redo everything”).
drwx------ 11 kyle kyle 4096 Mar 3 14:49 .openclaw
drwx------ 16 kyle kyle 4096 Mar 3 14:32 .openclaw.backup
-rw-rw-r-- 1 kyle kyle 0 Feb 25 06:22 openclaw.zip
kyle@ubuntu-4gb-hel1-1:~$
Perfect — you have both the new state (~/.openclaw, modified at 14:49) and your old bot/state (~/.openclaw.backup, 14:32).
To restore your old bot, do this:
systemctl --user stop openclaw-gateway || true
mv ~/.openclaw ~/.openclaw.new-$(date +%Y%m%d-%H%M%S)
mv ~/.openclaw.backup ~/.openclaw
systemctl --user start openclaw-gateway
openclaw gateway status
- This puts your old bot back as the active one.
- Your current/new state is kept safely as
~/.openclaw.new-...(so nothing is lost).
Paste the output of openclaw gateway status after this, and we’ll do the minimal change you originally wanted (just fixing gateway.bind).
Dude does my openclaw tui work? if it can work its fine I dont want to fix the dashboard anymore.
I can’t see your machine, so I can’t guarantee it from here — but you can check in 30 seconds.
1) Check the gateway is healthy
On the server (SSH), run:
openclaw gateway status
If it shows Runtime: running and RPC probe: ok, the backend is fine.
2) Launch the TUI
openclaw tui
If gateway status is healthy and openclaw tui opens, you’re done — you can ignore the dashboard entirely. If either of those fails, paste the output and we’ll fix just that (no dashboard work).
not it doe snot work is failed
Ok — let’s narrow it down.
Step 1 (one command)
On the server, run:
openclaw gateway status
Paste just the bottom part that includes:
Config …(if it says invalid)Runtime: …RPC probe: …
That output won’t include secrets, and it’ll tell us exactly what’s failing (config invalid vs gateway not running vs auth/url mismatch).
Service: systemd (enabled)
File logs: /tmp/openclaw/openclaw-2026-03-03.log
Command: /usr/bin/node /home/kyle/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 18508, state active, sub running, last exit 0, reason 0)
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: /home/kyle/.openclaw/openclaw.json
This is actually a useful state: systemd says the gateway process is running, but the RPC/WebSocket probe can’t connect (1006). That often happens when the gateway is up but is immediately rejecting the connection (auth), or the WS server isn’t coming up cleanly.
Let’s do one very quick local test on the server to see if the HTTP side is alive and whether it’s demanding auth:
Step 1 (one command)
curl -sS -D - http://127.0.0.1:18789/ -o /dev/null | head -n 20
Paste what it prints (it’ll include an HTTP/1.1 200 or 401 etc).
Then I’ll tell you the exact next step.
curl -sS -D - http://127.0.0.1:18789/ -o /dev/null | head -n 20
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
Referrer-Policy: no-referrer
X-Frame-Options: DENY
Content-Security-Policy: default-src 'self'; base-uri 'none'; object-src 'none'; frame-ancestors 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self'; connect-src 'self' ws: wss:
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache
Date: Tue, 03 Mar 2026 14:55:41 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Content-Length: 692
Nice — HTTP 200 means the Gateway is actually up and serving the Control UI. The reason your RPC probe / TUI still fails is almost certainly the WebSocket auth handshake (usually missing/incorrect gateway token), even though the plain webpage loads.
Let’s confirm whether your gateway currently has a token configured.
Step 1 (one thing)
On the server, open your config:
nano ~/.openclaw/openclaw.json
Look under the gateway section and tell me yes/no:
- Do you see an
authblock with atokenin it?
(Example:auth: { mode: "token", token: "..." })
Don’t paste the token value here — just yes/no.
Once I know that, I’ll give you the single next command to make openclaw tui connect.
gateway: {
mode: "local",
bind: "loopback",
},
Perfect — your config has no auth token, so the gateway should be open on loopback… unless the systemd service is still setting a token via environment.
Let’s check that (without you posting the token).
Step 1 (one command)
Run this on the server:
systemctl --user show openclaw-gateway -p Environment | tr ' ' '\n' | grep OPENCLAW_GATEWAY_TOKEN
Important:
- If it prints a line like
OPENCLAW_GATEWAY_TOKEN=...do not paste it — just reply “yes, it’s set”. - If it prints nothing, reply “no output”.
That tells us whether the gateway is expecting a token (which would explain the WS/RPC probe failing).
I see the token
Great — that explains everything.
Your gateway service (systemd) has OPENCLAW_GATEWAY_TOKEN set, so the gateway is expecting a token on the WebSocket… but when you run openclaw commands in your normal SSH shell, your shell doesn’t automatically have that token, so the RPC probe/TUI fails.
Fast fix: copy that same token into your openclaw.json so the CLI/TUI can read it too.
Step 2 (one thing)
- Open your config:
nano ~/.openclaw/openclaw.json
- Change your gateway block to include
authlike this (paste the token you saw — don’t post it here):
gateway: {
mode: "local",
bind: "loopback",
auth: {
mode: "token",
token: "PASTE_THE_SAME_TOKEN_HERE",
},
},
- Save/exit:
Ctrl+O, Enter,Ctrl+X
Tell me when you’ve saved, and I’ll give you the next single command (restart + check).
okay done
Nice.
Step 3
Restart the gateway service:
systemctl --user restart openclaw-gateway
Tell me if you get any error (or if it’s silent and returns to the prompt).
what now?
gateway connect failed: Error: unauthorized: gateway token mismatch (provide gateway auth token)
gateway connect failed: Error: unauthorized: gateway token mismatch (provide gateway auth token)
Step 4
Now run:
openclaw gateway status
Paste the last few lines (the part with Runtime: and RPC probe:). If it says RPC probe: ok, we’ll do openclaw tui next.
Service: systemd (enabled)
File logs: /tmp/openclaw/openclaw-2026-03-03.log
Command: /usr/bin/node /home/kyle/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json (invalid)
Config issue: <root>: JSON5 parse failed: SyntaxError: JSON5: invalid character ',' at 12:4
Config (service): ~/.openclaw/openclaw.json (invalid)
Service config issue: <root>: JSON5 parse failed: SyntaxError: JSON5: invalid character ',' at 12:4
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: stopped (state activating, sub auto-restart, last exit 1, reason 1)
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: /home/kyle/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-03-03.log
Logs: journalctl --user -u openclaw-gateway.service -n 200 --no-pager
That error means your gateway is expecting token A, but your CLI is sending token B.
In other words: systemd’s OPENCLAW_GATEWAY_TOKEN and your gateway.auth.token in openclaw.json still don’t match (even if you tried to copy it, one of them is different).
Fastest fix:
Step 1
Run this on the server:
openclaw doctor --fix
(It should detect the token mismatch and repair it.)
Tell me when it finishes (no need to paste the whole output). Then we’ll do the restart + re-check.
Ok — we’re back to the same root cause again: your config file is syntax-broken:
JSON5 parse failed … invalid character ',' at 12:4
Until that file is valid, the gateway will crash-loop. The fastest way out is to stop editing and overwrite the config with a tiny known-good file.
Do this (copy/paste on the server)
systemctl --user stop openclaw-gateway || true
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bad 2>/dev/null || true
cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "loopback",
},
}
JSON5
systemctl --user start openclaw-gateway
After that, run:
openclaw gateway status
Once the gateway is up again, we’ll make the TUI work without putting the token into openclaw.json (so you don’t hit JSON syntax errors again).
Dude how did we fix it last time why does this keep happening? Yesterday we tried and we could just switch and reset the bind back NOW WE CANT even do that:
Service: systemd (enabled)
File logs: /tmp/openclaw/openclaw-2026-03-03.log
Command: /usr/bin/node /home/kyle/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json (invalid)
Config issue: <root>: JSON5 parse failed: SyntaxError: JSON5: invalid character '-' at 4:11
Config (service): ~/.openclaw/openclaw.json (invalid)
Service config issue: <root>: JSON5 parse failed: SyntaxError: JSON5: invalid character '-' at 4:11
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: stopped (state activating, sub auto-restart, last exit 1, reason 1)
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: /home/kyle/.openclaw/openclaw.json
Service is loaded but not running (likely exited immediately).
File logs: /tmp/openclaw/openclaw-2026-03-03.log
Logs: journalctl --user -u openclaw-gateway.service -n 200 --no-pager
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
It keeps happening for one simple reason: ~/.openclaw/openclaw.json is JSON5, and at some point you accidentally pasted non‑JSON text into it (usually YAML-style - bullets or a dashed list). That’s exactly what this error means:
JSON5 parse failed … invalid character '-' at 4:11
So the gateway exits immediately and systemd restarts it forever.
We fixed it last time by overwriting the config with a tiny valid JSON5 file. Let’s do that again (this is the quickest reliable recovery).
Paste this (on the server)
systemctl --user stop openclaw-gateway || true
cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "loopback",
},
}
JSON5
systemctl --user start openclaw-gateway
openclaw gateway status
If openclaw gateway status shows Runtime: running + RPC probe: ok, you’re back online.
To prevent this from happening again: never paste dashed/bulleted text into openclaw.json—only paste code blocks like the one above, or use openclaw configure so it writes valid JSON5 for you.
Can you give me the one exact prompt and dont break it up
When I break it up it becomes difficult
Paste this exact block into your SSH terminal (all at once):
systemctl --user stop openclaw-gateway || true
cat > ~/.openclaw/openclaw.json <<'JSON5'
{
gateway: {
mode: "local",
bind: "loopback",
},
}
JSON5
systemctl --user start openclaw-gateway
openclaw gateway status
Service: systemd (enabled)
File logs: /tmp/openclaw/openclaw-2026-03-03.log
Command: /usr/bin/node /home/kyle/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 20179, state active, sub running, last exit 0, reason 0)
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: /home/kyle/.openclaw/openclaw.json
Gateway port 18789 is not listening (service appears running).
Logs: journalctl --user -u openclaw-gateway.service -n 200 --no-pager
Got it — here’s a single-line command you can paste (no multi-line block, no splitting):
systemctl --user stop openclaw-gateway || true; printf '%s\n' '{' ' gateway: {' ' mode: "local",' ' bind: "loopback",' ' },' '}' > ~/.openclaw/openclaw.json; systemctl --user start openclaw-gateway; openclaw gateway status
Paste that into SSH, press Enter, and it will:
- stop the service
- overwrite
~/.openclaw/openclaw.jsonwith a valid minimal config - start the service
- print
openclaw gateway status
this is still happenine whaty is wrong?
Service: systemd (enabled)
File logs: /tmp/openclaw/openclaw-2026-03-03.log
Command: /usr/bin/node /home/kyle/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 20241, state active, sub running, last exit 0, reason 0)
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: /home/kyle/.openclaw/openclaw.json
Gateway port 18789 is not listening (service appears running).
Logs: journalctl --user -u openclaw-gateway.service -n 200 --no-pager
Troubles: run openclaw status
Good — config is valid again. Now we have a different problem: systemd thinks the process is running, but the port/probe says it’s not actually listening.
Let’s confirm with one simple local check on the server:
Step 1
Run this on the server:
curl -sS -D - http://127.0.0.1:18789/ -o /dev/null | head -n 5
- If you see
HTTP/1.1 200→ it is listening, and the WS probe is failing for another reason. - If you get
Connection refused/Could not resolve host/Failed to connect→ the gateway isn’t binding the port and we need the service logs next.
Paste exactly what it outputs.
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
Referrer-Policy: no-referrer
X-Frame-Options: DENY
Content-Security-Policy: default-src 'self'; base-uri 'none'; object-src 'none'; frame-ancestors 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self'; connect-src 'self' ws: wss:
kyle@ubuntu-4gb-hel1-1:~$
I know this is super annoying — but right now we need one hard fact: is anything actually listening on 18789 (and if so, is it IPv4 vs IPv6)?
Paste this one block in SSH and then paste the output back:
curl -sS -D - http://127.0.0.1:18789/ -o /dev/null | head -n 3 || echo "127_FAILED"
curl -sS -D - http://localhost:18789/ -o /dev/null | head -n 3 || echo "LOCALHOST_FAILED"
ss -ltnp | grep 18789 || echo "NO_LISTENER"
This will tell us in 10 seconds whether:
- it’s not listening at all (
NO_LISTENER), or - it’s listening but only on
localhost(often IPv6-only), or - it’s listening fine and the problem is auth/WebSocket.
STOP TYPING LET ME FINSIH
You pasted openclaw gateway status again (totally fine), but it doesn’t prove whether the port is actually listening — it’s just saying the WS probe failed.
Let’s do the one command that settles it:
Run this on the server
ss -ltnp | grep 18789 || echo NO_LISTENER
Paste the output.
- If it shows a
LISTENline → the gateway is listening, and the issue is WebSocket/auth. - If it prints
NO_LISTENER→ the process is running but never bound the port, and we’ll go straight to the service logs.
ss -ltnp | grep 18789 || echo "NO_LISTENER"
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
Referrer-Policy: no-referrer
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
Referrer-Policy: no-referrer
LISTEN 0 511 127.0.0.1:18789 0.0.0.0:* users:(("openclaw-gatewa",pid=20241,fd=23))
LISTEN 0 511 [::1]:18789 [::]:* users:(("openclaw-gatewa",pid=20241,fd=24))
Perfect — HTTP/1.1 200 OK confirms the gateway is listening and serving the UI. So the “port not listening” line is misleading here.
What’s actually broken is the WebSocket/RPC auth: the gateway is closing the WS handshake (shows up as code 1006). That’s almost always because the gateway expects a token (from the systemd service env), but your CLI/TUI isn’t providing it.
Next step (one command)
On the server, run:
openclaw gateway status --token "<PASTE_YOUR_OPENCLAW_GATEWAY_TOKEN>"
(Use the same OPENCLAW_GATEWAY_TOKEN value you saw earlier via systemctl --user show …. Don’t paste the token into Discord.)
If that shows RPC probe: ok, then the TUI will work with:
OPENCLAW_GATEWAY_TOKEN="<same token>" openclaw tui
okay great thanks
For Telegram how do i restore the owner? Ask the bot owner to approve with:
openclaw pairing approve telegram
Perfect — this confirms the important part:
- The gateway is listening on
127.0.0.1:18789(and::1:18789) - HTTP works (
200 OK)
So the gateway is fine. The remaining problem is: the WebSocket/RPC needs the gateway token, and your CLI/TUI isn’t using the same token that systemd is using.
Do this one-liner to copy the token from the systemd service into your current SSH shell (it won’t print the token), then start the TUI:
export OPENCLAW_GATEWAY_TOKEN="$(systemctl --user show openclaw-gateway -p Environment | tr ' ' '\n' | sed -n 's/^OPENCLAW_GATEWAY_TOKEN=//p')" && openclaw tui
If that opens the TUI, you’re done.
Nice — glad it’s working again.
If you want to make it permanent (so you don’t have to export the token each time), the clean way is to put the token into ~/.openclaw/openclaw.json under:
gateway: { auth: { mode: "token", token: "..." } }
…but if you’re happy now, leave it as-is.
Also, if this solved the original issue, please mark the solution in the thread (right‑click the solution message → Apps → ✅ Mark Solution).
Yep — if you reset state, you typically need to pair again on Telegram. There isn’t a special “restore owner” button; you just approve your own DM pairing.
Do this:
1) DM your Telegram bot
From your Telegram account, send the bot a message (e.g. “hi”).
It should reply with a pairing code.
2) On the server, approve that code
Run:
openclaw pairing approve telegram <CODE>
If you’re not sure what the code is (or if multiple are pending), list them first:
openclaw pairing list telegram
Notes:
- Pairing codes expire after ~1 hour.
- Don’t paste your bot token or pairing codes into Discord.
Docs: https://docs.openclaw.ai/channels/telegram (see “Start gateway and approve first DM”).
I've in put the pairing code
No pending pairing requests at the moment. If you're trying to set up the Telegram bot integration from last week, we might need to restart the pairing process to generate a new code. Would you like
me to walk you through re-triggering the Telegram pairing workflow?
That “no pending pairing requests” means OpenClaw never saw (or no longer has) a pairing request to approve. The most common reasons are:
- you didn’t DM the bot (pairing is DM-only, not groups)
- Telegram channel isn’t actually running / token missing
- the code is old/expired and the request is gone
Let’s re-trigger it cleanly.
Step 1 (server)
Run:
openclaw channels status --probe
Paste just the Telegram part (or tell me if Telegram isn’t listed).
Once Telegram shows as running, we’ll do Step 2: you DM the bot again to generate a fresh pairing code, then we’ll list/approve it.
nothing is listed
If nothing is listed, that usually means one of these is true:
- Telegram isn’t configured at all in your
openclaw.json(most likely — we reset your config to gateway‑only), or - the command isn’t reaching the gateway because your shell doesn’t have the gateway token set.
Let’s assume the simple case first: Telegram config is missing, so pairing can’t happen.
Step 1: Re-add Telegram (wizard = safest, avoids JSON5 mistakes)
On the server run:
openclaw configure --section channels
Then:
- pick Telegram
- paste your BotFather token
- set dmPolicy = pairing
- finish/save
After that (next step) we’ll restart the gateway and you’ll DM the bot again to get a fresh pairing code.
If the wizard asks “local or remote”, pick local.
Telegram already configured. What do you want to do?
│ Modify settings
│
â—† Telegram token already configured. Keep it?
Pick Keep it (don’t change the token) — that means the bot token is still correct.
Then continue through the Telegram section and make sure:
- DM policy = pairing (recommended)
- finish/save the wizard
When you’re done and back at the shell prompt, tell me “done” and we’ll do the next step (restart gateway + generate/approve a fresh pairing code).
configure DM access policies now?
Yes — choose Yes and set DM access to:
- DM policy:
pairing(that’s the easiest/safer default)
That means when you DM the bot, it will give you a pairing code, and you approve it once.
(Only pick allowlist if you already know your numeric Telegram user ID and want to skip pairing.)
confgure compelte
Nice.
Next step
Restart the gateway so the new Telegram settings take effect:
systemctl --user restart openclaw-gateway
After that:
- DM your Telegram bot (“hi” is fine) to generate a fresh pairing code.
- On the server, run:
openclaw pairing list telegram
Tell me what pairing list shows (or if it’s still empty).
my bot works but it doesnt have the memory of our stand up or our soul etc. I have an obsidian how do i connect it?
OpenClaw doesn’t “integrate” with Obsidian via an API — it just uses a workspace folder full of Markdown files (SOUL.md, AGENTS.md, memory/*.md, etc.). To “connect Obsidian”, you make Obsidian look at the same folder.
You have two easy options:
Option A (simplest): open the existing OpenClaw workspace in Obsidian
- On your server, your workspace is usually:
~/.openclaw/workspace(default)
- In Obsidian: Open folder as vault → choose that folder.
Then you can edit:
SOUL.md(persona)AGENTS.md(rules/instructions)memory/YYYY-MM-DD.md(daily memory)
That’s it — the bot will “remember” based on those files.
Option B: use your existing Obsidian vault as the workspace
Pick (or create) a folder inside your vault, e.g.:
/path/to/ObsidianVault/openclaw/
Then set OpenClaw’s workspace to that path (wizard is safest to avoid JSON typos):
openclaw configure
Look for the workspace/agent defaults section and point it at that folder. After saving, restart:
systemctl --user restart openclaw-gateway
Important notes
- If you reset your
~/.openclawstate, the bot will lose prior sessions/pairings; the workspace files are how you keep “soul/memory” durable. - Don’t put API keys/secrets in the Obsidian vault if it’s synced/shared.
If you tell me whether you’re running Obsidian on the same machine as the gateway or on your laptop (gateway is a VPS), I’ll tell you the best workflow (local vault vs git sync vs sshfs).
it is a VPS , How do i get my bot to read obsidian folder?
hwo does my bot access obsidian
Your bot runs on the VPS, so it can only read files that exist on the VPS disk (its workspace). It can’t directly read your laptop’s Obsidian vault unless you sync/mount that vault (or a subfolder of it) onto the VPS.
You’ve basically got 3 workable setups:
Option 1 (recommended): Sync a dedicated “OpenClaw” folder with Git
Idea: Keep OpenClaw’s workspace as a small markdown repo (SOUL.md, AGENTS.md, memory/…), open that folder in Obsidian locally, and sync it to the VPS via a private git repo.
Flow:
- Laptop: edit in Obsidian → git commit/push
- VPS: git pull (or cron it) → restart gateway (or just start a new session)
Pros: reliable, cross‑platform.
Cons: you have to use git (or Obsidian Git plugin).
Option 2: Mount the VPS workspace locally (SSHFS)
Idea: Mount ~/.openclaw/workspace from the VPS onto your laptop, then open that mounted folder as an Obsidian vault. When you edit, you’re editing the VPS files directly.
Pros: no syncing workflow, instant.
Cons: setup depends on your OS (macOS/Windows/Linux).
Option 3: Periodic rsync/scp copy
Idea: push your vault (or a subfolder) to the VPS with rsync. Simple but manual.
Quick question so I can give you the exact steps:
What’s your local computer OS for Obsidian — macOS, Windows, or Linux?
If you tell me that (and whether you prefer “git sync” or “mount it so it feels local”), I’ll give you the exact copy/paste commands.
Your bot can’t “reach into” Obsidian on your laptop directly.
OpenClaw only reads files that exist on the VPS filesystem, in its workspace folder (defaults to ~/.openclaw/workspace). That workspace is where SOUL.md, AGENTS.md, and memory/*.md live.
So to have “Obsidian + bot” you do one of these:
- Open the VPS workspace as an Obsidian vault (recommended mental model)
- In Obsidian, open the folder that contains the bot’s workspace (or a synced copy of it).
- Anything you edit there (SOUL.md, memory/) is what the bot reads.
- Sync/mount between your laptop and the VPS
- SSHFS mount the VPS workspace locally, then open it in Obsidian (live editing), or
- Git sync a private repo: edit in Obsidian → push; VPS pulls.
Tell me your laptop OS (Windows / macOS / Linux) and I’ll give you the exact steps for the easiest option (SSHFS vs git).
Your bot “has access” to SOUL.md, MEMORY.md, memory/*.md only if those files exist on the VPS in the bot’s workspace.
What changed is: Obsidian is on your computer, but the bot is on a VPS, so it can’t read your local vault unless you sync/mount it to the VPS (or you edit the VPS workspace from Obsidian).
What the bot actually reads
By default it reads from this folder on the VPS:
~/.openclaw/workspace/SOUL.mdAGENTS.mdUSER.mdmemory/…
So if you want “Obsidian = bot’s memory”, you make Obsidian point at that folder.
Easiest setup (no OpenClaw config changes): mount the VPS workspace locally and open it in Obsidian
- Mount
~/.openclaw/workspacefrom the VPS onto your laptop (SSHFS).