yarn start FATAL:setuid_sandbox_host for contributors on ubuntu 24.04
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
-
Ubuntu 24.04 Release notes section "Unprivileged user namespace restrictions" describes the breaking change in security rules.
-
The resolution may be a documentation addition to CONTRIBUTING and / or implementation of one of the other options listed in the Ubuntu 24.04 Release notes.
Related
- https://github.com/electron/electron/issues/41066
cc: @AtofStryker
- PR #29458 adds documentation linking the CONTRIBUTING > Requirements section to Ubuntu 24.04 Release notes > Unprivileged user namespace restrictions describing how to disable the user namespace restrictions for the entire system as a workaround for the issue.