2

Environment:

  • Centos 7
  • GOOGLE CHROME V61
  • SELENIUM WEBDRIVER 3.5.3
  • ChromeDriver 2.30/2.32

Tried running manually running google chrome inside jenkins-slave

google-chrome --no-sandbox --disable-setuid-sandbox &

Was giving me this error:

[31339:31350:1003/144118.591084:ERROR:bus.cc(395)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[1003/144118.702053:ERROR:nacl_helper_linux.cc(310)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly

Webdriver Error Info:

Chrome failed to start: crashed
  (Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 4.4.8-20.46.amzn1.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.06 seconds
Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:42:44.417Z'
System info: host: 'jenkins-slavev2', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.8-20.46.amzn1.x86_64', java.version: '1.8.0_102'
Driver info: driver.version: ChromeDriver
Ranjith's
  • 4,508
  • 5
  • 24
  • 40

2 Answers2

2

This error message...

NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly

...implies that you have no setuid sandbox in your system, hence the program was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.


Solution

As you are seeing the error even with configuring --no-sandbox and --disable-setuid-sandbox, as per the documentation in Linux SUID Sandbox Development needs a SUID helper binary to turn on the sandbox on Linux. In majority of the cases you can install the proper sandbox for you using the command:

build/update-linux-sandbox.sh

This program will install the proper sandbox for you in /usr/local/sbin and tell you to update your .bashrc if required.

However, there can be some exceptions as an example, if your setuid binary is out of date, you will get messages such as:

Running without the SUID sandbox! 

Or

The setuid sandbox provides API version X, but you need Y
You are using a wrong version of the setuid binary!

In these cases, you need to:

  • Build chrome_sandbox whenever you build chrome (ninja -C xxx chrome chrome_sandbox instead of ninja -C xxx chrome)
  • After building, execute update-linux-sandbox.sh.

    # needed if you build on NFS!
    sudo cp out/Debug/chrome_sandbox /usr/local/sbin/chrome-devel-sandbox
    sudo chown root:root /usr/local/sbin/chrome-devel-sandbox
    sudo chmod 4755 /usr/local/sbin/chrome-devel-sandbox
    
  • Finally, you have to include the following line in your ~/.bashrc (or .zshenv):

    export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
    

tl; dr

Security Considerations - ChromeDriver - Webdriver for Chrome

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
0

There were some missing dependencies that caused this issue (https://www.centos.org/forums/viewtopic.php?t=60908&start=10)

yum install liberation-mono-fonts liberation-narrow-fonts liberation-sans-fonts liberation-serif-fonts

Installing above packages solved the problem!

Hope it helps.

Ranjith's
  • 4,508
  • 5
  • 24
  • 40