ray
ray

Reputation: 933

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally with ChromeDriver Chrome and Selenium

I am trying to run a webscraper on a linux server. The full error is below

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally 
(Driver info: chromedriver=2.10.267518,platform=Linux 4.4.0-141-generic x86_64)

I have seen similar questions asked on stackoverflow, the solutions are to include the '--headless' and '--no-sandbox' arguments. However, I am already doing this.

I am able run this code locally, however, I am unable to make it work on the server.

I have also checked to see that everything is up to date, and everything is.

ChromeDriver 2.10.267518
selenium     3.141.0

Here is the code snippet where the error occurs.

options.add_argument('--headless')
options.add_argument('--no-sandbox')

caps = DesiredCapabilities.CHROME
caps['loggingPrefs'] = {'performance': 'ALL'}

driver = webdriver.Chrome(options=options, desired_capabilities=caps, executable_path='/usr/local/bin/chromedriver')

I have also tried to run the above code without the executable_path option but I still get the same error.

Upvotes: 3

Views: 1974

Answers (2)

ray
ray

Reputation: 933

I was using a config file that was setting the header value to True, so the code was trying to run with a browser and failing. This was a stupid mistake but I'm posting the solution anyway in case it helps someone.

I also had to remove the line below

options.add_argument('--no-sandbox')

and change this line

options.add_argument('--headless')

to

options.add_argument('headless')

Upvotes: 2

undetected Selenium
undetected Selenium

Reputation: 193058

This error message...

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally 
(Driver info: chromedriver=2.10.267518,platform=Linux 4.4.0-141-generic x86_64)

...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.

Your main issue is the incompatibility between the version of the binaries you are using as follows:

  • You are using chromedriver=2.10
  • Release Notes of chromedriver=2.10 clearly mentions the following :

Supports Chrome v33-36

  • Possibly you are using the latest chrome=72.0
  • Release Notes of ChromeDriver v2.46 clearly mentions the following :

Supports Chrome v71-73

So there is a clear mismatch between the ChromeDriver v2.10 and the Chrome Browser v72.0


Solution

  • Upgrade ChromeDriver to current ChromeDriver v2.46 level.
  • Keep Chrome version between Chrome v71-73 levels. (as per ChromeDriver v2.45 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test.

Upvotes: 1

Related Questions