Skip to content

Give the browser a writable HOME for UIDs missing from /etc/passwd.#846

Open
u1f992 wants to merge 3 commits into
mainfrom
fix/browser-writable-home
Open

Give the browser a writable HOME for UIDs missing from /etc/passwd.#846
u1f992 wants to merge 3 commits into
mainfrom
fix/browser-writable-home

Conversation

@u1f992

@u1f992 u1f992 commented Jun 24, 2026

Copy link
Copy Markdown
Member

closes: #835

補足として、Puppeteerはtempdir基準の--user-data-dirをChromeに与えており、多くの一時ファイルはここに作成されます https://github.com/puppeteer/puppeteer/blob/puppeteer-core-v25.1.0/packages/puppeteer-core/src/node/BrowserLauncher.ts#L490-L496

ただしクラッシュレポートは意図的にHOMEに収められており、ここで問題になります。 https://github.com/chromium/chromium/blob/e44bf5d2837ae8a8b51feb6025022cfc81bf3865/chrome/common/chrome_paths.cc#L216-L224

Firefoxでは--profileに同じ一時ディレクトリを与えていますが、これとは別に~/.mozilla/firefox/profiles.iniに書き込みます。 https://github.com/mozilla-firefox/firefox/blob/d9a7ad7e3099ffe62328af33ee458054337f2cd2/toolkit/profile/nsToolkitProfileService.cpp#L996-L1005

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses browser launch failures in container environments where the running UID has no /etc/passwd entry, causing HOME to be unset or default to an unwritable path (notably breaking Chromium crash dump/profile writes and Firefox profile metadata writes).

Changes:

  • Sets a fallback HOME environment value for browser processes when the existing HOME is not writable on Linux.
  • Adds a helper to detect whether a given directory path is writable.
  • Introduces a changeset to publish the fix as a patch release.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/browser.ts Adds Linux-only logic to ensure Puppeteer-launched browsers receive a writable HOME.
.changeset/browser-writable-home.md Declares a patch release note for the browser HOME fallback behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/browser.ts Outdated
Comment thread src/browser.ts
Comment thread src/browser.ts
Comment thread src/browser.ts
@u1f992 u1f992 force-pushed the fix/browser-writable-home branch from 7d50a39 to 4f5ab6d Compare July 6, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cache paths are not writable for non-default user IDs in the Docker image

3 participants