Closed gauravgandhi1315 closed 2 years ago
This might be a duplicate of #12075. Firefox would not launch using the Docker image. It was fixed in 1.19.1.
The problem was that for Firefox there is now an extra dependency needed,
@daddyman Im running on chromium and not using Docket image. Locally it runs fine on chromium but on Jenkins. it is not running and i see browserType.launch:
without any error
@gauravgandhi1315 If you use 1.19.1 does it fix it?
Im using 1.19.0
let me try with 1.19.1
@daddyman Same error with 1.19.1
I have tried to add executablePath
as PLAYWRIGHT_BROWSERS_PATH=/jenkins/.cache/ms-playwright/*
but getting this error
browserType.launch: Failed to launch: Error: spawn /jenkins/.cache/ms-playwright/ EACCES
Your Jenkins machine is missing some dependencies. The error message has a suggestion of what you should add to your Jenkins pipeline before running Playwright:
Host system is missing a few dependencies to run browsers.
Please install them with the following command:
sudo npx playwright install-deps
<3 Playwright Team
@dgozman It doesn't say that anymore after I added executablePath
look at the last comment
Well, I guess there is nothing at that PLAYWRIGHT_BROWSERS_PATH
location? I strongly suggest to let Playwright handle the browsers path itself, and just install the dependencies with sudo npx playwright install-deps
.
@daddyman Im running in enterprise jenkins and sudo npx playwright install-deps
ask for password which I can't enter. Not sure how to handle it and Im using location of PLAYWRIGHT_BROWSERS_PATH
where it was downloaded. Look below:
Playwright build of chromium v965416 downloaded to /jenkins/.cache/ms-playwright/chromium-965416 Playwright build of ffmpeg v1007 downloaded to /jenkins/.cache/ms-playwright/ffmpeg-1007 Playwright build of firefox v1316 downloaded to /jenkins/.cache/ms-playwright/firefox-1316 Playwright build of webkit v1609 downloaded to /jenkins/.cache/ms-playwright/webkit-1609
I have been stuck with this issue for very long time. I would really appreciate if you can help me.
But the original issue is with dependencies, not with the actual browsers. Browsers on linux do not work without dependencies installed.
Try running npx playwright install-deps
without a sudo
- perhaps you don't need sudo on your Jenkins machine?
Alternatively, run npx playwright install-deps --dry-run
. This will print the dependencies that are required for Playwright browsers to run. You can then add them to your Jenkins machine/image by any other means you prefer, instead of running install-deps
command.
I hope this helps!
@dgozman yes, originally I was getting npx playwright install-deps
but then I added executablePath
and Im seeing a different error now. Look below complete logs:
Running 1 test using 1 worker 17:58:26 17:58:27 ��� [chromium] ��� src/ui/specs/simulationPage.spec.js:5:3 ��� Output Edit ��� Simulations page (29ms) 17:58:31 17:58:31 17:58:31 1) [chromium] ��� src/ui/specs/simulationPage.spec.js:5:3 ��� Output Edit ��� Simulations page = 17:58:31 17:58:31 browserType.launch: Failed to launch: Error: spawn /jenkins/.cache/ms-playwright EACCES 17:58:31 =========================== logs =========================== 17:58:31 <launching> /jenkins/.cache/ms-playwright --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,AcceptCHFrame,AutoExpandDetailsElement --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-GYvdXv --remote-debugging-pipe --no-startup-window 17:58:31 [pid=N/A] starting temporary directories cleanup 17:58:31 [pid=N/A] finished temporary directories cleanup 17:58:31 ============================================================ 17:58:31 17:58:31 at Object._baseTest.extend.browser.scope [as fn] (/jenkins/workspace/0006172_home_cei-automation_main/node_modules/@playwright/test/lib/index.js:163:51) 17:58:31 at /jenkins/workspace/0006172_home_cei-automation_main/node_modules/@playwright/test/lib/fixtures.js:78:81 17:58:31 at Object.dynatraceRegularInvoke [as doInvoke] (/apps/dynatrace-One/agent/bin/1.219.162.20210726-100948/any/nodejs/nodejsagent.js:2882:20) 17:58:31 at Object.b.safeInvoke (/apps/dynatrace-One/agent/bin/1.219.162.20210726-100948/any/nodejs/nodejsagent.js:2954:29) 17:58:31 at /apps/dynatrace-One/agent/bin/1.219.162.20210726-100948/any/nodejs/nodejsagent.js:7364:25 17:58:31 17:58:31 17:58:31 1 failed 17:58:31 [chromium] ��� src/ui/specs/simulationPage.spec.js:5:3 ��� Output Edit ��� Simulations page == 17:58:31 npm ERR! code ELIFECYCLE 17:58:31 npm ERR! errno 1 17:58:31 npm ERR! playwright@1.0.0 test-galileo-chrome:
PLAYWRIGHT_BROWSERS_PATH=/jenkins/.cache/ms-playwright npx playwright test --workers=1 --project=chromium 17:58:31 npm ERR! Exit status 1 17:58:31 npm ERR! 17:58:31 npm ERR! Failed at the playwright@1.0.0 test-galileo-chrome script. 17:58:31 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Context:
Describe the bug I have
playwright_download_host=https://.../repository/playwright-raw-proxy
in.npmrc
file and downloading is working fine.Jenkins error