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

未关闭
#3,025 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
docker, helm, java, kubernetes

调研方向

从堆栈跟踪入口 LocalSessionMap.get、SessionMap.getUri 和 HandleSession.loadSessionId 开始,然后在 Kubernetes Helm 部署中并行执行期间重现该故障。使用提供的 Grid 4.38.0 版本,将会话生命周期与 pod、网络和 timeout 事件进行比较。完成的标准是确定活动会话消失的原因,并记录已确认的配置或版本解决方案。

由索引模型根据 Issue 内容生成。

描述

needs-triaging R-awaiting-answer
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

主要语言
Go
星标
8.7k
派生
2.5k
平均合并
1 天 15 小时
30 天内合并 PR
37

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SeleniumHQ/docker-selenium 的其他 Issue

查看 SeleniumHQ/docker-selenium 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。