FIX: Run playwright ffmpeg install as the discourse user#1059
Closed
tgxworld wants to merge 1 commit into
Closed
Conversation
#1058 added `ENV PLAYWRIGHT_BROWSERS_PATH=/home/discourse/.cache/ms-playwright` to the `release` stage. The subsequent `pnpm playwright install ffmpeg` still ran as root, which created `/home/discourse/.cache/ms-playwright` owned by root and caused the discourse-user chromium install that follows to fail with `EACCES: permission denied, mkdir '__dirlock'`. This commit runs the ffmpeg install with `sudo -E -u discourse -H` so the cache directory is created owned by the discourse user and remains writable by the subsequent chromium install.
Contributor
Author
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.
Previously, after #1058 set
ENV PLAYWRIGHT_BROWSERS_PATH=/home/discourse/.cache/ms-playwrightin thereleasestage, the build broke because thepnpm playwright install ffmpegstep still ran as root. It created/home/discourse/.cache/ms-playwrightowned by root, then the subsequent chromium install (run as the discourse user) failed withEACCES: permission denied, mkdir '__dirlock'.This change runs the ffmpeg install with
sudo -E -u discourse -Hso the cache directory is owned by the discourse user from the start. Both playwright installs now share the same cache path with the right ownership.Failing build: https://github.com/discourse/discourse_docker/actions/runs/26201953575
Paired change: discourse/discourse#40214 (drops the now-redundant
Install playwrightstep from the test workflow).