简体   繁体   中英

RHEL 8 - Selenium unknown error: Chrome failed to start: crashed

Error

I see:

/opt/narjetas/node_modules/selenium-webdriver/lib/error.js:524
    let err = new ctor(data.message)
              ^

WebDriverError: unknown error: Chrome failed to start: crashed.
  (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.)
    at Object.throwDecodedError (/opt/narjetas/node_modules/selenium-webdriver/lib/error.js:524:15)
    at parseHttpResponse (/opt/narjetas/node_modules/selenium-webdriver/lib/http.js:587:13)
    at Executor.execute (/opt/narjetas/node_modules/selenium-webdriver/lib/http.js:515:28)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  remoteStacktrace: '#0 0x564c9d0c4463 <unknown>\n' +
    '#1 0x564c9ce888d8 <unknown>\n' +
    '#2 0x564c9ceb0b6a <unknown>\n' +
    '#3 0x564c9ceabc05 <unknown>\n' +
    '#4 0x564c9ceef802 <unknown>\n' +
    '#5 0x564c9ceef2af <unknown>\n' +
    '#6 0x564c9cee7443 <unknown>\n' +
    '#7 0x564c9ceb83c5 <unknown>\n' +
    '#8 0x564c9ceb9531 <unknown>\n' +
    '#9 0x564c9d116dce <unknown>\n' +
    '#10 0x564c9d11a192 <unknown>\n' +
    '#11 0x564c9d0fb93e <unknown>\n' +
    '#12 0x564c9d11b103 <unknown>\n' +
    '#13 0x564c9d0eed85 <unknown>\n' +
    '#14 0x564c9d13c0a8 <unknown>\n' +
    '#15 0x564c9d13c239 <unknown>\n' +
    '#16 0x564c9d157492 <unknown>\n' +
    '#17 0x7f6d909171cf start_thread\n'
}

System is RHEL 8, running in headless mode. This runs without issue on Windows. I have triple checked the chromedriver version and my browser version and they match. The error generates on this line:

    let driver = new Builder()
    .forBrowser('chrome')
    .setChromeOptions(new chrome.Options().headless().windowSize(screen))
    .build();

System Info

It is running on top of nodejs.

Chrome version:

[grant@lab backend]$ google-chrome --version
Google Chrome 107.0.5304.87

I am using this version of chromedriver (the minor versions don't match but they shouldn't need to and this did not present any issues on Windows - there is no Chromedriver for the current minor version afaik)

在此处输入图像描述

Permissions

Permissions for chromedriver are 755 and it is running as user (grant)

This isn't the right answer, but if someone else comes here stuck, I just swapped Chrome for Firefox and it worked like a champ out of the box.

    console.log("BUILD 1");
    let driver = new Builder()
    .forBrowser('firefox')
    .setFirefoxOptions(new firefox.Options().headless().windowSize(screen))
    .build();

That was the only change I had to make and it came up immediately.

I had the same issue, but resolved it by installing Java openjdk

yum install java-1.8.0-openjdk-1.8.0.322.b06 -y

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM