Skip to content

[Bug]: bot failed in docker container #1242

@MaojiaSheng

Description

@MaojiaSheng

Bug Description

核心问题是 server 和 bot 对 OPENVIKING_CONFIG_FILE 的处理不一致。

不一致点

  • server
    • 环境变量指定了路径但文件不存在 → 直接报错退出
    • 见 openviking_cli/utils/config/config_loader.py:47-52
  • bot
    • 环境变量指定了路径但文件不存在 → 忽略这个路径,fallback 到 ~/.openviking/ov.conf
    • 见 bot/vikingbot/config/loader.py:25-32

导致的问题

  1. 容器里明明约定配置路径是 /app/ov.conf,但 bot 自动生成时却可能写到 /root/.openviking/ov.conf
  2. entrypoint 的实际启动流程里,server 会先因为 /app/ov.conf 不存在而退出,所以 bot 自动生成配置这条路根本救不了启动
  3. 即使未来单独运行 bot,它生成的配置路径也会和容器约定路径不一致,容易造成“明明生成了配置但 server 还是找不到”的现象

最终判断

bot 自动生成配置的落点:

  • 设计预期:/app/ov.conf
  • 实际 fallback 自动生成:/root/.openviking/ov.conf

是否有 bug:

  • 是,有 bug
  • 更准确地说是:server/bot 的 config path resolution 不一致,导致容器场景下路径错位,并且当前 entrypoint 流程下缺失 /app/ov.conf 时容器会直接启动失败。

Steps to Reproduce

#1231
deploy then "ov chat"
we got
"
You: hi
Error: API error: Request failed (401 Unauthorized): {"status":"error","result":null,"error":{"code":"UNAUTHENTICATED","message":"Missing API Key","details":{}},"telemetry":null}
"

Expected Behavior

bot answers correctly

Actual Behavior

error report

Minimal Reproducible Example

Error Logs

OpenViking Version

0.3.2

Python Version

3.10

Operating System

macOS

Model Backend

None

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions