Skip to content
This repository was archived by the owner on Jun 22, 2024. It is now read-only.
This repository was archived by the owner on Jun 22, 2024. It is now read-only.

[🐛 Bug]: selenium/node-chrome:latest error message: "Only local connections are allowed." #17

Closed
@sudo-naim

Description

@sudo-naim

What happened?

After docker-compose the yaml file published in this repo docker-compose-v3-full-grid.yml, I try to execute a test but whenever I do the browser doesn't start and i get an error.
Dependencies from my project:

            dependency 'net.bytebuddy:byte-buddy:1.10.1'
            dependency 'org.seleniumhq.selenium:selenium-java:4.4.0'
            dependency 'org.seleniumhq.selenium:selenium-api:4.4.0'
            dependency 'org.seleniumhq.selenium:selenium-remote-driver:4.4.0'
            dependency 'org.seleniumhq.selenium:selenium-support:4.4.0'
            dependency 'org.seleniumhq.selenium:selenium-chrome-driver:4.4.0'
            dependency 'org.seleniumhq.selenium:selenium-firefox-driver:3.141.59'
            dependency 'org.seleniumhq.selenium:selenium-edge-driver:3.141.59'
            dependency 'org.seleniumhq.selenium:selenium-safari-driver:3.141.59'
            dependency 'io.github.bonigarcia:webdrivermanager:5.2.3'
            dependency 'io.netty:netty-all:4.1.78.Final' 
            dependency 'io.netty:netty-buffer:4.1.78.Final'
            dependency 'io.netty:netty-codec-http:4.1.78.Final' 
            dependency 'io.netty:netty-transport-native-epoll:4.1.78.Final'
            dependency 'io.netty:netty-transport-native-kqueue:4.1.78.Final'
            dependency 'io.netty:netty-codec-socks:4.1.78.Final'
            dependency 'io.netty:netty-handler:4.1.78.Final' 
            dependency 'io.netty:netty-handler-proxy:4.1.78.Final' 
            dependency 'com.beust:jcommander:1.82' 
            dependency 'org.testng:testng:7.4.0'
            dependency 'io.qameta.allure:allure-testng:2.14.0'

ChromeOptions:

    public static ChromeOptions createChromeOptions() {
        ChromeOptions chromeOptions = new ChromeOptions();

        chromeOptions.addArguments("--disable-extensions");
        chromeOptions.addArguments("--disable-web-security");
        chromeOptions.addArguments("--ignore-certificate-errors-spki-list");
        chromeOptions.addArguments("--silent-debugger-extension-api");
        chromeOptions.addArguments("--desktop-window-1080p");
        chromeOptions.addArguments("--no-sandbox");
        chromeOptions.addArguments("--allow-no-sandbox-job");
        chromeOptions.addArguments("--disable-dev-shm-usage");
        chromeOptions.addArguments("--loading-predictor-allow-local-request-for-testing");
        chromeOptions.addArguments("--allow-insecure-localhost");

        return chromeOptions;
    }

Command used to start Selenium Grid with Docker

docker-compose -f docker-compose.yaml up  -d


# To execute this docker-compose yml file use `docker-compose -f docker-compose-v3-full-grid.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3-full-grid.yml down`
version: "3"
services:
  selenium-event-bus:
    image: selenium/event-bus:4.4.0-20220831
    container_name: selenium-event-bus
    ports:
      - "4442:4442"
      - "4443:4443"
      - "5557:5557"

  selenium-sessions:
    image: selenium/sessions:4.4.0-20220831
    container_name: selenium-sessions
    ports:
      - "5556:5556"
    depends_on:
      - selenium-event-bus
    environment:
      - SE_EVENT_BUS_HOST=selenium-event-bus
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443

  selenium-session-queue:
    image: selenium/session-queue:4.4.0-20220831
    container_name: selenium-session-queue
    ports:
      - "5559:5559"
    depends_on:
      - selenium-event-bus
    environment:
      - SE_EVENT_BUS_HOST=selenium-event-bus
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443

  selenium-distributor:
    image: selenium/distributor:4.4.0-20220831
    container_name: selenium-distributor
    ports:
      - "5553:5553"
    depends_on:
      - selenium-event-bus
      - selenium-sessions
      - selenium-session-queue
    environment:
      - SE_EVENT_BUS_HOST=selenium-event-bus
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
      - SE_SESSIONS_MAP_HOST=selenium-sessions
      - SE_SESSIONS_MAP_PORT=5556
      - SE_SESSION_QUEUE_HOST=selenium-session-queue
      - SE_SESSION_QUEUE_PORT=5559

  selenium-router:
    image: selenium/router:4.4.0-20220831
    container_name: selenium-router
    ports:
      - "4444:4444"
    depends_on:
      - selenium-distributor
      - selenium-sessions
      - selenium-session-queue
    environment:
      - SE_DISTRIBUTOR_HOST=selenium-distributor
      - SE_DISTRIBUTOR_PORT=5553
      - SE_SESSIONS_MAP_HOST=selenium-sessions
      - SE_SESSIONS_MAP_PORT=5556
      - SE_SESSION_QUEUE_HOST=selenium-session-queue
      - SE_SESSION_QUEUE_PORT=5559

  chrome:
    image: selenium/node-chrome:latest
    shm_size: 2gb
    depends_on:
      - selenium-event-bus
    environment:
      - SE_EVENT_BUS_HOST=selenium-event-bus
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443

  edge:
    image: selenium/node-edge:4.4.0-20220831
    shm_size: 2gb
    depends_on:
      - selenium-event-bus
    environment:
      - SE_EVENT_BUS_HOST=selenium-event-bus
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443

  firefox:
    image: selenium/node-firefox:4.4.0-20220831
    shm_size: 2gb
    depends_on:
      - selenium-event-bus
    environment:
      - SE_EVENT_BUS_HOST=selenium-event-bus
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443


### Relevant log output

```shell
Starting ChromeDriver 105.0.5195.19 (b9c217c128c16f53d12f9a02933fcfdec1bf49af-refs/branch-heads/5195@{#176}) on port 42468
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[1663773262.638][SEVERE]: bind() failed: Cannot assign requested address (99)
ChromeDriver was started successfully.
15:14:28.117 WARN [DriverServiceSessionFactory.apply] - 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: 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.)
Build info: version: '4.4.0', revision: 'e5c75ed026a'
System info: host: '82ba8ef3f860', ip: '172.20.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.124-linuxkit', java.version: '11.0.16'
Driver info: driver.version: unknown
15:14:28.230 WARN [SeleniumSpanExporter$1.lambda$export$1] - 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: 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.)
Build info: version: '4.4.0', revision: 'e5c75ed026a'
System info: host: '82ba8ef3f860', ip: '172.20.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.124-linuxkit', java.version: '11.0.16'
Driver info: driver.version: unknown
15:14:28.232 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: 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.)
Build info: version: '4.4.0', revision: 'e5c75ed026a'
System info: host: '82ba8ef3f860', ip: '172.20.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.124-linuxkit', java.version: '11.0.16'
Driver info: driver.version: unknown
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:144)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:102)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)
        at org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:145)
        at org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:68)
        at org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:145)
        at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:362)
        at org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:52)
        at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:68)
        at org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:64)
        at org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:86)
        at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:68)
        at org.openqa.selenium.grid.node.Node.execute(Node.java:240)
        at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)
        at org.openqa.selenium.remote.http.Route.execute(Route.java:68)
        at org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)
        at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)
        at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)
        at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)
        at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)
        at org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)

15:14:28.241 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "7af7d675b7494d27952bfcae95835005","eventTime": 1663773268121801044,"eventName": "exception","attributes": {"driver.url": "http:\u002f\u002flocalhost:42468","exception.message": "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: crashed.\n  (unknown error: DevToolsActivePort file doesn't exist)\n  (The process started from chrome location \u002fusr\u002fbin\u002fgoogle-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)\nBuild info: version: '4.4.0', revision: 'e5c75ed026a'\nSystem info: host: '82ba8ef3f860', ip: '172.20.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.124-linuxkit', java.version: '11.0.16'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: crashed.\n  (unknown error: DevToolsActivePort file doesn't exist)\n  (The process started from chrome location \u002fusr\u002fbin\u002fgoogle-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)\nBuild info: version: '4.4.0', revision: 'e5c75ed026a'\nSystem info: host: '82ba8ef3f860', ip: '172.20.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.124-linuxkit', java.version: '11.0.16'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:144)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:102)\n\tat org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:145)\n\tat org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:68)\n\tat org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:145)\n\tat org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:362)\n\tat org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:52)\n\tat org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:64)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:86)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.grid.node.Node.execute(Node.java:240)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:336)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:68)\n\tat org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:64)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)\n\tat java.base\u002fjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\n\tat java.base\u002fjava.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:829)\n","exception.type": "org.openqa.selenium.SessionNotCreatedException","logger": "org.openqa.selenium.grid.node.config.DriverServiceSessionFactory","session.capabilities": "{\"goog:chromeOptions\": {\"args\": [  \"--disable-extensions\",  \"--disable-web-security\",  \"--ignore-certificate-errors-spki-list\",  \"--silent-debugger-extension-api\",  \"--desktop-window-1080p\",  \"--no-sandbox\",  \"--allow-no-sandbox-job\",  \"--disable-dev-shm-usage\",  \"--loading-predictor-allow-local-request-for-testing\",  \"--allow-insecure-localhost\"  ],  \"extensions\": [    ]    },    \"se:noVncPort\": 7900,    \"browserName\": \"chrome\",    \"se:vncEnabled\": true    }\n"}}

15:14:28.248 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "7af7d675b7494d27952bfcae95835005","eventTime": 1663773268242742545,"eventName": "Unable to create session with the driver","attributes": {"current.session.count": 0,"logger": "org.openqa.selenium.grid.node.local.LocalNode","session.request.capabilities": "Capabilities {browserName: chrome, goog:chromeOptions: {args: [--disable-extensions, --disable-web-security, --ignore-certificate-errors..., --silent-debugger-extension..., --desktop-window-1080p, --no-sandbox, --allow-no-sandbox-job, --disable-dev-shm-usage, --loading-predictor-allow-l..., --allow-insecure-localhost], extensions: []}}","session.request.downstreamdialect": "[OSS, W3C]"}}

Operating System

macOs Moneterey | Apple M1 Pro

Docker Selenium version (tag)

4.4.0-20220831

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions