cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.12k stars 3.19k forks source link

yarn start FATAL:setuid_sandbox_host for contributors on ubuntu 24.04 #29422

Open MikeMcC399 opened 7 months ago

MikeMcC399 commented 7 months ago

Current behavior

Executing yarn start as described in the CONTRIBUTING > Getting Started section results in an error message similar to the following:

$ cypress open --dev --global [9406:0427/165943.833191:FATAL:setuid_sandbox_host.cc(158)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /home/mike/cypress/packages/electron/dist/Cypress/chrome-sandbox is owned by root and has mode 4755.

This is an issue only for Ubuntu 24.04 LTS (Noble Numbat) (also 24.04.1) and affecting only contributors, not end-users. Lower versions of Ubuntu do not exhibit this problem.

Using the npm module cypress from the npm registry together with the Cypress binary from https://download.cypress.io is not affected.

Desired behavior

Contributors of PRs to Cypress should be able to build and run Cypress from source on Ubuntu 24.04 LTS (Noble Numbat) in order to test their contributions.

yarn start should allow starting Cypress on Ubuntu 24.04 after using yarn to install dependencies and carry out a preliminary build.

Test code to reproduce

Clean install Ubuntu 24.04.1 Desktop

In a terminal window, execute the following:

sudo apt update && sudo apt upgrade -y

and reboot.

Continue with:

sudo apt install git g++ make curl
curl -L https://bit.ly/n-install | bash
. ~/.bashrc

Install Python 3.11 by executing the following commands:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.11

Add the environment variable NODE_GYP_FORCE_PYTHON to ~/.bashrc:

export NODE_GYP_FORCE_PYTHON=/usr/bin/python3.11

and execute

. ~/.bashrc

Clone and build Cypress with:

cd ~
git clone https://github.com/cypress-io/cypress --depth 1
cd cypress
n auto
npm install yarn@latest -g
yarn
yarn start

Cypress Version

First reported on version: 13.8.1 Reproducible also on version: 13.14.1

Node version

v18.17.1

Operating System

Ubuntu 24.04 LTS (Noble Numbat), 24.04.1 and Ubuntu 24.10 (Oracular Oriole)

Debug Logs

$ yarn start
yarn run v1.22.22
$ yarn ensure-deps
$ ./scripts/ensure-dependencies.sh
success Folder in sync.
$ cypress open --dev --global
[9406:0427/165943.833191:FATAL:setuid_sandbox_host.cc(158)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /home/mike/cypress/packages/electron/dist/Cypress/chrome-sandbox is owned by root and has mode 4755.

Other

Related

cc: @AtofStryker

MikeMcC399 commented 6 months ago
MikeMcC399 commented 1 week ago

electron-builder@v26.0.0-alpha.6 mentions "feat: add AppArmor profile to FPM targets to pair with afterInstall and afterRemove template scripts" however I don't know if this would fix the issue with Cypress.

Cypress currently uses "electron-builder": "^23.6.0"