🔧 OpenClaw 常见问题排查手册

凌晨3点,你的 Agent 突然罢工了。别慌,这篇手册就是你的救命稻草。实战问题,逐一击破。

📋 快速导航

📥 安装问题

Q: npm install -g openclaw 失败?

# 清除缓存重试 npm cache clean --force npm install -g openclaw@latest # 如果权限不够 sudo npm install -g openclaw@latest # 或者用 pnpm pnpm install -g openclaw@latest

Q: 启动报 "command not found"?

# 检查安装路径 which openclaw npm list -g openclaw # 手动添加到 PATH export PATH="$PATH:$(npm prefix -g)/bin" echo 'export PATH="$PATH:$(npm prefix -g)/bin"' >> ~/.bashrc

🌐 Gateway 问题

Q: Gateway 启动后无法连接?

# 检查 Gateway 状态 openclaw gateway status # 查看日志 journalctl -u openclaw -f # 检查端口占用 lsof -i :3000 # 重启 Gateway openclaw gateway restart

Q: 配置修改后不生效?

# 热重载(推荐) openclaw gateway reload # 完全重启 openclaw gateway restart # 验证配置 openclaw config validate

🧩 Skill 问题

Q: Skill 安装后不生效?

# 1. 刷新 Skill 列表 openclaw skills refresh # 2. 检查 Skill 状态 openclaw skills check # 3. 重启 Gateway openclaw gateway restart

Q: Skill 执行超时?

# 调整超时设置 openclaw config set skills.timeout 120000 # 或在 SKILL.md 中指定 timeout: 120s

🤖 模型调用问题

Q: API 调用返回 429 Rate Limit?

# 配置自动重试 openclaw config set models.retry.maxAttempts 5 openclaw config set models.retry.backoffMs 2000 # 配置模型降级 openclaw config set models.fallback.enabled true openclaw config set models.fallback.chain "gpt-4o,claude-sonnet,gemini-pro"

Q: 响应质量下降?

# 查看当前模型配置 openclaw config get models # 调整温度 openclaw config set models.temperature 0.7 # 使用更强的模型 openclaw config set models.default "claude-opus-4"

🌍 网络问题

Q: 中国大陆访问 ClawHub 慢?

# 配置镜像源 openclaw config set registry.mirror "https://clawhub-mirror.example.com" # 或使用代理 export HTTPS_PROXY=http://127.0.0.1:7890

⚡ 性能问题

Q: Agent 响应变慢?

# 查看性能指标 openclaw status --verbose # 清理缓存 openclaw cache clear # 减少并发 openclaw config set concurrency.max 5 # 启用响应缓存 openclaw config set cache.enabled true
💡 定期备份 ~/.openclaw/ 目录,特别是 agents/config/ 子目录。