-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Description
Version
1.56.1
Steps to reproduce
I have simple docker compose service that I use to run playwright tests
services:
playwright:
image: playwright:v1.56.1
user: ${USER_ID}:${GROUP_ID}
userns_mode: host
working_dir: /app
volumes:
- .:/app
docker compose run --rm playwright /app/scripts/run_playwright_tests.sh
where script runs yarn install and playwright test
this service is designed to run both locally and via a ci pipeline on buildkite, so I pass in the USER_ID and GROUP_ID of my user to stop the playwright container from outputting files as root user onto my filesystem, this works locally just fine but when the same service runs on the buildkite agent (AWS Linux 2023 based), the dependencies finish installing but playwright test errors with:-
[WebServer] SystemError: A system error occurred: uv_os_get_passwd returned ENOENT (no
[WebServer] such file or directory)
[WebServer] Code: ERR_SYSTEM_ERROR
Error: Process from config.webServer was not able to start. Exit code: 1
I unfortunately cannot reproduce this locally. The build agent uid/gid probably don't exist in /etc/passwd but I'm not following how it manages to run yarn install and playwright test without hitting permission errors in that case (if i try and run it locally as a user not in /etc/passwd then yarn install fails immediately:
groups: cannot find name for group ID 1234
I have no name!@fad3990404dc:/app$ yarn install
➤ YN0065: Yarn will periodically gather anonymous telemetry: https://yarnpkg.com/advanced/telemetry
➤ YN0065: Run yarn config set --home enableTelemetry 0 to disable
Internal Error: EACCES: permission denied, mkdir '/.yarn'
Error: EACCES: permission denied, mkdir '/.yarn'
I have no name!@fad3990404dc:/app$
I have seen other bugs that are marked as fixed where people complained about the same issue with jenkins docker agents: #22721 but this seems to be fixed.
Additionally in my case it seems like the issue is caused by not allowing the container to run as root, because if I do run it as root on the buildkite agent it works as expected (but then is awkward to use locally as the output files are owned by root).
The impression I got from this question: #28427 and the paragraph here was that it is fine to run the playwright container as a non-root user- is this not the case?
Expected behavior
playwright tests run as a non-root user inside the docker compose service
Actual behavior
works locally, but when same config is run on a buildkite agent it errors
Additional context
No response
Environment
System:
OS: Linux 6.6 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
CPU: (22) x64 Intel(R) Core(TM) Ultra 7 155H
Memory: 13.65 GB / 15.35 GB
Container: Yes
Binaries:
Node: 22.20.0 - /usr/bin/node
Yarn: 1.22.22 - /usr/bin/yarn
npm: 10.9.3 - /usr/bin/npm
Languages:
Bash: 5.2.21 - /usr/bin/bash