Why Your OpenClaw Bot Keeps Breaking (And How to Fix It)

You set up your OpenClaw bot, it works for a day — then silence. Telegram messages go unanswered. You SSH in and find the gateway crashed at 2am. Here are the six most common reasons OpenClaw bots die, and exactly what to do about each one.

⚡ 1. Gateway process crash

The most common culprit. OpenClaw's gateway is a Node.js process — and Node processes die. Memory spikes, unhandled exceptions, or a bad update can bring it down silently with nothing to alert you.

How to check
Terminal
openclaw gateway status
Fix
Terminal
openclaw gateway restart
Prevention

A watchdog that checks every 5 minutes and auto-restarts catches this before you notice. That's what Mechanic Bot does.

📄 2. Config file corruption

OpenClaw stores config in ~/.openclaw/openclaw.json. A syntax error — trailing comma, missing bracket, wrong key name — and the gateway won't start. Happens after manual edits or a failed update.

Fix
Terminal
openclaw doctor --repair
Watch out

Never edit openclaw.json directly. Use openclaw config set instead.

🔑 3. API key expired or revoked

Your bot uses an API key to talk to the LLM. These can expire or get revoked — especially if billing lapses. The bot appears to start fine but responds with nothing.

How to check
Terminal
openclaw logs --follow | grep -i "error\|key\|auth"

Look for 401 Unauthorized. Regenerate at your provider, then:

Terminal
echo "sk-or-v1-YOUR_NEW_KEY" > ~/.openclaw/secrets/openrouter.key
export OPENROUTER_API_KEY=$(cat ~/.openclaw/secrets/openrouter.key)
openclaw gateway restart

📱 4. Telegram pairing expired

OpenClaw's Telegram pairing can expire after a restart or re-install. The bot runs but messages go nowhere.

Fix
Terminal (two tabs)
# Tab 1
openclaw onboard --channel telegram

# Tab 2 (when pairing code appears)
openclaw pairing approve telegram CODE
Tip

Set dmPolicy: open and allowFrom: ["*"] in your config so you don't need to re-pair after restarts.

💾 5. Disk space exhausted

Log files accumulate. On a small VPS, this fills your disk over weeks — causing strange failures because the gateway can't write logs to tell you what's wrong.

Check + Fix
Terminal
df -h ~
find ~/.openclaw/logs -name "*.log" -mtime +7 -delete
openclaw gateway restart

🔄 6. gateway.mode not set

This catches almost everyone on a fresh install. OpenClaw requires gateway.mode to be set explicitly. Without it, the service starts, crashes, and loops — with no clear error message.

Fix
Terminal
openclaw config set gateway.mode local
openclaw gateway restart
Why this happens

The OpenClaw wizard doesn't enforce this setting. Our onboarding script sets it automatically.

🚨 When nothing works: the rescue command

If you've tried everything above, run this. It connects the mechanic, runs a full diagnostic, and auto-fixes what it finds:

Terminal
curl -fsSL https://mechanicbot.io/rescue.sh | bash

No account required. ~60 seconds. Full report of what was found and fixed.

Never debug this manually again.

Mechanic Bot watches your OpenClaw gateway every 5 minutes, auto-repairs crashes before you notice, and sends you a daily health report.

Get covered → Bot broken now?