Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

Running in Bitbucket pipeline: --no-sandbox #51

Open
coltpini opened this issue Oct 11, 2019 · 4 comments
Open

Running in Bitbucket pipeline: --no-sandbox #51

coltpini opened this issue Oct 11, 2019 · 4 comments

Comments

@coltpini
Copy link

coltpini commented Oct 11, 2019

I am trying to run test through out pipeline in Bitbucket. I keep hitting this error:

[973:1011/205026.940590:FATAL:atom_main_delegate.cc(210)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

Is there a way to pass the --no-sandbox flag through? Or use a user other than root? Or maybe some other solution?

I tried this: adduser temp && adduser temp sudo && su - temp && yarn test
but I am the first to admit I am not a Systems person.

-- Update:
I am passed that one, but am now hitting an error that says (electron:987): Gtk-WARNING **: cannot open display: that I can't seem to get around.

-- another update:
I am passed that one, and am now hitting xhost: unable to open display ":0.0" :sigh:

@coltpini
Copy link
Author

coltpini commented Oct 14, 2019

I got passed the '--no-sandbox' error by using the a temp sudo user like above, but that wasn't quite the right script, here is the script:

script:
  # we need to get the needed libs and commands to run headless chrome / electron
  - apt-get -y update && apt-get -y install libgconf-2-4 libnss3 libgtk-3-0 libxss1 libasound2
  # we need to create a temp user to run the test because it is better to run as root, and chrome doesn't let you.
  - adduser temp && usermod -aG sudo temp
  # now we need to run the test as the new user.
  - su temp -c "yarn test-coverage --maxWorkers=4"

@skeggse
Copy link

skeggse commented May 14, 2020

Did you also find a way to pass --no-sandbox to electron, or did you just solve it with the temporary sudo user?

@coltpini
Copy link
Author

coltpini commented May 15, 2020

@skeggse I actually never got it working. We ended up having to bypass. :(

The above code bypasses the no-sandbox but there were several other layers we kept running into.

@skeggse
Copy link

skeggse commented May 15, 2020

For future reference, electron supports a ELECTRON_DISABLE_SANDBOX flag! electron/electron#16576

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants