Skip to content
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]: Chrome crash running on jenkins when channel == chromium #35140

Closed
Daemos87 opened this issue Mar 11, 2025 · 11 comments
Closed

[Bug]: Chrome crash running on jenkins when channel == chromium #35140

Daemos87 opened this issue Mar 11, 2025 · 11 comments

Comments

@Daemos87
Copy link

Daemos87 commented Mar 11, 2025

Version

1.51.0

Steps to reproduce

You'll need a jenkins installation to reproduce the bug. Just create a jenkins job that clone the following repository https://github.com/Daemos87/playwright-chromium-crash-repro

and run the jenkinsfile in it.

Expected behavior

Chromium browser should run just fine in headless mode when channel = chromium

also, removing the channel config from the playwright.config resolve the issue, but my understanding is that with channel != chromium i'm using the new shell as headless browser, while i want to stick with chromium

Actual behavior

Playwright try to start the browser and i get the following error

Error: browserType.launch: Target page, context or browser has been closed
Browser logs:

<launching> /ms-playwright/chromium-1161/chrome-linux/chrome --disable-field-trial-config --disable-background-networking --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=AcceptCHFrame,AutoExpandDetailsElement,AvoidUnnecessaryBeforeUnloadCheckSync,CertificateTransparencyComponentUpdater,DeferRendererTasksAfterInput,DestroyProfileOnBrowserClose,DialMediaRouteProvider,ExtensionManifestV2Disabled,GlobalMediaControls,HttpsUpgrades,ImprovedCookieControls,LazyFrameLoading,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Translate --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 --unsafely-disable-devtools-self-xss-warnings --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-FgmzRI --remote-debugging-pipe --no-startup-window
<launched> pid=99
[pid=99][err] chrome_crashpad_handler: --database is required
[pid=99][err] Try 'chrome_crashpad_handler --help' for more information.
[pid=99][err] [99:99:0311/074723.539920:ERROR:socket.cc(120)] recvmsg: Connection reset by peer (104)
Call log:
�[2m  - <launching> /ms-playwright/chromium-1161/chrome-linux/chrome --disable-field-trial-config --disable-background-networking --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=AcceptCHFrame,AutoExpandDetailsElement,AvoidUnnecessaryBeforeUnloadCheckSync,CertificateTransparencyComponentUpdater,DeferRendererTasksAfterInput,DestroyProfileOnBrowserClose,DialMediaRouteProvider,ExtensionManifestV2Disabled,GlobalMediaControls,HttpsUpgrades,ImprovedCookieControls,LazyFrameLoading,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Translate --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 --unsafely-disable-devtools-self-xss-warnings --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-FgmzRI --remote-debugging-pipe --no-startup-window�[22m
�[2m  - <launched> pid=99�[22m
�[2m  - [pid=99][err] chrome_crashpad_handler: --database is required�[22m
�[2m  - [pid=99][err] Try 'chrome_crashpad_handler --help' for more information.�[22m
�[2m  - [pid=99][err] [99:99:0311/074723.539920:ERROR:socket.cc(120)] recvmsg: Connection reset by peer (104)�[22m

Additional context

This bug happen using the official docker image mcr.microsoft.com/playwright:v1.51.0-noble, when running on jenkins. i cannot reproduce the same error with a local run.

Environment

Jenkins is running on :
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"

Playwright version : 1.51.0

Docker image: mcr.microsoft.com/playwright:v1.51.0-noble

@agg23
Copy link
Contributor

agg23 commented Mar 11, 2025

Can you run the tests with the environment variable DEBUG=pw:browser and post the output here?

@Daemos87
Copy link
Author

Daemos87 commented Mar 11, 2025

hi @agg23 here's the output

pw:browser <launching> /ms-playwright/chromium-1161/chrome-linux/chrome --disable-field-trial-config --disable-background-networking --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=AcceptCHFrame,AutoExpandDetailsElement,AvoidUnnecessaryBeforeUnloadCheckSync,CertificateTransparencyComponentUpdater,DeferRendererTasksAfterInput,DestroyProfileOnBrowserClose,DialMediaRouteProvider,ExtensionManifestV2Disabled,GlobalMediaControls,HttpsUpgrades,ImprovedCookieControls,LazyFrameLoading,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Translate --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 --unsafely-disable-devtools-self-xss-warnings --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-KHj10C --remote-debugging-pipe --no-startup-window +0ms
  pw:browser <launched> pid=115 +4ms
  pw:browser [pid=115][err] chrome_crashpad_handler: --database is required +65ms
  pw:browser [pid=115][err] Try 'chrome_crashpad_handler --help' for more information. +0ms
  pw:browser [pid=115][err] [115:115:0311/142401.640062:ERROR:socket.cc(120)] recvmsg: Connection reset by peer (104) +0ms
  pw:browser [pid=115] <gracefully close start> +157ms
  pw:browser [pid=115] <kill> +1ms
  pw:browser [pid=115] <will force kill> +0ms
  pw:browser [pid=115] <process did exit: exitCode=null, signal=SIGTRAP> +0ms
  pw:browser [pid=115] starting temporary directories cleanup +1ms
  pw:browser [pid=115] finished temporary directories cleanup +0ms
  pw:browser [pid=115] <gracefully close end> +0ms`

it looks almost the same a before to me.

@agg23
Copy link
Contributor

agg23 commented Mar 11, 2025

Ok, thank you. Let's gather more logs then. This will have to be attached as a file.

DEBUG=pw:browser,pw:api,pw:protocol

@Daemos87
Copy link
Author

We have something more, but not that much

log.txt

@agg23 Thanks for investigating this issue.

@agg23
Copy link
Contributor

agg23 commented Mar 11, 2025

Can you try using a different base OS in Jenkins? While you are using Docker, we don't support Cent OS which you are using as your host, which possibly is causing problems.

Certain CI environments aren't set up properly to run browsers. It's possible that's what is happening here.

@Daemos87
Copy link
Author

I've tried on a containerized Jenkins on another Os and everything was fine. I will keep this bug open for a couple of days, in case someone else have the same problem, then I will close it.

Thanks for your help @agg23

@mxschmitt
Copy link
Member

Might be related to the GPU as per puppeteer/puppeteer#10283. Can you try putting

  use: {
    launchOptions: {
      args: ['--disable-gpu', '--disable-dev-shm-usage']
    }
  },

in your config's use section? (only for Chromium).

@Daemos87
Copy link
Author

Sure, here's the log

log.log

same error, and i did notice a strange thing

Image

i do not see the --disable-gpu argument i have configured

Image

@Daemos87
Copy link
Author

Hi @mxschmitt, in attachment the log file after I've merged your PR to the repro

log.log

@mxschmitt
Copy link
Member

Oh ok, maybe try these environment variables? Seems to have worked with Puppeteer. hardkoded/puppeteer-sharp#2633 (comment)

@Daemos87
Copy link
Author

That works non playwright too ! For anyone else in the same situation, just set these environment variables in your container/environment

ENV XDG_CONFIG_HOME=/tmp/.chromium
ENV XDG_CACHE_HOME=/tmp/.chromium

thanks for the help guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants