New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Getting argument list too long while launching chrome using playwright test #30659
Comments
What is the content of I tried it on my machine inside Docker and with How did you install Google Chrome? |
Build
App container
I used the chrome installed on linux and copied to /usr/bin/chrome path and accessed from there didnt run npx playwright install chrome As you mentioned if we do npx playwright install chrome - does it install chrome/edge, i thought its just installing chromium |
You can use the cli to also install a stable browser, see here: https://playwright.dev/docs/browsers#google-chrome--microsoft-edge Could you try that and see if it works? |
yes, i used the cli to install chrome and point there in linux amd as shown in Docker script above, but it failed with above error if i do |
I'm not an expert in how Google Chrome is packaged on Linux, but I feel like this is not supported:
since Google Chrome depends on many packages and has more than these files placed on your system, this won't work. Have you tried doing Re above:
|
thanks, whats the path where chrome gets installed once we use npx playwright install chrome in Linux and Mac |
On Linux probably in /opt/ and on macOS under /Applications - when you use channels, we automatically lookup the right path for you: https://playwright.dev/docs/api/class-testoptions#test-options-channel As a user, you only need to do npx playwright install chrome and set the channel to "chrome". Curios why you need the path - maybe I'm missing something! |
i am using build and app step in my Docker file, where build will have install permissions and app will just run the tests. Instead of copying whole build inside app, just wanted to copy minimum required files to app, and then run the container |
Yeah this is not supported, browsers require a lot of system dependencies, they won't run on a stock Ubuntu, since the dependencies are not satisfied. So you cannot simply copy a few files in order to make browsers like WebKit/Chromium/Firefox work. See here on how to install the system dependencies. We recommend using our Docker image since it has all these system dependencies installed (for all the browsers): |
chrome got launched from the path you suggested, but throws Invalid file descriptor to ICU data received.
|
Cpuld you provide a full minimal reproduction / your dockerfile which we can run locally? |
|
Copying browsers is not supported (as per #30659 (comment) and #30659 (comment)), the following would work for you: ## BUILD CONTAINER
FROM mcr.microsoft.com/playwright:v1.43.1-focal AS build-only
WORKDIR /app
COPY . .
RUN npm install -g [email protected]
RUN npm ci
## APP CONTAINER
FROM mcr.microsoft.com/playwright:v1.43.1-focal
COPY --from=build-only /app/src /app/src/
COPY --from=build-only /app/node_modules /app/node_modules/
COPY --from=build-only /app/package.json /app/
COPY --from=build-only /app/playwright.config.ts /app/
COPY --from=build-only /app/tsconfig.json /app/
WORKDIR /app
RUN npx playwright install chrome
CMD npm run test Probably not worth splitting it up into two containers for end-to-end tests. |
chromium build works fine with this docker, but chrome channel still breaks on test run |
We need more information to act on this issue. I would recommend to use a single container, since both of your containers are based on the same image anyways. The following is what I tried which works for me: ## BUILD CONTAINER
FROM mcr.microsoft.com/playwright:v1.43.1-focal AS build-only
WORKDIR /app
COPY . .
RUN npm install -g [email protected]
RUN npm ci
RUN npx playwright install chrome
CMD npx playwright test Please provide us a reproduction which we can run locally with expected / actual outcomes. |
Closing per the response above, feel free to open a new issue if it doesn't work. |
Version
1.42.1
Steps to reproduce
Install chrome latest (124) on Docker file using base image playwright jammy 1.42.1
Run the container to trigger test scripts
Not sure if this is related to playwright or chrome
2024-05-04T17:31:21+10:00 [chrome] › tests/example.spec.ts:3:5 › has title ───────────────────────────────────────────────
2024-05-04T17:31:21+10:00 1 failed
2024-05-04T17:31:21+10:00
2024-05-04T17:31:21+10:00
2024-05-04T17:31:21+10:00 - [pid=55][err] /opt/google/chrome/chrome: line 46: /usr/bin/cat: Success
2024-05-04T17:31:21+10:00 - [pid=55][err] /opt/google/chrome/chrome: line 45: /usr/bin/cat: Success
2024-05-04T17:31:21+10:00 - [pid=55][err] /opt/google/chrome/chrome: line 45: /usr/bin/cat: Argument list too long
2024-05-04T17:31:21+10:00 - [pid=55][err] /opt/google/chrome/chrome: line 46: /usr/bin/cat: Argument list too long
2024-05-04T17:31:21+10:00 - [pid=55] finished temporary directories cleanup
2024-05-04T17:31:21+10:00 - [pid=55] starting temporary directories cleanup
2024-05-04T17:31:21+10:00 - [pid=55]
2024-05-04T17:31:21+10:00 - pid=55
2024-05-04T17:31:21+10:00 - /opt/google/chrome/chrome --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate,HttpsUpgrades,PaintHolding --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --disable-search-engine-choice-screen --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-XXXXXX6A6qi7 --remote-debugging-pipe --no-startup-window
Expected behavior
Test should pass
Actual behavior
Chrome launch failed
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: