[Bug]: Hardened docker-compose (read_only) keeps full Chromium from starting: crashpad needs a writable ~/.config
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 70/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- docker, docker-compose
- 领域
- devops, infrastructure
调研方向
从 environment: 列表开始(位于 x-base-config 中,文件为 docker-compose.yml),issue 建议在此添加 XDG_CONFIG_HOME=/tmp/.config。同时检查同一文件中的只读和 tmpfs 设置,并确认 XDG_CACHE_HOME 保持未设置。当启动时 docker compose logs crawl4ai 不再显示 "Full Chromium failed" 这一行,即为完成。
由索引模型根据 Issue 内容生成。
描述
crawl4ai version
0.9.5 Docker image with PR #2448 backported, run with the hardened docker-compose.yml (same file on v0.9.5 and develop: read_only: true, tmpfs list).
Expected Behavior
With #2448 (merged into develop on 2026-10-26), the hardened compose launches full Chromium, which is the fix for #2382.
Current Behavior
In the hardened container, full Chromium dies at launch:
[BROWSER]. ℹ Full Chromium failed to start (BrowserType.launch: Target page, context or browser has been closed); falling back to chrome-headless-shell, which can behave differently. Run 'crawl4ai-setup' to install full Chromium.
The #2448 fallback then starts chrome-headless-shell, so with the official compose the server keeps running the shell and #2382 stays unfixed in practice.
The warning's advice also misleads here: full Chromium is already in the image (chromium-1248).
Root cause: Chromium's crash handler (crashpad) keeps its database under the XDG config directory ($HOME/.config/google-chrome-for-testing/Crash Reports), even when --user-data-dir points elsewhere, as Playwright's does.
The read-only root filesystem leaves $HOME/.config unwritable.
Run by hand in the container with a user data dir under /tmp, the bundled browser fails the same way:
$ /home/appuser/.cache/ms-playwright/chromium-1248/chrome-linux64/chrome --headless=new --no-sandbox --user-data-dir=/tmp/udd --dump-dom about:blank
chrome_crashpad_handler: --database is required
Trace/breakpoint trap
Is this reproducible?
Yes
Steps to Reproduce
# From a develop checkout (#2448 included); the compose file has a build: section.
docker compose up -d --build
docker compose logs crawl4ai | grep "Full Chromium failed"
The line appears at boot, since the server starts its default browser at startup.
Suggested fix
Give Chromium a writable config directory, for example by adding to the environment: list of x-base-config in docker-compose.yml:
- XDG_CONFIG_HOME=/tmp/.config
With it, full Chromium starts: chromium-1248/chrome-linux64/chrome runs, crashpad uses --database=/tmp/.config/google-chrome-for-testing/Crash Reports, and no fallback line is logged.
XDG_CACHE_HOME must stay unset, as Playwright looks for its browsers under ~/.cache/ms-playwright (see also #2027 for the same read-only constraint).
Alternatives, not tested: an ENV XDG_CONFIG_HOME=/tmp/.config line in the Dockerfile (would also cover docker run --read-only), or a tmpfs entry - /home/appuser/.config:uid=999,gid=999,mode=0700.
OS
Linux (Docker on WSL2)
Python version
3.12 (image)
Browser
Chromium bundled with Playwright 1.64
Browser version
156.0.8078.4
- 主要语言
- Python
- 星标
- 86.8k
- 派生
- 9k
- 平均合并
- 2 天 3 小时
- 30 天内合并 PR
- 26
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
unclecode/crawl4ai 的其他 Issue
-
⚙ Done ✨ Enhancement
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 2 天内回复
-
⚙ Done 🐞 Bug 📌 Root caused
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
[Bug]: PDF images saved with save_images_locally=True come back with an empty src in result.media可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭🐞 Bug 🩺 Needs Triage
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
🐞 Bug 🩺 Needs Triage
难度 2/5 1-3 小时 新手友好度 85/100
unclecode/crawl4ai#2416 · 2 条评论 ·
维护者通常 2 天内回复
-
⚙ Done 🐞 Bug
难度 2/5 1-3 小时 新手友好度 72/100
unclecode/crawl4ai#2382 · 2 条评论 ·
维护者通常 2 天内回复
查看 unclecode/crawl4ai 的全部 Issue
相似的 Issue
-
Remove the `pull_request_target` workflow before GitHub blocks it可能已有人在做 @jat255 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
IBM/mcp-context-forge#7483 ·
维护者通常 2 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 78/100
-
[Bug Report]: OpenAI 辅助 API 连通性测试因输出上限仅 1 token 误报“未知错误”可能已有人在做 @fjfanjian 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
Project-N-E-K-O/N.E.K.O#3640 ·
维护者通常 1 天内回复
-
author-page correction
难度 2/5 1-3 小时 新手友好度 64/100
acl-org/acl-anthology#10808 · 1 条评论 ·
维护者通常 1 天内回复