Having trouble starting Google Chrome version 61 in CentOS 7 with Selenium WebDriver?

System Information:

  • Operating System: Centos 7
  • Browser: GOOGLE CHROME V61
  • Automation Tool: SELENIUM WEBDRIVER 3.5.3
  • Driver: ChromeDriver 2.30/2.32

Attempted to run Google Chrome manually inside Jenkins slave environment

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

Encountered the following 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

Error Details from Webdriver:

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

Answer №1

If you encounter this particular error message...

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

...it indicates that your system lacks a setuid sandbox, causing the program to fail in starting or creating a new Browsing Context, which is essentially a Chrome Browser session.


Resolution

Even after trying to configure with --no-sandbox and --disable-setuid-sandbox, if the issue persists, the documentation in Linux SUID Sandbox Development states that requires a SUID helper binary to activate the sandbox on Linux. In most cases, you can rectify this by executing:

build/update-linux-sandbox.sh

This script will install the appropriate sandbox in /usr/local/sbin and prompt you to update your .bashrc file if needed.

However, there may be exceptions such as outdated setuid binaries leading to errors like:

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 scenarios, follow these steps:

  • Compile chrome_sandbox whenever building chrome (
    ninja -C xxx chrome chrome_sandbox
    instead of ninja -C xxx chrome)
  • Post compilation, run update-linux-sandbox.sh.

    # necessary for building 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
    
  • Lastly, 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

Answer №2

After investigating further, it became evident that some dependencies were missing and causing the issue ()

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

The problem was resolved by installing the aforementioned packages!

Hopefully this information proves helpful.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips on scraping content with no identifiable attributes in Selenium using Python

Looking to extract electricity prices data from the following website: . When trying to locate the web elements for the date and price, this is the structure: The first date: td class="row-name ng-binding ng-scope" ng-if="tableData.dataType ...

Easy inquiry regarding locating elements with Selenium's 'find_element_by_XPath' method

Recently, I started learning Python and decided to challenge myself by creating a bank automation script with the following credentials: I attempted to use the code below to input the login ID, but encountered the following error message: driver.find_elem ...

How to locate the position of an element within the HTML tag using Selenium in Python

I am currently attempting to locate an index or a similar function. My goal is to search for a specific word and then click on the link right below it that corresponds to the word after it. If my explanation is unclear, I apologize - I can provide an ima ...

How come the ExpectedConditions invisibilityOfElementLocated method succeeds when using the element ID but fails when using the Classname for the preloader?

My current task involves waiting for the preloader to appear on a website. I have been utilizing ExpectedConditions.invisibilityOfElementLocated, but initially when I tried locating the preloader by its class name "DarkBg", the explicit wait did not wait f ...

Issue of ElementNotVisibleException can occur in Selenium WebDriver when the browser window is not maximized

My current challenge involves using Firefox and Selenium WebDriver to input a search query into the search bar on the Boerse Frankfurt website. I have successfully located the element on the webpage using methods like find_element_by_name or find_element_ ...

Is it possible to refresh data efficiently using web scraping tools, similar to how it

While researching web scraping in Python, I consistently found references to BeautifulSoup and Selenium as the primary tools for retrieving HTML and JavaScript content from websites. One thing that has eluded me is finding a method to automatically update ...

My application server is indicating that ports 80 and 443 are already in use, however, when checking with the command `netstat -nlp`, it

Attempting to launch my Express server on ports 80 and 443 results in an error stating that they are already in use. EADDRINUSE err Despite this, my Ubuntu server indicates that ports 80 and 443 are not occupied: ubuntu@ip-182-47-78-432:~$ sudo netstat ...

Obtain the driver session ID in Karate for recording videos

Looking to incorporate video recording into Karate. The tool I'm using needs the session id to download the recorded video. Is there a built-in function in Karate that can retrieve this session id? ...

What is the best way to combine FOR and while loops for efficient coding?

I have successfully implemented the code below, but I encountered an issue after adding the WHILE loop to capture all information on the page. Now, I'm facing a problem where the code stops working, and I need guidance on how to execute the code afte ...

Dealing with Page Timeouts in Selenium using Python without Triggering an Error

There has been much discussion about timeouts and handling page loads in the context of Selenium. However, most of the methods mentioned do not seem to be effective when using chromedriver. Additionally, the solutions that do work are not quite what I am ...

Using Selenium to search DuckDuckGo and locate the URL

My current project involves creating a program that navigates to duckduckgo.com, searches for the best hotel in India on the search bar, finds my website link, and finally clicks on it. from time import sleep from selenium import webdriver import time from ...

Notification: The specific HTML element identified as <div id="tabber_obj_0_div_3" class="ptr"> cannot be smoothly brought into view by scrolling

I am currently working on extracting book reviews from a specific URL using web scraping techniques. My goal is to gather the book name and each review in separate rows. Here's the code snippet I have written so far, which utilizes both selenium and b ...

Effective strategies for organizing Selenium RC tests into modular components

Currently, I am challenged with re-factoring my Selenium RC test scripts written in Visual Studio using C#. All my tests are currently located within a single file, and I am seeking advice, recommendations, or resources on how to modularize these tests eff ...

What is the process for clicking a button in Selenium Python that lacks a "select" tag and only becomes clickable after fulfilling certain conditions?

Currently, I am working on automating the process of downloading files. To locate these files, I need to interact with two dropdown menus: one named 'Select Period' where I choose a date, and the other named 'Select File Type' where I s ...

Selenium PhantomJS: Opening Multiple Windows and Loading Pages Simultaneously

Is there a way to use selenium to open multiple web pages at once in separate windows? When using the get command in Selenium, it waits for the onload event before proceeding. However, I am looking for a method to start loading the page and continue witho ...

Navigating to Chromium Browser using ChromeDriver and Python on Linux operating system

I'm curious about something. I am currently using a chromedriver, but PyCharm keeps opening Chromium instead of Chrome when I run my test. Is there a way to change this behavior? Can I set it in my code somewhere? def setUp(self) self.driver ...

Is there a way for Selenium to simulate clicking a button using specific x and y coordinates

After successfully detecting the button's x and y coordinates using the opencv function matchTemplate(), I am now wondering how can I interact with the button by clicking on it based on its precise position? ...

Selenium explicit waits failing while time.sleep proves effective

As a newcomer to using selenium, I am attempting to refresh the page once the list has loaded. The HTML code is as follows: <span class="" title="Refresh"> <button class="MuiButtonBase-root MuiButton-root MuiButton-text ...

Utilizing Apache POI in Java Selenium for Combining Two Rows from an Excel Spreadsheet

I have been using the code provided in this reference link to extract data from an Excel file and utilize it for searching on Google. However, instead of inputting one row at a time into the search box as intended with the For loop, the program is combinin ...

Two WebDriver instances have been initialized

I am relatively new to utilizing Selenium and Java, and I am currently working on implementing the POM-PageFactory model. In my testng method, I have encountered an issue where two instances of WebDriver are being launched. My setup includes a BaseClass t ...