SeleniumHQ / SeleniumHQ/docker-selenium

[🐛 Bug]: Health check making nodes unavailable in Kubernetes, getting error - "Could not start a new session. Response code 500. Message"

Open
#2,812 26 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?

This behaviour is only observed when ran on Kubernetes using (deployment.yaml) and not observed when ran with images on normal linux servers.

We have observed that the health check for Selenium grid - starting from v4.29 and onwards is making the nodes unavailable during the health check causing error while running test
"org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Could not start a new session. java.net.ConnectException" and
"java.lang.NullPointerException: Cannot invoke "org.openqa.selenium.TakesScreenshot.getScreenshotAs(org.openqa.selenium.OutputType)" because "driver" is null"

Command used to start Selenium Grid with Docker (or Kubernetes)
kubectl apply -f hub.yaml
Relevant log output
14:49:45.487 INFO [LocalDistributor.add] - Added node b68b3b27-0e5c-40c4-82af-59dd1ecc4212 at https://node-chrome:5151. Health check every 120s
14:50:17.284 INFO [GridModel.setAvailability] - Switching Node b70e99a7-5d2c-45ec-b261-9f1d87d79744 (uri: https://node-chrome:5454) from UP to DOWN
14:52:17.265 INFO [GridModel.setAvailability] - Switching Node 7570b122-08d9-43f4-aff8-3276defc251d (uri: https://node-chrome:5252) from UP to DOWN
Operating System

Linux

Docker Selenium version (image tag)

4.31.0-20250414

Selenium Grid chart version (chart version)

No response

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 with the Kubernetes configuration referenced by deployment.yaml and the kubectl apply -f hub.yaml command, then review the health-check log entries showing nodes switching from UP to DOWN. Reproduce the behavior with Docker Selenium 4.31.0 in Kubernetes and compare it with normal Linux servers. Done means health checks no longer make nodes unavailable or cause session-creation failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, kubernetes
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.