xiaowei-system/skills/devops/devops-umbrella/references/openclaw/newapi-debug-checklist.md

951 B
Executable File
Raw Blame History

new-api 自检清单 (2026-05-11)

快速诊断

# 1. 进程状态
ps aux | grep newapi | grep -v grep

# 2. systemctl 状态
systemctl status newapi | head -8

# 3. 日志(如启动失败)
sudo journalctl -u newapi --no-pager -n 20

# 4. API 可用性
curl -s http://127.0.0.1:3000/props/version | head -3

# 5. 渠道状态
sqlite3 /persistent/home/muc/newapi-data/one-api.db "SELECT id, name, status, key FROM channels WHERE status=1;"

常见问题

  • systemd 启动失败:检查 journalctl 日志,可能是端口被占用(旧进程未 kill
  • API 401/403:检查 token 是否正确key 是否有变化
  • 渠道 status=2:被自动禁用,需要手动设回 status=1

重启流程

# 1. 先杀旧进程(如端口被占用)
kill $(pgrep -f "newapi.*port 3000") 2>/dev/null

# 2. systemctl 重启
sudo systemctl restart newapi

# 3. 验证
sleep 2 && systemctl status newapi | head -8