Troubleshooting OpenClaw: Common Issues and How to Fix Them
Every tool has its quirks. OpenClaw is powerful, but when something breaks, the error messages aren't always self-explanatory. This guide covers the most common issues users hit and how to resolve them fast.
Installation Errors
Node.js Version Mismatch
OpenClaw requires Node.js 18+. If you see errors during installation:
# Check your Node version
node --version
# If below 18, upgrade
nvm install 20
nvm use 20Using a Node version manager like nvm prevents conflicts with other projects requiring different versions.
Permission Denied During Install
On macOS or Linux, you might encounter permission errors:
# Fix: Don't use sudo, use a Node version manager instead
npm install -g openclaw
# If permission denied, fix npm's default directory
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrcInstallation Completes but Command Not Found
After a successful install, running openclaw returns "command not found":
Check that npm's global bin directory is in your PATH:
echo $PATH | tr ':' '\n' | grep npmIf missing, add it:
export PATH="$(npm root -g)/bin:$PATH"Verify installation:
openclaw --version
Connection Issues
Gateway Won't Start
The Gateway service is the backbone of OpenClaw's connectivity:
# Check if something is already using the default port
lsof -i :18789
# If port is in use, either kill the process or change the port in config
openclaw gateway stop
openclaw gateway start --port 18790Agent Can't Reach External APIs
If agents are timing out when calling model providers:
Verify internet connectivity from the machine:
curl -I https://api.anthropic.comCheck proxy settings — corporate networks often require proxy configuration:
export HTTPS_PROXY=http://proxy.company.com:8080Verify API key is valid by testing with curl:
curl https://api.anthropic.com/v1/messages \ -H "x-api-key: YOUR_KEY" \ -H "anthropic-version: 2023-06-01" \ -d '{"model":"claude-opus-4-5","max_tokens":10,"messages":[{"role":"user","content":"test"}]}'Check firewall rules — ensure outbound HTTPS (port 443) is allowed.
Node Companion App Won't Pair
Pairing failures usually stem from network or configuration issues:
- Same network required for initial pairing — the companion app and Gateway must be on the same local network.
- Check Gateway URL in the app settings matches your server's actual address.
- Restart both devices — sometimes a fresh start resolves discovery issues.
- Check QR code validity — codes expire after 5 minutes. Refresh if expired.
Model Errors
"Model Not Found" or "Unsupported Model"
This error occurs when the model identifier doesn't match what the provider expects:
# Use exact model names from provider documentation
# ❌ Wrong
"model": "claude-v4"
# ✅ Correct
"model": "claude-opus-4-5"Check the Anthropic model list, OpenAI models, or your provider's documentation for exact identifiers.
Rate Limit Exceeded
You're hitting API quota limits:
- Check your current usage in the provider's dashboard.
- Implement exponential backoff in your code:
async function callWithRetry(fn, maxRetries = 3) { for (let i = 0; i < maxRetries; i++) { try { return await fn(); } catch (e) { if (e.status === 429) { await sleep(Math.pow(2, i) * 1000); continue; } throw e; } } } - Consider upgrading your plan or distributing load across multiple API keys.
Context Window Exceeded
Your prompt plus conversation history exceeds the model's maximum context:
- Start a new conversation when context grows too large.
- Summarize and compress long-running contexts before continuing.
- Choose models with larger context windows (Claude Opus 4 has 200K tokens).
Performance Problems
Slow Response Times
If agents feel sluggish:
Check network latency to your API provider:
ping api.anthropic.comReduce verbosity in agent instructions — less processing means faster responses.
Use streaming if your setup supports it — results stream incrementally rather than waiting for full response.
Switch to a closer region — many providers have multiple regions. Lower latency = faster responses.
High Memory Usage
OpenClaw shouldn't consume excessive RAM, but long-running sessions can accumulate:
- Restart the Gateway periodically to clear memory.
- Limit conversation history stored in context.
- Check for memory leaks in custom plugins by monitoring over 24-48 hours.
Agent Gets Stuck in Loops
Agents occasionally repeat actions without progressing:
- Set explicit iteration limits in your configuration:
{ "execution": { "max_iterations": 20, "max_tool_calls": 50 } } - Be more specific in your instructions — vague goals cause looping.
- Break complex tasks into smaller steps with intermediate verification.
Debug Tips
Enable Verbose Logging
When something goes wrong, turn up the detail level:
openclaw gateway start --log-level debugDebug logging shows every API call, tool invocation, and state change. Reproduce your issue with this enabled and you'll have a clear trail.
Use the OpenClaw CLI for Diagnostics
# Check system status
openclaw status
# View recent logs
openclaw logs --lines 100
# Test configuration
openclaw config validateIsolate the Problem
When debugging complex setups:
- Simplify your configuration to minimum viable settings.
- Test in isolation — run one agent with one model.
- Add components back one at a time until the problem reappears.
- Document what changed — often the last thing you changed is the culprit.
Check Provider Status Pages
Before assuming it's your setup, verify the provider is healthy:
Outages happen and knowing this upfront saves hours of debugging.
Getting More Help
If you've worked through this guide and still can't resolve the issue:
- Search existing issues at the OpenClaw GitHub repository.
- Check the documentation for updates on known issues.
- Ask in Claw Crew — the community often has workarounds for edge cases.
- Collect diagnostic info before reporting:
openclaw diagnostics > output.txt
Include your OS, Node version, OpenClaw version, and exact error messages when seeking help.
Facing a different issue?
Master multi-model workflows in the OpenClaw Quick Start Course →
Get model recommendations and community tips at Claw Crew →
Comments
Post a Comment