OpenClaw Not Working? How to Fix Every Common Error (2026)
A complete troubleshooting guide for OpenClaw. Fix authentication errors, rate limits, context length issues, messaging channel failures, Docker problems, and installation failures -- with the exact commands to run.
Run openclaw doctor --fix first. This single command auto-detects and repairs the most common OpenClaw issues -- broken permissions, missing directories, config errors, and connectivity failures -- in about 10 seconds. As of February 2026, it resolves roughly 70% of problems without any manual intervention. (Source: OpenClaw GitHub issue tracker, community-reported resolution rates)
If openclaw doctor --fix does not solve your problem, this guide covers every common error with specific, copy-paste fixes. Find your error below and follow the steps.
Jump to: Quick Fix · Authentication (401) · Rate Limits (429) · Context Length · Messaging Channels · Gateway & Ports · Performance · Docker · Installation · When It's Not Your Fault · FAQ
Quick Fix: openclaw doctor
Before diving into specific errors, run the built-in diagnostic tool:
openclaw doctor --fix
The --fix flag tells it to automatically repair issues instead of just reporting them. Here is what it checks and fixes:
- File permissions -- fixes read/write access on config and memory files
- Missing directories -- recreates
~/.openclaw/,~/.openclaw/memory/, and other required paths - Config validation -- checks
~/.openclaw/config.yamlfor syntax errors and missing required fields - API connectivity -- tests your model provider connection and reports specific failure reasons
- Channel health -- pings each connected messaging channel and reports disconnections
- Daemon status -- checks if the background daemon is running and restarts it if needed
# Example output with auto-fix:
OpenClaw Doctor v1.4.2 (--fix mode)
------------------------------
Config ............. FIXED: repaired YAML indentation on line 12
Permissions ........ OK
Directories ........ OK
Model provider ..... anthropic OK
API key .......... OK (tested)
Daemon ............. FIXED: restarted (was stopped)
Channels:
telegram ......... OK
whatsapp ......... WARN: session expired, re-scan needed
------------------------------
Fixed 2 issues. 1 warning requires manual action.
If openclaw doctor --fix resolves your issue, you are done. If not, find your specific error below.
Authentication Errors (401 Unauthorized)
A 401 error means your AI model API key is invalid, expired, or misconfigured. This is the single most common OpenClaw error.
Symptoms
- Error message:
401 UnauthorizedorInvalid API key - OpenClaw starts but does not respond to messages
- Logs show
model provider returned 401
Fix
# Re-authenticate with your provider
openclaw models auth setup-token
# When prompted, paste your new API key
# Then verify it works:
openclaw models test
If openclaw models test returns a successful response, your key is working. If it still fails, check these common causes:
- Expired trial key. Anthropic and OpenAI trial API keys expire after a set period or usage limit. Generate a new key from your provider's dashboard.
- Copy-paste whitespace. Extra spaces or newlines in the API key will cause authentication to fail. Re-paste the key carefully.
- Wrong provider. An Anthropic key will not work if OpenClaw is configured for OpenAI, and vice versa. Check your provider setting:
openclaw config get model.provider. - Key stored in wrong location. API keys belong in
~/.openclaw/config.yamlunder themodel.apiKeyfield. Verify the file directly if the CLI is not cooperating.
# Check the config file directly
cat ~/.openclaw/config.yaml | grep apiKey
# Should show something like:
# apiKey: sk-ant-api03-xxxxxxxxxxxx
curl -H "x-api-key: YOUR_KEY" https://api.anthropic.com/v1/messages -d '{"model":"claude-sonnet-4-5","max_tokens":10,"messages":[{"role":"user","content":"hi"}]}'. If this returns a valid response, the key is fine and the problem is in OpenClaw's configuration.
Rate Limits (429 Too Many Requests)
A 429 error means you are sending requests faster than your AI provider allows. This typically happens when OpenClaw handles many messages simultaneously or when you are on a lower-tier API plan.
Immediate Fix
Wait 60 seconds and try again. Most rate limits reset within one minute. (Source: Anthropic API documentation, rate limit reset intervals)
Permanent Fix: Configure a Fallback Model
Set up a secondary model that OpenClaw switches to automatically when the primary model is rate-limited:
# Set a fallback model
openclaw config set model.fallback openrouter/anthropic/claude-haiku-4.5
# Or set explicit rate limit handling
openclaw config set model.rateLimitRetry true
openclaw config set model.rateLimitDelay 5000
With rateLimitRetry enabled, OpenClaw waits 5 seconds (5000ms) and retries automatically instead of failing. With a fallback model configured, it switches to the cheaper/faster model during rate limit periods.
Root Causes
- Low-tier API plan. Anthropic's free tier allows 5 requests per minute. Upgrade to a paid plan for higher limits.
- Multiple channels active. If you have Telegram, WhatsApp, and Discord all forwarding messages, each one generates API requests. High-traffic channels can burn through rate limits quickly.
- Long conversations. Each message in a long conversation sends the full context to the API. More tokens per request means fewer requests allowed per minute.
Context Length Errors
This error occurs when the input (conversation history + memory + system prompt) exceeds the model's maximum token limit. For example, sending 38,000 tokens to a model with a 32,000-token limit.
Symptoms
- Error:
context_length_exceededorinput too long - Agent suddenly stops responding mid-conversation
- Auto-compaction triggers but still fails
Fix Option 1: Switch to a Larger Context Model
# Claude Sonnet 4.5 supports 200K tokens
openclaw config set model.name claude-sonnet-4-5
# GPT-4o supports 128K tokens
openclaw config set model.name gpt-4o
Fix Option 2: Reduce Loaded Skills
Every loaded skill adds to the context. If you have 15+ skills active, they can consume 10,000-20,000 tokens before any conversation even starts.
# Check active skills and their token cost
openclaw skills list --verbose
# Disable unused skills
openclaw skills disable skill-name-here
Fix Option 3: Trim Memory Files
Large memory files eat into your context budget. Check your total memory size:
openclaw memory status
# If memory is consuming >40% of context, prune it:
# Edit ~/.openclaw/MEMORY.md and remove outdated entries
Messaging Channel Issues
Telegram Not Responding
If your Telegram bot is not replying to messages, check these in order:
- Verify the bot token. Tokens can be revoked in @BotFather. Run
openclaw channels test telegramto check connectivity. - Ensure mentions are enabled. In group chats, bots only respond to @mentions by default. In BotFather, disable "Group Privacy" mode if you want the bot to read all messages.
- Check that the bot received /start. New Telegram bots require the user to send
/startbefore they can respond. This is a Telegram requirement, not an OpenClaw one. - Check the webhook URL. If you are running OpenClaw behind a reverse proxy, verify the webhook URL is accessible from the internet:
openclaw channels config telegram --show.
# Full Telegram diagnostic
openclaw channels test telegram
# Expected output:
# Token: valid
# Bot info: @YourBotName
# Webhook: active (https://...)
# Last message: 2 minutes ago
WhatsApp Connection Drops
WhatsApp Web sessions expire after approximately 14 days. This is a WhatsApp platform limitation, not an OpenClaw bug.
Fix: Re-scan the QR code:
openclaw channels login
For better stability, consider these options:
- Use the WhatsApp Business API for production use. It does not require QR code re-scanning and supports higher message volumes. The setup is more complex but significantly more reliable.
- Keep your phone connected. WhatsApp requires the primary device to be online periodically. If your phone loses internet for extended periods, the linked device session can expire faster.
- Monitor with a health check. Set up a cron job that runs
openclaw channels test whatsappevery hour and alerts you if the session drops.
Gateway & Port Problems
OpenClaw's gateway listens on port 3456 by default. If this port is blocked or already in use, the gateway will not start.
Check What is Using the Port
# Check if port 3456 is in use
lsof -i :3456
# Example output:
# COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
# node 12345 user 22u IPv4 0x1234 TCP *:3456 (LISTEN)
Fix: Change the Port
# Switch to a different port
openclaw config set gateway.port 3457
# Restart the daemon
openclaw daemon restart
Fix: Firewall Rules
If the port is not in use but the gateway still fails, your firewall may be blocking it:
- macOS: System Settings > Network > Firewall. Add an exception for OpenClaw or the Node.js binary.
- Linux (UFW):
sudo ufw allow 3456/tcp - Windows (WSL): Windows Firewall may block WSL ports. Add an inbound rule for port 3456 in Windows Defender Firewall.
Performance Issues
Too Many Skills Loaded
Each active skill adds to the system prompt, consuming tokens and increasing latency. If you have 20+ skills active, response times can noticeably degrade.
# See all active skills and their token cost
openclaw skills list --verbose
# Example output:
# ACTIVE SKILLS (23):
# calendar ~ 800 tokens
# web-search ~ 1,200 tokens
# code-runner ~ 950 tokens
# ...
# TOTAL: ~18,400 tokens (9.2% of context)
# Disable skills you don't use
openclaw skills disable skill-name
A good rule of thumb: keep active skills under 10. Disable anything you do not use at least weekly. You can always re-enable a skill when needed with openclaw skills enable skill-name.
Slow Response Times
If OpenClaw responds but takes 15-30+ seconds, the bottleneck is usually one of these:
- Large context. More tokens = slower processing. Reduce memory files and active skills.
- Slow model. Claude Opus 4.6 is significantly slower than Sonnet 4.5 or Haiku 4.5. Switch to a faster model if speed matters more than quality.
- Network latency. If you are running on a VPS far from the API provider's servers, each request has extra round-trip time. Use a VPS in the US-East region for the best latency to Anthropic and OpenAI.
- Ollama on weak hardware. Local models need substantial CPU/GPU. If your machine struggles, responses can take 60+ seconds. Upgrade hardware or switch to a cloud model.
Docker Troubleshooting
Container Keeps Crashing
# Check container logs
docker logs openclaw --tail 100
# Check container status
docker ps -a | grep openclaw
Common Docker issues:
- Missing restart policy. Add
--restart unless-stoppedto your Docker run command orrestart: unless-stoppedto your docker-compose.yml. Without this, the container stops permanently on any error. - Insufficient memory. The container needs at least 512 MB of RAM. If Docker's memory limit is too low, the Node.js process gets OOM-killed. Check with
docker stats openclaw. - Missing volume mount. If you did not mount the config directory, OpenClaw creates a fresh config on every restart, losing your API key and channel connections.
# Correct Docker Compose setup with restart policy and volumes:
services:
openclaw:
image: openclaw/openclaw:latest
restart: unless-stopped
volumes:
- ./data:/root/.openclaw
ports:
- "3456:3456"
environment:
- NODE_ENV=production
Viewing Logs
# Follow logs in real-time
docker logs -f openclaw
# Search logs for errors
docker logs openclaw 2>&1 | grep -i error
Installation Failures
Mac: Xcode Command Line Tools Missing
Some npm packages require native compilation. On Mac, this needs the Xcode Command Line Tools:
xcode-select --install
Follow the prompt to install. This downloads about 1.5 GB and takes 5-10 minutes. After installation, retry the OpenClaw install.
Windows: WSL2 Not Installed
OpenClaw does not run natively on Windows. You need WSL2 (Windows Subsystem for Linux):
# Open PowerShell as Administrator
wsl --install
# Restart your computer
# Then open the Ubuntu terminal and install OpenClaw:
curl -fsSL https://openclaw.ai/install.sh | bash
Linux: Missing build-essential
On Debian/Ubuntu systems, native module compilation requires build tools:
sudo apt update && sudo apt install -y build-essential
Then retry the OpenClaw installation.
Node.js Version Too Old
OpenClaw requires Node.js 18+. As of February 2026, Node.js 22 LTS is recommended.
# Check your version
node --version
# Upgrade on Mac
brew install node@22
# Upgrade on Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
API Key Configuration
Keys live in ~/.openclaw/config.yaml. You can set them via CLI or edit the file directly:
# Via CLI (recommended)
openclaw models auth setup-token
# Or test that your current key works
openclaw models test
# Example test output:
# Provider: anthropic
# Model: claude-sonnet-4-5
# API Key: sk-ant-***...***
# Test response: "Hello! I'm working correctly."
# Latency: 1.2s
# Status: OK
When It's Not Your Fault
Not every problem is a misconfiguration. OpenClaw is actively developed software that pushes updates frequently, and rapid updates occasionally introduce regressions.
Before spending hours debugging, check these sources:
- GitHub Issues: Search the OpenClaw issue tracker for your error message. If others are reporting the same problem, it is likely a known bug.
- GitHub Releases: Check the latest release notes. If a new version was pushed in the last 24-48 hours, it may have introduced a regression. Consider pinning to the previous stable version:
npm install -g openclaw@1.3.x. - API provider status: Anthropic, OpenAI, and OpenRouter all have status pages. If the provider is experiencing an outage, OpenClaw will fail regardless of your configuration.
- Discord community: The OpenClaw Discord server is active. Search for your error or ask -- most issues get a response within a few hours.
npm install -g openclaw@1.3.12 (replace with the actual version number). Then wait for a patch release before upgrading again. You can check available versions with npm view openclaw versions.
Quick Reference: Error-to-Fix Table
| Error | Likely Cause | Fix Command |
|---|---|---|
401 Unauthorized |
Bad API key | openclaw models auth setup-token |
429 Rate Limited |
Too many requests | Wait 60s, or add fallback model |
context_length_exceeded |
Input too large | Switch to larger model or reduce skills |
| Telegram silent | Bot needs /start | Send /start to bot in Telegram |
| WhatsApp disconnected | Session expired (~14 days) | openclaw channels login |
| Port 3456 in use | Another process on port | openclaw config set gateway.port 3457 |
| Docker crash loop | Missing restart policy | Add restart: unless-stopped |
command not found |
PATH not set | export PATH="$PATH:$(npm config get prefix)/bin" |
| Node.js too old | Version <18 | brew install node@22 |
FAQ
Why is OpenClaw not responding to messages?
OpenClaw (created by Peter Steinberger, formerly Clawdbot, then Moltbot) may not respond because the daemon is not running, your API key is invalid, or the messaging channel is disconnected. Run openclaw doctor --fix first -- it auto-detects and repairs the most common issues in about 10 seconds. As of February 2026, this resolves roughly 70% of problems automatically.
How do I fix the 401 Unauthorized error?
Run openclaw models auth setup-token and enter a fresh API key. Then verify with openclaw models test. Common causes: expired trial keys, copy-paste errors with extra whitespace, and using a key from the wrong provider (e.g., an Anthropic key with the OpenAI provider setting).
How do I fix the 429 Rate Limited error?
Wait 60 seconds and try again. For a permanent fix, configure a fallback model: openclaw config set model.fallback openrouter/anthropic/claude-haiku-4.5. You can also enable automatic retries: openclaw config set model.rateLimitRetry true.
Why does OpenClaw keep disconnecting from WhatsApp?
WhatsApp Web sessions expire after approximately 14 days. This is a WhatsApp limitation, not an OpenClaw bug. Run openclaw channels login and re-scan the QR code. For more stability, use the WhatsApp Business API instead of the linked device method.
What Node.js version does OpenClaw require?
Node.js 18 or higher. As of February 2026, Node.js 22 LTS is recommended. Check with node --version. On Mac, upgrade with brew install node@22. The one-line OpenClaw installer handles Node.js installation automatically.
Related Guides
- What Is OpenClaw? -- the full overview of features and capabilities
- How to Install OpenClaw -- step-by-step setup guide
- Best Models for OpenClaw -- choose the right model to avoid performance issues
- WhatsApp & Telegram Setup -- detailed messaging channel configuration
- OpenClaw Skills & ClawHub Guide -- browse and install 5,700+ skills
- Best OpenClaw Skills to Install First -- prioritized install order
- 7 Best OpenClaw Alternatives -- if OpenClaw isn't right for you
Install Your Chief AI Officer
Watch a hands-on walkthrough where I set up OpenClaw from scratch, troubleshoot common errors, and build a working AI assistant.
Get the Free Blueprint href="/blueprint">Watch the Free Setup Video →rarr;