SeleniumHQ / SeleniumHQ/docker-selenium

[🐛 Bug]: Could not start a new session -intermittently

Open
#2,526 23 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

R-awaiting-answer
Dominant language
Go
Stars
8.7k
Forks
2.5k
Avg merge
10h 16m
Merged PRs (30d)
20

Description

What happened?

I have around 5 threads running concurrently
But during execution of testcases in between I am getting error of session not created. The issue is very intermittent

Command used to start Selenium Grid with Docker (or Kubernetes)
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: selenium-grid
  namespace: selenium-grid
spec:
  chart:
    spec:
      chart: selenium-grid
      version: 0.38.1
      sourceRef:
        kind: HelmRepository
        name: selenium-grid
        namespace: selenium-grid
  interval: 5m
  targetNamespace: selenium-grid
  releaseName: selenium-grid
  values:
    videoRecorder:
      enabled: true
      extraVolumeMounts:
        - name: selenium-grid-videodir
          mountPath: /videos
      extraVolumes:
        - name: selenium-grid-videodir
          persistentVolumeClaim:
            claimName: selenium-video-pvc
    basicAuth:
      enabled: false
    isolateComponents: true
    firefoxNode:
      resources:
        limits:
          memory: "2Gi"
          cpu: "1"
    chromeNode:
      enabled: false
    edgeNode:
      enabled: false
Relevant log output
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Could not start a new session. Could not start a new session. Build info: version: '4.27.0', revision: 'd6e718d'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.115', java.version: '17.0.13'
Driver info: driver.version: unknown 
Host info: host: 'selenium-grid-selenium-distributor-76ff4c5987-pfkjm', ip: '172.22.10.42'
Build info: version: '4.27.0', revision: 'd6e718d'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.115', java.version: '17.0.13'
Driver info: driver.version: unknown
Build info: version: '4.25.0', revision: '8a8aea2337'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.115', java.version: '11.0.24'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {prefs: {remote.active-protocols: 3}, profile: UEsDBBQACAgIAMI4l1kAAAAAAAA...}}]}]
Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {prefs: {remote.active-protocols: 3}, profile: UEsDBBQACAgIAMI4l1kAAAAAAAA...}}
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:162)
	at org.openqa.selenium.remote.TracedCommandExecutor.execute(TracedCommandExecutor.java:53)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:245)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:174)
	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:152)
	at com.umantis.test.framework.webdriver.LocalDriverFactory.createInstance(LocalDriverFactory.java:79)
	at com.umantis.test.framework.webdriver.LocalWebDriver.create(LocalWebDriver.java:68)
	at com.umantis.test.framework.configuration.TestBase.methodSetup(TestBase.java:80)
	at jdk.internal.reflect.GeneratedMethodAccessor258.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:141)
	at org.testng.internal.invokers.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:71)
	at org.testng.internal.invokers.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:400)
	at org.testng.internal.invokers.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:333)
	at org.testng.internal.invokers.TestInvoker.runConfigMethods(TestInvoker.java:833)
	at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:600)
	at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:230)
	at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:63)
	at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:992)
	at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:203)
	at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:154)
	at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:134)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.testng.internal.thread.graph.TestNGFutureTask.run(TestNGFutureTask.java:22)
	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

Kubernetes EKS

Docker Selenium version (image tag)

latest

Selenium Grid chart version (chart version)

0.38.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the supplied HelmRelease, Firefox-only node configuration, and five concurrent sessions. Collect distributor and node logs alongside the provided Java stack trace; done requires identifying a reproducible cause for the intermittent session-creation failure and validating a resolution under comparable concurrency.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, helm, java, kubernetes
Domain
devops, distributed-systems, infrastructure, testing-qa
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.