Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: SessionNotCreatedException Warnings Periodically Against node-chrome and node-firefox Docker Containers #1992

Closed
garth-gross opened this issue Nov 2, 2023 · 10 comments

Comments

@garth-gross
Copy link

What happened?

When running tests in parallel, we are periodically seeing org.openqa.selenium.SessionNotCreatedException warnings in the log as sessions are not created for the following reason:

Could not start a new session. Unable to obtain: Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 119.0, moz:debuggerAddress: true, pageLoadStrategy: normal, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, firefox, --output, json, --browser-version, 119.0, --debug]

I can replicate this with the following project that leverages PyTest to parallelize 10 instances of a browser opening a webpage and validating a single attribute:

SeleniumFailurePOC.zip

Pre-Req:

  1. Python 3.11 is installed (I used 3.11.6, other versions may work)
  2. Docker needs to be installed
  3. If hub is not being run on localhost:4444, open Resources/Standard_Fixtures.py and make a change on line 20 to point to the correct location of the hub.

Duplication (from the extracted directory):

  1. Run docker compose up -d --scale firefox=10 --scale chrome=10
  2. Run python -m pip install -r requirements.txt to install required libraries for this PoC:
    1. Pytest 7.4.3
    2. Selenium 4.15.1
    3. pytest-xdist 3.3.1
  3. Run pytest -n 10 --b chrome Tests for running the suite against Chrome
  4. Run pytest -n 10 --b firefox Tests for running the suite against Firefox

Result: In my testing, I am getting at least 1 failure in every 5 runs against both Chrome and Firefox. It is often more frequent than that.

Other notes:

  1. In the attached .zip file, there is a logs directory that has ALL output for all the containers I was able to replicate this with as well as isolated logging for the hub and browser containers that reported an issue.
  2. This has been happening for the last couple versions (4.13/4.14 at least) of hub + node-{browsers}. The issue seems to be getting worse though as the number of broken tests due to SessionNotCreatedException is sometimes exceeding 200 out of the ~5000 tests that are run nightly
  3. Issue happens nightly against our main Selenium grid docker instance running on Ubuntu 22.04.3 LTS. Issue is also replicated on my local Docker Desktop installation on macOS 14.0 (intel).

Command used to start Selenium Grid with Docker

services:
  firefox:
    image: selenium/node-firefox:119.0
    depends_on:
      - hub
    networks:
      - grid
    environment:
      SE_EVENT_BUS_HOST: hub
      SE_EVENT_BUS_PUBLISH_PORT: 4442
      SE_EVENT_BUS_SUBSCRIBE_PORT: 4443
      SE_OPTS: --log-level ALL
  chrome:
    image: selenium/node-chrome:119.0
    depends_on:
      - hub
    environment:
      SE_EVENT_BUS_HOST: hub
      SE_EVENT_BUS_PUBLISH_PORT: 4442
      SE_EVENT_BUS_SUBSCRIBE_PORT: 4443
      SE_OPTS: --log-level ALL
    networks:
      - grid
  hub:
    image: selenium/hub:4.15.0
    environment:
      SE_OPTS: --log-level ALL
    ports:
      - "4442:4442"
      - "4443:4443"
      - "4444:4444"
    networks:
      - grid

networks:
  grid:


command:
docker compose up -d --scale firefox=10 --scale chrome=10

Relevant log output

21:48:45.444 DEBUG [SeleniumSpanExporter$1.lambda$export$4] - SpanData{spanContext=ImmutableSpanContext{traceId=10595ec9e1f71314f0ef55d262a6add6, spanId=166faa79928db064, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, parentSpanContext=ImmutableSpanContext{traceId=10595ec9e1f71314f0ef55d262a6add6, spanId=7ef20d70658371f3, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=true, valid=true}, resource=Resource{schemaUrl=https://opentelemetry.io/schemas/1.20.0, attributes={service.name="unknown_service:java", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.28.0"}}, instrumentationScopeInfo=InstrumentationScopeInfo{name=default, version=null, schemaUrl=null, attributes={}}, name=httpclient.execute, kind=INTERNAL, startEpochNanos=1698961724485000000, endEpochNanos=1698961725443781566, attributes=AttributesMap{data={span.kind=client, http.target=/se/grid/node/session, http.status_code=200, http.method=POST}, capacity=128, totalAddedValues=4}, totalAttributeCount=4, events=[], totalRecordedEvents=0, links=[], totalRecordedLinks=0, status=ImmutableStatusData{statusCode=OK, description=Kind: OK Description:}, hasEnded=true}
21:48:45.446 DEBUG [SeleniumSpanExporter$1.lambda$export$4] - SpanData{spanContext=ImmutableSpanContext{traceId=10595ec9e1f71314f0ef55d262a6add6, spanId=7ef20d70658371f3, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, parentSpanContext=ImmutableSpanContext{traceId=10595ec9e1f71314f0ef55d262a6add6, spanId=97e6f6311338e95e, traceFlags=01, traceState=ArrayBasedTraceState{entries=[]}, remote=false, valid=true}, resource=Resource{schemaUrl=https://opentelemetry.io/schemas/1.20.0, attributes={service.name="unknown_service:java", telemetry.sdk.language="java", telemetry.sdk.name="opentelemetry", telemetry.sdk.version="1.28.0"}}, instrumentationScopeInfo=InstrumentationScopeInfo{name=default, version=null, schemaUrl=null, attributes={}}, name=distributor.new_session, kind=INTERNAL, startEpochNanos=1698961724442195901, endEpochNanos=1698961725445716807, attributes=AttributesMap{data={error=true}, capacity=128, totalAddedValues=1}, totalAttributeCount=1, events=[ImmutableEventData{name=Session request received by the Distributor, attributes={logger="org.openqa.selenium.grid.distributor.local.LocalDistributor", request.payload="[Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, pageLoadStrategy: normal}]"}, epochNanos=1698961724442422110, totalAttributeCount=2}, ImmutableEventData{name=exception, attributes={exception.message="Unable to create session: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 119.0, moz:debuggerAddress: true, pageLoadStrategy: normal, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, firefox, --output, json, --browser-version, 119.0, --debug]

Build info: version: '4.14.1', revision: '03f8ede370'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.16-linuxkit', java.version: '11.0.20.1'
Driver info: driver.version: unknown 
Host info: host: '904f275bc4b1', ip: '172.29.0.3'
Build info: version: '4.14.1', revision: '03f8ede370'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.16-linuxkit', java.version: '11.0.20.1'
Driver info: driver.version: unknown
Build info: version: '4.14.1', revision: '03f8ede370'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.16-linuxkit', java.version: '11.0.20.1'
Driver info: driver.version: unknown", exception.stacktrace="org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 119.0, moz:debuggerAddress: true, pageLoadStrategy: normal, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, firefox, --output, json, --browser-version, 119.0, --debug]

Build info: version: '4.14.1', revision: '03f8ede370'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.16-linuxkit', java.version: '11.0.20.1'
Driver info: driver.version: unknown 
Host info: host: '904f275bc4b1', ip: '172.29.0.3'
Build info: version: '4.14.1', revision: '03f8ede370'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.16-linuxkit', java.version: '11.0.20.1'
Driver info: driver.version: unknown
Build info: version: '4.14.1', revision: '03f8ede370'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.16-linuxkit', java.version: '11.0.20.1'
Driver info: driver.version: unknown
	at org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:151)
	at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:644)
	at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:563)
	at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:823)
	at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:783)
	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)
", exception.type="org.openqa.selenium.SessionNotCreatedException", logger="org.openqa.selenium.grid.distributor.local.LocalDistributor", request.payload="[Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, pageLoadStrategy: normal}]"}, epochNanos=1698961725445704908, totalAttributeCount=5}], totalRecordedEvents=2, links=[], totalRecordedLinks=0, status=ImmutableStatusData{statusCode=ERROR, description=Kind: ABORTED Description:}, hasEnded=true}
21:48:45.447 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "10595ec9e1f71314f0ef55d262a6add6","eventTime": 1698961724442422110,"eventName": "Session request received by the Distributor","attributes": {"logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, pageLoadStrategy: normal}]"}}

21:48:45.447 WARN [SeleniumSpanExporter$1.lambda$export$1] - Unable to create session: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 119.0, moz:debuggerAddress: true, pageLoadStrategy: normal, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, firefox, --output, json, --browser-version, 119.0, --debug]

Build info: version: '4.14.1', revision: '03f8ede370'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.16-linuxkit', java.version: '11.0.20.1'
Driver info: driver.version: unknown 
Host info: host: '904f275bc4b1', ip: '172.29.0.3'
Build info: version: '4.14.1', revision: '03f8ede370'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.16-linuxkit', java.version: '11.0.20.1'
Driver info: driver.version: unknown
Build info: version: '4.14.1', revision: '03f8ede370'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.16-linuxkit', java.version: '11.0.20.1'
Driver info: driver.version: unknown
21:48:45.448 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 119.0, moz:debuggerAddress: true, pageLoadStrategy: normal, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, firefox, --output, json, --browser-version, 119.0, --debug]

Build info: version: '4.14.1', revision: '03f8ede370'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.16-linuxkit', java.version: '11.0.20.1'
Driver info: driver.version: unknown 
Host info: host: '904f275bc4b1', ip: '172.29.0.3'
Build info: version: '4.14.1', revision: '03f8ede370'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.16-linuxkit', java.version: '11.0.20.1'
Driver info: driver.version: unknown
Build info: version: '4.14.1', revision: '03f8ede370'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.4.16-linuxkit', java.version: '11.0.20.1'
Driver info: driver.version: unknown
	at org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:151)
	at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:644)
	at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:563)
	at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:823)
	at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:783)
	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)

Operating System

Ubuntu 22.04.3 LTS, macOS 14.0 (intel)

Docker Selenium version (tag)

4.15.0

Copy link

github-actions bot commented Nov 2, 2023

@garth-gross, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@garth-gross garth-gross changed the title [🐛 Bug]: SessionNotCreatedException Errors Periodically Against node-chrome and node-firefox Docker Containers [🐛 Bug]: SessionNotCreatedException Warnings Periodically Against node-chrome and node-firefox Docker Containers Nov 2, 2023
@jonathan-fortin
Copy link

Hi,

We are trying to upgrade from 4.8 to 4.15 to have the latest version of browsers, and we are facing the same problem! Parallel testing no longer works.

This is a huge problem/blocker.

@anassibnoualii
Copy link

I'm facing the same issue with selenium grid 4.15 for the three nodes chrome, firefox and edge when running tests in parallel.

@cocorossello
Copy link

I have the same problem, last working version was 4.8.3-20230404

@KentGu
Copy link

KentGu commented Nov 7, 2023

same issue here with grid 4.14.1
when I look into the node log I found the request payload looks like. Whereas OSS has already been removed
{ "traceId": "1bb514f8b0ee749901ef86b6e95e931a", "eventTime": 1698730329454331535, "eventName": "exception", "attributes": { "exception.message": "Unable to execute request: Unable to parse: {\n \"metadata\": {\n },\n \"desiredCapabilities\": {\n \"acceptInsecureCerts\": true,\n \"acceptSslCerts\": true,\n \"browserName\": \"chrome\",\n \"goog:chromeOptions\": {\n \"args\": [\n \"--no-sandbox\",\n \"--ignore-certificate-errors\",\n \"--homepage=about:blank\",\n \"--no-first-run\",\n \"--disable-infobars\",\n \"--disable-notifications\",\n \"--lang=en\",\n \"--disable-web-security\"\n ],\n \"extensions\": [\n ],\n \"prefs\": {\n \"intl.accept_languages\": \"en\",\n \"safebrowsing.enabled\": true\n }\n },\n \"idleTimeout\": 600,\n \"nativeEvents\": true,\n \"pageLoadStrategy\": \"eager\",\n \"proxy\": {\n \"proxyType\": \"DIRECT\"\n },\n \"se:recordVideo\": true,\n \"se:screenResolution\": \"1920x1080x24\",\n \"se:timeZone\": \"Asia\\u002fShanghai\",\n \"unexpectedAlertBehaviour\": \"ignore\",\n \"unhandledPromptBehavior\": \"ignore\"\n },\n \"downstreamDialects\": [\n \"OSS\",\n \"W3C\"\n ]\n}", "exception.stacktrace": "org.openqa.selenium.json.JsonException: Unable to parse: {\n \"metadata\": {\n },\n \"desiredCapabilities\": {\n \"acceptInsecureCerts\": true,\n \"acceptSslCerts\": true,\n \"browserName\": \"chrome\",\n \"goog:chromeOptions\": {\n \"args\": [\n \"--no-sandbox\",\n \"--ignore-certificate-errors\",\n \"--homepage=about:blank\",\n \"--no-first-run\",\n \"--disable-infobars\",\n \"--disable-notifications\",\n \"--lang=en\",\n \"--disable-web-security\"\n ],\n \"extensions\": [\n ],\n \"prefs\": {\n \"intl.accept_languages\": \"en\",\n \"safebrowsing.enabled\": true\n }\n },\n \"idleTimeout\": 600,\n \"nativeEvents\": true,\n \"pageLoadStrategy\": \"eager\",\n \"proxy\": {\n \"proxyType\": \"DIRECT\"\n },\n \"se:recordVideo\": true,\n \"se:screenResolution\": \"1920x1080x24\",\n \"se:timeZone\": \"Asia\\u002fShanghai\",\n \"unexpectedAlertBehaviour\": \"ignore\",\n \"unhandledPromptBehavior\": \"ignore\"\n },\n \"downstreamDialects\": [\n \"OSS\",\n \"W3C\"\n ]\n}\n\tat org.openqa.selenium.json.Json.toType(Json.java:169)\n\tat org.openqa.selenium.json.Json.toType(Json.java:152)\n\tat org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:48)\n\tat org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:193)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:87)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:345)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.node.Node.execute(Node.java:262)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:345)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\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:63)\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:63)\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)\nCaused by: org.openqa.selenium.json.JsonException: Unable to create instance of class org.openqa.selenium.grid.data.CreateSessionRequest\nBuild info: version: '4.14.1', revision: '03f8ede370'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-97-generic', java.version: '11.0.20.1'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.json.StaticInitializerCoercer.lambda$apply$0(StaticInitializerCoercer.java:61)\n\tat org.openqa.selenium.json.JsonTypeCoercer.lambda$buildCoercer$6(JsonTypeCoercer.java:174)\n\tat org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:149)\n\tat org.openqa.selenium.json.Json.toType(Json.java:206)\n\tat org.openqa.selenium.json.Json.toType(Json.java:167)\n\t... 23 more\nCaused by: java.lang.reflect.InvocationTargetException\n\tat jdk.internal.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)\n\tat java.base\u002fjdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base\u002fjava.lang.reflect.Method.invoke(Method.java:566)\n\tat org.openqa.selenium.json.StaticInitializerCoercer.lambda$apply$0(StaticInitializerCoercer.java:59)\n\t... 27 more\nCaused by: org.openqa.selenium.json.JsonException: Unable to find matching enum value for OSS in class org.openqa.selenium.remote.Dialect\nBuild info: version: '4.14.1', revision: '03f8ede370'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-97-generic', java.version: '11.0.20.1'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.json.EnumCoercer.lambda$apply$0(EnumCoercer.java:50)\n\tat org.openqa.selenium.json.JsonTypeCoercer.lambda$buildCoercer$6(JsonTypeCoercer.java:174)\n\tat org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:149)\n\tat org.openqa.selenium.json.CollectionCoercer.lambda$apply$0(CollectionCoercer.java:63)\n\tat java.base\u002fjava.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)\n\tat java.base\u002fjava.util.Iterator.forEachRemaining(Iterator.java:133)\n\tat java.base\u002fjava.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)\n\tat java.base\u002fjava.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)\n\tat java.base\u002fjava.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)\n\tat java.base\u002fjava.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)\n\tat java.base\u002fjava.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\n\tat java.base\u002fjava.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)\n\tat org.openqa.selenium.json.CollectionCoercer.lambda$apply$1(CollectionCoercer.java:64)\n\tat org.openqa.selenium.json.JsonTypeCoercer.lambda$buildCoercer$6(JsonTypeCoercer.java:174)\n\tat org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:149)\n\tat org.openqa.selenium.json.JsonInput.read(JsonInput.java:421)\n\tat org.openqa.selenium.grid.data.CreateSessionRequest.fromJson(CreateSessionRequest.java:74)\n\t... 31 more\n", "exception.type": "org.openqa.selenium.json.JsonException", "http.flavor": 1, "http.handler_class": "org.openqa.selenium.grid.security.RequiresSecretFilter$$Lambda$680\u002f0x0000000840367c40", "http.host": "xxxxx:xxxx", "http.method": "POST", "http.request_content_length": "958", "http.scheme": "HTTP", "http.target": "\u002fse\u002fgrid\u002fnode\u002fsession", "http.user_agent": "selenium\u002f4.8.3 (java unix)" } }

@ortunom
Copy link

ortunom commented Nov 21, 2023

For us the issue started after upgrading from 4.13.0-20230926 to 4.14.1-20231016.

In our case it happens randomly, we might have 1 or 2 test failed out of 250 in our jobs. We run 50 parallel instances.

In the test logs:

SessionNotCreatedError: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {browserName: chrome, browserVersion: 119.0, goog:chromeOptions: {args: [disable-features=site-per-p...]}, goog:loggingPrefs: {browser: ALL, network: ALL, performance: ALL}, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, chrome, --output, json, --browser-version, 119.0]

Build info: version: '4.15.0', revision: '1d14b5521b'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'
Driver info: driver.version: unknown 
Host info: host: '8e0c2404c8cc', ip: '172.17.0.2'
Build info: version: '4.15.0', revision: '1d14b5521b'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'
Driver info: driver.version: unknown
Build info: version: '4.15.0', revision: '1d14b5521b'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'
Driver info: driver.version: unknown

This is what we see in the Hub logs:

02:45:36.319 INFO [LocalDistributor.newSession] - Session request received by the Distributor: 
 [Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-features=site-per-p...]}, goog:loggingPrefs: {browser: ALL, network: ALL, performance: ALL}}]
02:45:36.368 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "4a8f1ce7af9185c308bf0f39ff607be2","eventTime": 1700534736231133898,"eventName": "Session request received by the Distributor","attributes": {"logger": "org.openqa.selenium.grid.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-features=site-per-p...]}, goog:loggingPrefs: {browser: ALL, network: ALL, performance: ALL}}]"}}
02:45:36.369 WARN [SeleniumSpanExporter$1.lambda$export$1] - Unable to create session: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {browserName: chrome, browserVersion: 119.0, goog:chromeOptions: {args: [disable-features=site-per-p...]}, goog:loggingPrefs: {browser: ALL, network: ALL, performance: ALL}, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, chrome, --output, json, --browser-version, 119.0]
Build info: version: '4.15.0', revision: '1d14b5521b'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'
Driver info: driver.version: unknown 
Host info: host: '8e0c2404c8cc', ip: '172.17.0.2'
Build info: version: '4.15.0', revision: '1d14b5521b'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'
Driver info: driver.version: unknown
Build info: version: '4.15.0', revision: '1d14b5521b'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'
Driver info: driver.version: unknown
02:45:36.369 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {browserName: chrome, browserVersion: 119.0, goog:chromeOptions: {args: [disable-features=site-per-p...]}, goog:loggingPrefs: {browser: ALL, network: ALL, performance: ALL}, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, chrome, --output, json, --browser-version, 119.0]
Build info: version: '4.15.0', revision: '1d14b5521b'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'
Driver info: driver.version: unknown 
Host info: host: '8e0c2404c8cc', ip: '172.17.0.2'
Build info: version: '4.15.0', revision: '1d14b5521b'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'
Driver info: driver.version: unknown
Build info: version: '4.15.0', revision: '1d14b5521b'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'
Driver info: driver.version: unknown
	at org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:151)
	at org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:645)
	at org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:564)
	at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:824)
	at org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:784)
	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)
02:45:36.370 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "4a8f1ce7af9185c308bf0f39ff607be2","eventTime": 1700534736365428550,"eventName": "exception","attributes": {"exception.message": "Unable to create session: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {browserName: chrome, browserVersion: 119.0, goog:chromeOptions: {args: [disable-features=site-per-p...]}, goog:loggingPrefs: {browser: ALL, network: ALL, performance: ALL}, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, chrome, --output, json, --browser-version, 119.0]\n\nBuild info: version: '4.15.0', revision: '1d14b5521b'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'\nDriver info: driver.version: unknown \nHost info: host: '8e0c2404c8cc', ip: '172.17.0.2'\nBuild info: version: '4.15.0', revision: '1d14b5521b'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'\nDriver info: driver.version: unknown\nBuild info: version: '4.15.0', revision: '1d14b5521b'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {browserName: chrome, browserVersion: 119.0, goog:chromeOptions: {args: [disable-features=site-per-p...]}, goog:loggingPrefs: {browser: ALL, network: ALL, performance: ALL}, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, chrome, --output, json, --browser-version, 119.0]\n\nBuild info: version: '4.15.0', revision: '1d14b5521b'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'\nDriver info: driver.version: unknown \nHost info: host: '8e0c2404c8cc', ip: '172.17.0.2'\nBuild info: version: '4.15.0', revision: '1d14b5521b'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'\nDriver info: driver.version: unknown\nBuild info: version: '4.15.0', revision: '1d14b5521b'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.56-82.125.amzn2023.x86_64', java.version: '11.0.20.1'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:151)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:645)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:564)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:824)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:784)\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.distributor.local.LocalDistributor","request.payload": "[Capabilities {browserName: chrome, goog:chromeOptions: {args: [disable-features=site-per-p...]}, goog:loggingPrefs: {browser: ALL, network: ALL, performance: ALL}}]"}}

@grichner
Copy link

I get a session could not be created with Hub Version 15.0 and chrome 119.0 the following error pops up from time to time:
15:25:09.841 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "b280e14f55823141f721c1fbf026b352","eventTime": 1700576709840950034,"eventName": "exception","attributes": {"exception.message": "Unable to create session: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {acceptInsecureCerts: true, browserName: chrome, browserVersion: 119.0, goog:chromeOptions: {args: [--start-maximized, --window-size=1920x1080, --start-fullscreen, --headless, --no-sandbox, --disable-gpu, --disable-infobars, --disable-extensions, --disable-dev-shm-usage, --user-agent=New User Agent, --disable-features=VizDispl..., --disable-browser-side-navi...], extensions: [], prefs: {download.default_directory: \u002fhome\u002fseluser\u002fdownloads, download.prompt_for_download: false, enable_do_not_track: true, safebrowsing_for_trusted_sources_enabled: false}}, goog:loggingPrefs: {browser: ALL, performance: ALL}, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, chrome, --output, json, --browser-version, 119.0]\n\nBuild info: version: '4.15.0', revision: '1d14b5521b'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.137-91.144.amzn2.x86_64', java.version: '11.0.20.1'\nDriver info: driver.version: unknown \nHost info: host: '1051299c4a95', ip: '10.0.3.219'\nBuild info: version: '4.15.0', revision: '1d14b5521b'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.137-91.144.amzn2.x86_64', java.version: '11.0.20.1'\nDriver info: driver.version: unknown\nBuild info: version: '4.14.1', revision: '03f8ede370'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.137-91.144.amzn2.x86_64', java.version: '11.0.20.1'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Could not start a new session. Unable to obtain: Capabilities {acceptInsecureCerts: true, browserName: chrome, browserVersion: 119.0, goog:chromeOptions: {args: [--start-maximized, --window-size=1920x1080, --start-fullscreen, --headless, --no-sandbox, --disable-gpu, --disable-infobars, --disable-extensions, --disable-dev-shm-usage, --user-agent=New User Agent, --disable-features=VizDispl..., --disable-browser-side-navi...], extensions: [], prefs: {download.default_directory: \u002fhome\u002fseluser\u002fdownloads, download.prompt_for_download: false, enable_do_not_track: true, safebrowsing_for_trusted_sources_enabled: false}}, goog:loggingPrefs: {browser: ALL, performance: ALL}, platformName: linux, se:noVncPort: 7900, se:vncEnabled: true}, error Failed to parse json output, executed: [--browser, chrome, --output, json, --browser-version, 119.0]\n\nBuild info: version: '4.15.0', revision: '1d14b5521b'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.137-91.144.amzn2.x86_64', java.version: '11.0.20.1'\nDriver info: driver.version: unknown \nHost info: host: '1051299c4a95', ip: '10.0.3.219'\nBuild info: version: '4.15.0', revision: '1d14b5521b'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.137-91.144.amzn2.x86_64', java.version: '11.0.20.1'\nDriver info: driver.version: unknown\nBuild info: version: '4.14.1', revision: '03f8ede370'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.137-91.144.amzn2.x86_64', java.version: '11.0.20.1'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.node.remote.RemoteNode.newSession(RemoteNode.java:151)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.startSession(LocalDistributor.java:644)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor.newSession(LocalDistributor.java:563)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.handleNewSessionRequest(LocalDistributor.java:823)\n\tat org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable.lambda$run$1(LocalDistributor.java:783)\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.distributor.local.LocalDistributor","request.payload": "[Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--start-maximized, --window-size=1920x1080, --start-fullscreen, --headless, --no-sandbox, --disable-gpu, --disable-infobars, --disable-extensions, --disable-dev-shm-usage, --user-agent=New User Agent, --disable-features=VizDispl..., --disable-browser-side-navi...], extensions: [], prefs: {download.default_directory: \u002fhome\u002fseluser\u002fdownloads, download.prompt_for_download: false, enable_do_not_track: true, safebrowsing_for_trusted_sources_enabled: false}}, goog:loggingPrefs: {browser: ALL, performance: ALL}, platformName: linux}]"}}

If I run this with chrome 116.0 and hub 15.0 no error appears... any ideas why?

@jerrod-lankford
Copy link

Also seeing this, causing unreliable results for our daily automation

@diemol
Copy link
Member

diemol commented Nov 22, 2023

This has been fixed in https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.15.0-20231122

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants