docker-selenium icon indicating copy to clipboard operation
docker-selenium copied to clipboard

[🐛 Bug]: Standalone cannot create session

Open ow-sam opened this issue 1 year ago • 1 comments

What happened?

I have been trying to connect to the selenium/chrome-standalone docker container, and it is having trouble creating sessions. I keep getting the following error.

The code that is generating this error is the following:

options = Options()
options.set_capability("goog:loggingPrefs", {"performance": "ALL"})
options.add_argument("--headless")
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")

driver = webdriver.Remote("http://chrome:4444/wd/hub", options=options)

I tried using different versions of selenium/chrome-standalone and using the node/hub containers instead of the standalone. Any suggestions?

Command used to start Selenium Grid with Docker (or Kubernetes)

services:
  chrome:
    platform: linux/x86_64
    hostname: chrome
    image: selenium/standalone-chrome:4.22.0-20240621
    shm_size: 2gb
    privileged: true
  datafetcher:
    build: .
    depends_on:
      - chrome

Relevant log output

21:02:35.263 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "18a8e2283000ca2a77b5526145bdce62","eventTime": 1719867755250989883,"eventName": "exception","attributes": {"exception.message": "Unable to create session: 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: session not created: Chrome failed to start: crashed.\n  (disconnected: unable to connect to renderer)\n  (The process started from chrome location \u002fusr\u002fbin\u002fgoogle-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) \nHost info: host: 'chrome', ip: '172.19.0.2'\nBuild info: version: '4.22.0', revision: 'c5f3146703'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'\nDriver info: driver.version: unknown\nBuild info: version: '4.22.0', revision: 'c5f3146703'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: 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: session not created: Chrome failed to start: crashed.\n  (disconnected: unable to connect to renderer)\n  (The process started from chrome location \u002fusr\u002fbin\u002fgoogle-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) \nHost info: host: 'chrome', ip: '172.19.0.2'\nBuild info: version: '4.22.0', revision: 'c5f3146703'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'\nDriver info: driver.version: unknown\nBuild info: version: '4.22.0', revision: 'c5f3146703'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.31-linuxkit', java.version: '17.0.11'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:221)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:71)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:652)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:571)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:834)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:791)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n\tat java.base\u002fjava.lang.Thread.run(Unknown Source)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--headless, --no-sandbox, --disable-dev-shm-usage], extensions: []}, goog:loggingPrefs: {performance: ALL}, pageLoadStrategy: normal}]"}}

Operating System

macOS

Docker Selenium version (image tag)

4.22.0-20240621

Selenium Grid chart version (chart version)

No response

ow-sam avatar Jul 01 '24 21:07 ow-sam