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.
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
- Open the grid console and confirm a node offers the requested browser/version/platform.
- Align the test capabilities to what the grid actually registers.
- Wait for the hub to report ready before launching tests.
Add capacity or wait for a slot
# 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; doneHow to prevent it
- Gate tests on the hub
/statusreadiness endpoint. - Size grid node capacity for peak concurrency.
- Keep test capabilities aligned with the registered nodes.