Skip to content

FIX: Run playwright ffmpeg install as the discourse user#1059

Closed
tgxworld wants to merge 1 commit into
mainfrom
tgxworld/playwright-ffmpeg-as-discourse
Closed

FIX: Run playwright ffmpeg install as the discourse user#1059
tgxworld wants to merge 1 commit into
mainfrom
tgxworld/playwright-ffmpeg-as-discourse

Conversation

@tgxworld
Copy link
Copy Markdown
Contributor

Previously, after #1058 set ENV PLAYWRIGHT_BROWSERS_PATH=/home/discourse/.cache/ms-playwright in the release stage, the build broke because the pnpm playwright install ffmpeg step still ran as root. It created /home/discourse/.cache/ms-playwright owned by root, then the subsequent chromium install (run as the discourse user) failed with EACCES: permission denied, mkdir '__dirlock'.

This change runs the ffmpeg install with sudo -E -u discourse -H so 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 playwright step from the test workflow).

#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.
@tgxworld
Copy link
Copy Markdown
Contributor Author

Superseded — reverting #1058 first via #1060, will reintroduce both changes together once we can validate the build.

@tgxworld tgxworld closed this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant