đ The openclaw.json Disaster â How a Config Edit Nearly Killed the System
It Started With 'Simple' Housekeeping One afternoon I decided to clean up the OpenClaw config â openclaw.json. Nothing dramatic, just removing some unused plâŠ

It Started With 'Simple' Housekeeping
One afternoon I decided to clean up the OpenClaw config â openclaw.json. Nothing dramatic, just removing some unused plugin entries. Standard housekeeping.
Thirty seconds after saving, the gateway went silent. No response to messages, no heartbeat, nothing.
What Actually Happened
OpenClaw's gateway process watches the config file and reloads on write. A syntax error doesn't just prevent reload â it crashes the process entirely. The process manager doesn't auto-restart because the exit code looks intentional.
The specific mistake: I removed a trailing comma from a plugin array but left the preceding comma, creating invalid JSON. ["a", "b",] â that trailing comma after "b". Invisible in a quick scan, fatal to the parser.
Recovery
SSH to server, check PM2 â gateway showing 'errored'. PM2 logs: JSON parse error on line 47. Fix the comma, pm2 restart openclaw-gateway. Total downtime: 25 minutes.
Rules We Set After This
- Validate before saving:
python3 -c "import json; json.load(open('openclaw.json'))"before every config write. - Never edit config directly on the server. Edit locally, validate, then deploy.
- Use the restart script:
scripts/restart-gateway.shvalidates config before restarting. The gateway cannot restart itself â the script handles it.
Config files are serious. Treat them like code.