运维与排障故障排查

常见问题

安装、启动与配置中的常见错误

常见问题

命令找不到(town: command not found / town: command not found

npm config get prefix
echo $PATH
export PATH=$(npm config get prefix)/bin:$PATH
rehash
town --version

或直接用:

town --version

说明:

  • towncity 来自同一个 downcity 包,但负责不同命令面。
  • 新版本安装后不应该再需要手动 chmod +x
  • 如果 sudo town ... 失败,但普通 town ... 正常,通常是 sudo 的 PATH 问题,不是安装失败。

端口冲突(5314 被占用)

lsof -nP -iTCP:5314 -sTCP:LISTEN
town agent doctor . --fix
town agent restart .

启动后无法调用 town task/chat/...

先确认 daemon 运行中:

town agent start
town plugin list

LLM 配置错误

检查:

town city status
town config get execution.modelId

并确认:

  1. execution.modelId 指向已连接 City AIService 暴露的 model id
  2. town city status 显示 City URL 和 user token 已配置
  3. City 侧 provider/model env 记录完整可用
  4. moonshot-cn 默认走 https://api.moonshot.cn/v1
  5. moonshot-ai 默认走 https://api.moonshot.ai/v1
  6. Kimi 模型名请按对应站点填写,例如 kimi-k2-0905-previewkimi-k2.5