Chrome failed to start in docker container using Selenium after upgrading to ChromeDriver v80 and Chrome v80 Chrome failed to start in docker container using Selenium after upgrading to ChromeDriver v80 and Chrome v80 google-chrome google-chrome

Chrome failed to start in docker container using Selenium after upgrading to ChromeDriver v80 and Chrome v80


This error message...

[13:51:36] E/launcher - unknown error: Chrome failed to start: crashed.  (unknown error: DevToolsActivePort file doesn't exist)  (The process started from chrome location /opt/google/chrome/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'System info: host: '8bc3b606ae46', ip: 'XXX.XX.X.X', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.76-linuxkit', java.version: '1.8.0_242'Driver info: driver.version: unknownremote stacktrace: #0 0x5584b6f867a9 <unknown>

...implies that the ChromeDriver v80.0 was unable to initiate/spawn a new Browsing Context with in Docker image for Chrome (80.0).


As per the discussion WebDriver 80.0.3987.16 can't open Chrome on Linux @triciac mentioned that, the implementation of ChromeDriver v80.0 looks for Chrome in the following order:

  1. locations->push_back(base::FilePath("/usr/local/sbin"));
  2. locations->push_back(base::FilePath("/usr/local/bin"));
  3. locations->push_back(base::FilePath("/usr/sbin"));
  4. locations->push_back(base::FilePath("/usr/bin"));
  5. locations->push_back(base::FilePath("/sbin"));
  6. locations->push_back(base::FilePath("/bin"));
  7. locations->push_back(base::FilePath("/opt/google/chrome")); // last try with the default installation location.

@johnchen confirmed that, the binary search order on Linux was accidentally changed by r708243, which was intended to make it easier to configure the name of the Chrome binary, but accidentally changed the search order as well.

ChromeDriver team have updated ChromeDriver to fix this issue through this revision / commit.


Solution

The above mentioned solution is available with:


Interim solution

An interim solution would be using the binary_location attribute and you can find a detailed discussion in Selenium: WebDriverException:Chrome failed to start: crashed as google-chrome is no longer running so ChromeDriver is assuming that Chrome has crashed