agentscope-ai / agentscope-ai/QwenPaw
[Bug]: Docker 容器内 browser_use 启动失败 —— dbus 连接错误导致 Chromium 退出
- Lingua principale
- TypeScript
- Stelle
- 35k
- Fork
- 3.1k
- Merge medio
- 1g 13h
- PR unite (30g)
- 228
Descrizione
## 问题描述
在 Docker 容器内使用 `browser_use` 工具时,Chromium 启动后因 dbus 连接失败而退出,导致 CDP 端口无法连接,工具超时报错。
## 错误日志
```
[ERROR:dbus/bus.cc:405] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
```
浏览器启动后进程立即退出,`curl http://127.0.0.1:{port}/json/version` 无法连接。
## 复现环境
- **操作系统**: Docker 容器 (Debian GNU/Linux 12)
- **Chromium 版本**: 150.0.7871.46
- **QwenPaw 版本**: 2.0.0-beta.4
- **容器特点**: 无桌面环境,无 dbus-daemon 服务
## 复现步骤
```python
# 任何 browser_use start 调用都会失败
browser_use(action="start")
# 或
browser_use(action="open", url="https://www.example.com")
```
## 预期行为
Chromium 应能在无 dbus 环境下正常启动 headless 模式。
## 分析
Chromium 在 Linux 上会尝试连接 dbus 总线用于某些系统集成(如通知、电源管理等),但在 Docker 容器中通常没有 dbus 服务。Chromium 似乎在 dbus 连接失败后直接退出,而不是降级处理。
## 建议修复方向
1. 启动参数中增加 `--no-service-autorun` 或其他抑制 dbus 依赖的 flag
2. 或者在容器环境下自动检测并设置 `DBUS_SESSION_BUS_ADDRESS=no-op`
3. 参考: Playwright 的 Docker 镜像中有类似的 dbus 兼容处理
## 影响
Docker 容器环境下完全无法使用 browser_use 工具,影响所有需要浏览器的场景(网页抓取、截图、自动化测试等)。
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start at the browser_use start/open entry points and the Chromium launch configuration, then reproduce the failure in the Debian 12 Docker environment described in the issue. Compare the available launch flags and DBus environment handling with the reported behavior, and verify that Chromium stays running and that /json/version responds on the CDP port.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, python
- Ambito
- devops, infrastructure, tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100