1

I'm using the standalome-chrome selenium docker image and connecting from another client via the Facebook WebDriver PHP SDK. In general that works fine. But in regular intervals, I receive the following error. If I'm waiting a few minutes everything works again. Any ideas what causing this error?

An uncaught Exception was encountered

Type: Facebook\WebDriver\Exception\SessionNotCreatedExceptionMessage: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: 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.) 
Host info: host: 'f4b06faf0f6c', ip: '172.17.0.3'
Build info: version: '4.7.2', revision: '4d4020c3b7'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.0-41-generic', java.version: '11.0.17'
Driver info: driver.version: unknown
Build info: version: '4.7.2', revision: '4d4020c3b7'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.0-41-generic', java.version: '11.0.17'
Driver info: driver.version: unknownFilename: /var/www/web1/vendor/php-webdriver/webdriver/lib/Exception/WebDriverException.phpLine Number: 130
visioncode
  • 97
  • 13

1 Answers1

0

Unfortunately, the error "DevToolsActivePort file doesn't exist" is quite generic and can happen for a lot of different reasons. It would be nice to have the exact list of capabilities you use to create a session, or even better the chromedriver logs in verbose mode:

chromedriver --port=9515 --log-path=/some/path/file.log --verbose

A while back, there were issues when setting the remote-debugging-port option for example.

However, since it appears randomly in your case, one potential reason for this error is that some temporary folders do not always have proper permissions. You could try to add the following capabilities to your session creation:

{
  "capabilities": {
    "alwaysMatch": {
      "goog:chromeOptions": {
        "args": [
          "--crash-dumps-dir=/some/path/with/777/permissions"
        ]
      }
    }
  }
}

If it doesn't work, you can try to provide a specific path for the custom profile (for details, read about user-data-dir from https://chromedriver.chromium.org/capabilities)

Ben
  • 1,331
  • 2
  • 8
  • 15