1

On my Mac, I built image with FROM selenium/standalone-chrome-debug:3.4.0-chromium in Dockerfile.

When I run my app in the container, I got:

org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.19.76-linuxkit x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.13 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'a45e0250acbf', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.76-linuxkit', java.version: '1.8.0_121'
Driver info: driver.version: ChromeDriver

Image built in Jenkins with same Dockerfile run same application, it has no issue. Both chromedriver=2.29.461571.

I have setup remote debug and want to debug on my macos before I push to Jenkins/linux, but blocked by this chrome failed to start: exited abnormally in container on macos.

Why this happens on my macos but not in Jenkins/Linux and how to fix it?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
gxu
  • 21
  • 4

1 Answers1

0

This error message...

org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
  (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.19.76-linuxkit x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.13 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'a45e0250acbf', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.76-linuxkit', java.version: '1.8.0_121'
Driver info: driver.version: ChromeDriver

...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context 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.29
  • Release Notes of chromedriver=2.29 clearly mentions the following :

Supports Chrome v56-58

  • Presumably you are using the latest chrome=85.0
  • Release Notes of ChromeDriver v85.0 clearly mentions the following :

Supports Chrome version 85

So there is a clear mismatch between ChromeDriver v2.40 and the Chrome Browser v85.0


Solution

Ensure that:

  • JDK is upgraded to current levels JDK 8u252.
  • Selenium is upgraded to current released Version 3.141.59.
  • ChromeDriver is updated to current ChromeDriver v85.0 level.
  • Chrome is updated to current Chrome Version 85.0 level. (as per ChromeDriver v85.0 release notes)
  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • Take a System Reboot.
  • Execute your @Test as non-root user.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Thank you for looking into. My chrome version is 58, it is supported by chromedriver=2.29. Note this set works in Jenkins but not my Mac container.Neverless – gxu Sep 21 '20 at 21:09
  • Build the latest selenium/node-chrome-debug, chrome version is 85 now but I got org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'b7da3083cde9', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.76-linuxkit', java.version: '1.8.0_265' – gxu Sep 21 '20 at 21:20
  • Many people are having this issue, I have tried all suggestions, but still get same error. Here are my options: options.addArguments("--headless"); options.addArguments("--no-sandbox"); options.addArguments("--disable-dev-shm-usage"); options.addArguments("--disable-setuid-sandbox"); options.addArguments("--remote-debugging-port=5005"); – gxu Sep 21 '20 at 21:22
  • @gxu To address `unknown error: DevToolsActivePort file doesn't exist` error see [this](https://stackoverflow.com/questions/50642308/webdriverexception-unknown-error-devtoolsactiveport-file-doesnt-exist-while-t/50642913#50642913), [this](https://stackoverflow.com/questions/50790733/unknown-error-devtoolsactiveport-file-doesnt-exist-error-while-executing-selen/50791503#50791503) and [this](https://stackoverflow.com/questions/58189108/tests-fail-immediately-with-unknown-error-devtoolsactiveport-file-doesnt-exist/58192582#58192582) discussion. – undetected Selenium Sep 21 '20 at 21:24
  • I checked above, also added options.setBinary("/usr/bin/google-chrome"); the /usr/bin/google-chrome exists, still get same error – gxu Sep 21 '20 at 23:28