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] Segmentation fault when launching inside aws lambda docker image #70

Closed
Myztiq opened this issue Mar 15, 2023 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@Myztiq
Copy link

Myztiq commented Mar 15, 2023

Environment

  • chromium Version: 111.0.0"
  • playwright Version: 1.31.0
  • Node.js Version: 18.x
  • Lambda / GCF Runtime: nodejs18.x

Expected Behavior

Browser launch should not trigger a segfault

Current Behavior

When trying to launch the browser it crashes with:

browserType.launch: Browser closed.
        ==================== Browser output: ====================
        <launching> /tmp/chromium --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 --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 --allow-running-insecure-content --autoplay-policy=user-gesture-required --disable-background-timer-throttling --disable-component-update --disable-domain-reliability --disable-features=AudioServiceOutOfProcess,IsolateOrigins,site-per-process --disable-ipc-flooding-protection --disable-print-preview --disable-dev-shm-usage --disable-setuid-sandbox --disable-site-isolation-trials --disable-speech-api --disable-web-security --disk-cache-size=33554432 --enable-features=SharedArrayBuffer --hide-scrollbars --ignore-gpu-blocklist --in-process-gpu --mute-audio --no-default-browser-check --no-first-run --no-pings --no-sandbox --no-zygote --use-gl=angle --use-angle=swiftshader --window-size=1920,1080 --single-process --user-data-dir=/tmp/playwright_chromiumdev_profile-kPCJGx --remote-debugging-pipe --no-startup-window
        <launched> pid=42
        [pid=42][err] qemu: uncaught target signal 11 (Segmentation fault) - core dumped
        =========================== logs ===========================
        <launching> /tmp/chromium --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 --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 --allow-running-insecure-content --autoplay-policy=user-gesture-required --disable-background-timer-throttling --disable-component-update --disable-domain-reliability --disable-features=AudioServiceOutOfProcess,IsolateOrigins,site-per-process --disable-ipc-flooding-protection --disable-print-preview --disable-dev-shm-usage --disable-setuid-sandbox --disable-site-isolation-trials --disable-speech-api --disable-web-security --disk-cache-size=33554432 --enable-features=SharedArrayBuffer --hide-scrollbars --ignore-gpu-blocklist --in-process-gpu --mute-audio --no-default-browser-check --no-first-run --no-pings --no-sandbox --no-zygote --use-gl=angle --use-angle=swiftshader --window-size=1920,1080 --single-process --user-data-dir=/tmp/playwright_chromiumdev_profile-kPCJGx --remote-debugging-pipe --no-startup-window
        <launched> pid=42
        [pid=42][err] qemu: uncaught target signal 11 (Segmentation fault) - core dumped
        ============================================================

Steps to Reproduce

https://github.com/Myztiq/lambda-playwright-chromium-crash

  1. docker build --platform linux/x86_64 . -t lambda-test
  2. docker run --platform linux/x86_64 -p 9000:8080 lambda-test
  3. In another terminal window curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -H 'Content-Type: application/json' -d {}

I looked through playwright's version support and it looks like we should be locking it to 1.31.0 as that was tested agains Chromium 111.0.5563.19 and stable Google Chrome 110. I'm trying to get my lambdas updated to node 18 and I can no longer use chrome-aws-lambda to do that.

I should add that I can get everything to work when I don't use docker, but I am running into an issue that can only be reproduced on the remote lambda server so I need to get this running in docker to be able to reproduce and debug locally.

@Myztiq Myztiq added the bug Something isn't working label Mar 15, 2023
@Myztiq Myztiq changed the title [BUG] Segmentation fault when launching inside aws lambda docker image locally [BUG] Segmentation fault when launching inside aws lambda docker image Mar 15, 2023
@Myztiq
Copy link
Author

Myztiq commented Mar 15, 2023

Based on some reading docker/for-mac#6204 seems to be the issue. Once Sparticuz/chrome-aws-lambda#11 is there this should get resolved which relies on aws/aws-lambda-base-images#59 .

I'll close the ticket for now.

@Myztiq Myztiq closed this as completed Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant