Skip to content
Latchkey

Selenium Grid "Could not start a new session" in CI

A test asked Selenium Grid for a browser session, but the hub could not provide one. Either no node matches the requested capabilities, every slot is busy and the queue timed out, or the grid URL is wrong.

What this error means

Session creation fails with "Could not start a new session" - sometimes "no node supports the required capabilities," sometimes a queue timeout. The test never gets a driver, so nothing runs.

Selenium output
org.openqa.selenium.SessionNotCreatedException: Could not start a new
session. Response code 500.
Message: Could not start a new session. No node supports the required
capabilities: Capabilities {browserName: firefox, ...}

Common causes

No node matches the capabilities

The requested browserName/version/platform has no registered node on the grid (e.g. asking for Firefox on a Chrome-only grid).

Session queue saturated

All node slots are in use and the new request waits past the session-request timeout, so the hub rejects it - a capacity/timing problem under load.

Wrong hub URL or grid not ready

Pointing at a hub that is not up yet (a race in CI startup) or a wrong /wd/hub URL fails session creation.

How to fix it

Match capabilities to a registered node

  1. Open the grid console and confirm a node offers the requested browser/version/platform.
  2. Align the test capabilities to what the grid actually registers.
  3. Wait for the hub to report ready before launching tests.

Add capacity or wait for a slot

Terminal
# scale grid nodes or raise the queue timeout
docker compose up --scale chrome=4
# wait for the hub to be ready before tests
until curl -sf http://hub:4444/wd/hub/status; do sleep 2; done

How to prevent it

  • Gate tests on the hub /status readiness endpoint.
  • Size grid node capacity for peak concurrency.
  • Keep test capabilities aligned with the registered nodes.

Frequently asked questions

What causes ""Could not start a new session""?
The requested browserName/version/platform has no registered node on the grid (e.g. asking for Firefox on a Chrome-only grid).
How do I fix "Could not start a new session"?
Match capabilities to a registered node
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card