Skip to content

fix(server): report a root preview browser as root, not AppArmor - #90

Closed
macodev00 wants to merge 762 commits into
mainfrom
cursor/preview-browser-root-diagnosis-658e
Closed

macodev00 wants to merge 762 commits into
mainfrom
cursor/preview-browser-root-diagnosis-658e

Conversation

@macodev00

Copy link
Copy Markdown
Owner

Problem

Opening a preview while the server runs as root fails because Chrome will not start its sandbox as uid 0. Playwright rewrites that abort to "Chromium sandboxing failed!", and the server reports it as an AppArmor problem. t3 browser setup then says the host is ready, so the suggested fix cannot resolve the failure.

Change

When the process uid is 0 and the sandbox is still on, launch diagnosis returns a separate root error. It names both workarounds: run the service as a nonroot User=, or set T3CODE_SERVER_BROWSER_SANDBOX=0. It does not mention AppArmor or t3 browser setup.

t3 browser setup warns about that same condition instead of saying the host is ready. A sudo invocation from a non-root user still reports ready when the AppArmor and library checks pass, because that process is root only for setup. Non-root AppArmor and library diagnosis is unchanged.

The server also logs the root warning at startup, before a tab is opened.

Scope and approval

Fixes pingdotgg#18938. The accepted scope on that issue is the root diagnosis and the setup ready message.

Verification

vp test run on:

  • apps/server/src/preview/PreviewBrowserHost.test.ts
  • apps/server/src/cli/browser.test.ts
  • apps/server/src/preview/ServerBrowserStream.test.ts

25 tests passed. A root process with the sandbox on reports the root error and does not mention AppArmor or browser setup. A non-root sandbox failure still reports AppArmor. Setup for a root service prints the warning; setup for a non-root user, and sudo setup for a non-root user, still prints ready. Server package typecheck reported no errors.

Fixes pingdotgg#18938

Model and harness: Grok 4.7 (high effort) in a Cursor Cloud Agent.

Open in Web Open in Cursor 

juliusmarminge and others added 30 commits October 10, 2026 00:36
…editor is a Windows command shim (pingdotgg#17749)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…utput (pingdotgg#17376)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… again (pingdotgg#17379)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…its thread (pingdotgg#17327)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…a check is still going (pingdotgg#17344)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Yash Singh <saiansh2525@gmail.com>
…dotgg#17223)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Yash Singh <saiansh2525@gmail.com>
…ingdotgg#17843)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…g#17724)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
… full-access MCP grants (pingdotgg#17772)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…pull request (pingdotgg#12223)

Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com>
Co-authored-by: Julius Marminge <jmarminge@gmail.com>
Signed-off-by: Loïs Postula <lois@postu.la>
Yash-Singh1 and others added 28 commits October 12, 2026 15:30
…g#18608)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…page (pingdotgg#18666)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ingdotgg#16554)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… you to a new draft (pingdotgg#18672)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ct (pingdotgg#18824)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…stead of crash-looping (pingdotgg#15925)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: PR Batch Tester <agent@local.test>
… resync after a downgrade (pingdotgg#15937)

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: PR Batch Tester <agent@local.test>
… MCP servers (pingdotgg#17058)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Yash Singh <saiansh2525@gmail.com>
…ught (pingdotgg#18887)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
…is offline (pingdotgg#18698)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…18853)

Co-authored-by: SAPHID <saphid@users.noreply.github.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
pingdotgg#18900)

Co-authored-by: Pawel Mikolajczuk <pmikolajczuk@atlassian.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Chrome refuses to start its sandbox as uid 0, and Playwright rewrites that
abort so it was diagnosed as an AppArmor failure. Name the root workarounds
instead, and make browser setup warn rather than report the host ready.
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Oct 13, 2026
@macodev00 macodev00 closed this Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Preview browser root launch failure is misreported as AppArmor while browser setup reports ready