Skip to content

Attempting to run tests in Chrome in mcr.microsoft.com/playwright:focal result in error : Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory #8968

@richardjharding

Description

@richardjharding
  • Playwright Version: 1.14.1 (npm)

System:

  • OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa)
  • Memory: 2.69 GB / 25.01 GB
  • Container: Yes

Binaries:

  • Node: 14.17.6 - /usr/bin/node
  • Yarn: 1.22.11 - /usr/bin/yarn
  • npm: 6.14.15 - /usr/bin/npm

Languages:

  • Bash: 5.0.17 - /usr/bin/bash

I'm attempting to use the docker image recommended to run tests in an azure devops pipeline but I'm unable to run the tests against Chrome

I pulled the mcr.microsoft.com/playwright:focal image and ran locally having followed the node getting started instructions to create a simple typescript test

Running npx playwright install works correctly but
Running npx playwright test results in the error below
Running npx playwright test --browser firefox does work as expected

This looks like an issue with the docker image and chrome but I wondered if there are any work arounds?

The error seems to be with a missing dbus package and daemon?

The error

Running 1 test using 1 worker

  ✘  tests/foo.spec.ts:3:1 › basic test (274ms)


  1) tests/foo.spec.ts:3:1 › basic test ============================================================

    browserType.launch: Protocol error (Browser.getVersion): Browser closed.
    ==================== Browser output: ====================
    <launching> /ms-playwright/chromium-907428/chrome-linux/chrome --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 --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 --user-data-dir=/tmp/playwright_chromiumdev_profile-ad5ETZ --remote-debugging-pipe --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --no-startup-window
    <launched> pid=150
    [pid=150][err] [0916/150354.338950:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
    =========================== logs ===========================
    <launching> /ms-playwright/chromium-907428/chrome-linux/chrome --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 --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 --user-data-dir=/tmp/playwright_chromiumdev_profile-ad5ETZ --remote-debugging-pipe --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --no-startup-window
    <launched> pid=150
    [pid=150][err] [0916/150354.338950:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
    ============================================================

        at Object._baseTest.extend.browser.scope [as fn] (/tmp/node_modules/@playwright/test/lib/test/index.js:117:40)
        at Fixture.setup (/tmp/node_modules/@playwright/test/lib/test/fixtures.js:73:73)
        at FixtureRunner.setupFixtureForRegistration (/tmp/node_modules/@playwright/test/lib/test/fixtures.js:312:5)
        at Fixture.setup (/tmp/node_modules/@playwright/test/lib/test/fixtures.js:58:19)
        at FixtureRunner.setupFixtureForRegistration (/tmp/node_modules/@playwright/test/lib/test/fixtures.js:312:5)
        at Fixture.setup (/tmp/node_modules/@playwright/test/lib/test/fixtures.js:58:19)
        at FixtureRunner.setupFixtureForRegistration (/tmp/node_modules/@playwright/test/lib/test/fixtures.js:312:5)
        at FixtureRunner.resolveParametersAndRunHookOrTest (/tmp/node_modules/@playwright/test/lib/test/fixtures.js:297:23)
        at WorkerRunner._runTestWithBeforeHooks (/tmp/node_modules/@playwright/test/lib/test/workerRunner.js:426:7)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions