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]: Electron fails to launch on ubuntu-latest #34251

Closed
bhbs opened this issue Jan 8, 2025 · 3 comments
Closed

[Bug]: Electron fails to launch on ubuntu-latest #34251

bhbs opened this issue Jan 8, 2025 · 3 comments

Comments

@bhbs
Copy link

bhbs commented Jan 8, 2025

Version

1.49.1

Steps to reproduce

Reproduction:

jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4

      - run: npm ci
      - run: npx playwright install --with-deps
      - run: npx --yes envinfo --preset playwright
      - run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test
const { _electron: electron } = require("playwright");
const { test } = require("@playwright/test");

test("LAUNCH", async () => {
  await electron.launch({ args: ["main.js"] });
});
const { app, BrowserWindow } = require("electron");

function createWindow() {
  const mainWindow = new BrowserWindow();
  mainWindow.loadFile("index.html");
}

app.whenReady().then(() => {
  createWindow();
});

Expected behavior

Launch successfully

Actual behavior

Error: Process failed to launch!

Additional context

Following the solution introduced in #11932 (comment) , I am trying to launch Playwright using xvfb-run.
I apologize, as the implementation of Playwright should not be the problem, but I am looking for a new solution.

Environment

System:
    OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
    CPU: (2) x64 AMD EPYC 7763 64-Core Processor
    Memory: 6.85 GB / 7.75 GB
    Container: Yes
  Binaries:
    Node: 20.18.1 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
  Languages:
    Bash: 5.2.21 - /usr/bin/bash
  npmPackages:
    @playwright/test: ^1.49.1 => 1.49.1 
    playwright: ^1.49.1 => 1.49.1
@Skn0tt
Copy link
Member

Skn0tt commented Jan 8, 2025

Playwright's own CI is also seeing this. Most likely related to electron/electron#42510 and GH Actions changes.

@agg23
Copy link
Contributor

agg23 commented Jan 9, 2025

See #34238. The ubuntu-latest tag was changed to point to Ubuntu 24.04 and has caused regressions. If you're encountering the same issue then sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 will fix Electron for you.

@bhbs
Copy link
Author

bhbs commented Jan 9, 2025

Confirmed! Thank you! 😀

- run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npx playwright test

@bhbs bhbs closed this as completed Jan 9, 2025
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