fix(sandbox): pass OPENCLAW_BROWSER_NO_SANDBOX=1 to browser container#29879
fix(sandbox): pass OPENCLAW_BROWSER_NO_SANDBOX=1 to browser container#29879obviyus merged 1 commit intoopenclaw:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 720c68e683
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // Chromium's setuid/namespace sandbox cannot work inside Docker containers | ||
| // (PID namespace creation requires privileges Docker does not grant by default). | ||
| // The container itself provides isolation, so --no-sandbox is safe here. | ||
| args.push("-e", "OPENCLAW_BROWSER_NO_SANDBOX=1"); |
There was a problem hiding this comment.
Bump browser config hash when forcing no-sandbox
Adding OPENCLAW_BROWSER_NO_SANDBOX=1 only affects newly created containers, but ensureSandboxBrowser reuses existing containers unless the computed config hash changes; this commit neither adds the new env flag to the hash input nor bumps SANDBOX_BROWSER_SECURITY_HASH_EPOCH, so upgraded installs with an existing openclaw-sbx-browser-* container will keep the old env and continue failing to start Chromium until a manual recreate is run.
Useful? React with 👍 / 👎.
Greptile SummaryFixes Chromium startup failure in Docker by passing
Confidence Score: 5/5
Last reviewed commit: 720c68e |
720c68e to
c947ac4
Compare
fa37f06 to
239fe73
Compare
|
Correction: merge SHA for land report is |
* main: (31 commits) fix(browser): resolve correct targetId in navigate response after renderer swap (openclaw#25326) fix: sed escaping and UID mismatch in Podman Quadlet setup (openclaw#26414) fix(cron): pass heartbeat target=last for main-session cron jobs (openclaw#28508) (openclaw#28583) fix(cron): disable messaging tool when delivery.mode is none (openclaw#21808) (openclaw#21896) fix: clear delivery routing state when creating isolated cron sessions (openclaw#27778) fix(cron): avoid marking queued announce paths as delivered (openclaw#29716) fix(cron): enable completion direct send for text-only announce delivery (openclaw#29151) fix(cron): force main-target system events onto main session (openclaw#28898) fix(cron): condition requireExplicitMessageTarget on resolved delivery (openclaw#28017) feat(cron): add --account flag for multi-account delivery routing (openclaw#26284) fix: schedule nextWakeAtMs for isolated sessionTarget cron jobs (openclaw#19541) fix: sandbox browser docker no-sandbox rollout (openclaw#29879) (thanks @Lukavyi) GitHub: add regression bug issue template and routing (openclaw#29864) thanks @Takhoffman feat(feishu): add chat info/member tool (openclaw#14674) feat(feishu): add markdown tables, positional insert, color_text, and table ops (openclaw#29411) feat(feishu): add parent/root inbound context for quote support (openclaw#18529) fix: land android onboarding and voice reliability updates (openclaw#29796) fix(android-voice): rotate playback token per assistant reply fix(android-voice): retry talk config after transient failures fix(android-voice): cancel in-flight speech when speaker muted ...
@Lukavyi) # Conflicts: # src/agents/sandbox/browser.ts # src/agents/sandbox/constants.ts
@Lukavyi) # Conflicts: # src/agents/sandbox/browser.ts # src/agents/sandbox/constants.ts
Summary
Sandbox browser Chromium fails to start in Docker because the setuid/namespace sandbox requires privileges that Docker containers do not grant by default (PID namespace creation fails with
EPERM).The entrypoint (
sandbox-browser-entrypoint.sh) already supports theOPENCLAW_BROWSER_NO_SANDBOXenv var to pass--no-sandboxto Chromium, butensureSandboxBrowser()inbrowser.tsnever passed it to the container.Changes
OPENCLAW_BROWSER_NO_SANDBOX=1env var when creating the sandbox browser Docker containerWhy
--no-sandboxis safe hereThe Docker container itself provides process isolation. This is standard practice for headless Chromium in Docker — Playwright, Puppeteer, and Selenium all use
--no-sandboxin containerized environments.Testing
bash scripts/sandbox-browser-setup.shdocker rm -f $(docker ps -aq --filter name=openclaw-sbx-browser)Before fix:
No usable sandbox!error, container exits with code 1, CDP never reachableAfter fix: Chromium starts, CDP reachable, browser tool works
Fixes #28870