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

[🐛 Bug]: Selenium Grid throwing NoSuchSessionException – Session ID not found

Open venkat-enable opened this issue 2 months ago • 2 comments

What happened?

Error:

org.openqa.selenium.NoSuchSessionException: Unable to find session with ID: 227114db1ad53c034d05e1d57af7fefb

Stacktrace:

Build info: version: '4.38.0', revision: '6b412e825c' System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.6.105+', java.version: '21.0.8' Driver info: driver.version: unknown at org.openqa.selenium.grid.sessionmap.local.LocalSessionMap.get(LocalSessionMap.java:119) at org.openqa.selenium.grid.sessionmap.SessionMap.getUri(SessionMap.java:84) at org.openqa.selenium.grid.router.HandleSession.lambda$loadSessionId$4(HandleSession.java:231) at org.openqa.selenium.grid.router.HandleSession.execute(HandleSession.java:188) ... at java.base/java.lang.Thread.run(Thread.java:1583)

Summary

Selenium Grid intermittently fails to locate an active session, causing tests to break with NoSuchSessionException. The session appears to be lost or removed from the SessionMap before the request is routed.

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

used this command to install

helm install my-selenium-grid selenium-grid/selenium-grid --version 0.49.1

Relevant log output

Environment

Selenium Grid version: 4.38.0

Deployment: Kubernetes (Helm – SeleniumHQ/docker-selenium chart)

OS: Linux 6.6.105+

Java: 21.0.8

Observed Behavior

Session starts successfully.

During test execution, Grid returns Unable to find session with ID.

Logs suggest the session is not present in LocalSessionMap.

Expected Behavior

Active sessions should remain available until closed by the client or Grid.

Possible Causes

Pod restart / crash in Node or Session container.

Network issue between Router → SessionMap → Node.

Selenium Grid bug in session persistence for distributed deployments.

Session timeout due to inactivity or long test steps.

Required Actions

Please investigate:

Why the session is disappearing from the SessionMap.

Whether this is a known issue in Selenium 4.38.0.

Any recommended configuration changes for K8s-based grid.

Whether upgrading or downgrading Grid components resolves the issue.

Additional Notes

Issue happens repeatedly during parallel execution.

Operating System

GKE

Docker Selenium version (image tag)

4.38.0

Selenium Grid chart version (chart version)

4.38.0

venkat-enable avatar Nov 10 '25 04:11 venkat-enable

@venkat-enable, 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!

github-actions[bot] avatar Nov 10 '25 04:11 github-actions[bot]

In Grid version 4.39.0, we improved the logs with session removal info for better understanding the reason and when sessions get removed. Based on that, we can identify the factor and take appropriate action.

VietND96 avatar Dec 12 '25 01:12 VietND96