Give the browser a writable HOME for UIDs missing from /etc/passwd.#846
Open
u1f992 wants to merge 3 commits into
Open
Give the browser a writable HOME for UIDs missing from /etc/passwd.#846u1f992 wants to merge 3 commits into
HOME for UIDs missing from /etc/passwd.#846u1f992 wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
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
HOMEenvironment value for browser processes when the existingHOMEis 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.
Co-authored-by: Akihiro Tamada <spring-raining@users.noreply.github.com>
7d50a39 to
4f5ab6d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-L224Firefoxでは
--profileに同じ一時ディレクトリを与えていますが、これとは別に~/.mozilla/firefox/profiles.iniに書き込みます。 https://github.com/mozilla-firefox/firefox/blob/d9a7ad7e3099ffe62328af33ee458054337f2cd2/toolkit/profile/nsToolkitProfileService.cpp#L996-L1005