#18062·selenium

[ Bug]: Selenium grid 4.49.0 - idle sessions are not remove after session timeout and unable to delete sessions

Author: vicozohiliCreated Sep 21, 2026Updated Sep 29, 2026
LabelsB-gridC-javaI-defectI-regressionD-chromeOS-linuxA-needs-triaging

Description

I start the selenium grid on a linux server using below commands:

nohup java -Dwebdriver.http.factory=jdk-http-client -jar selenium-server-4.49.0.jar hub &

nohup java -Dwebdriver.http.factory=jdk-http-client -Dwebdriver.chrome.driver=./chromedriver -Dwebdriver.chrome.whitelistedIps= -jar selenium-server-4.49.0.jar node --selenium-manager true --override-max-sessions true --max-sessions 20 --session-timeout 72000 --delete-session-on-ui true &

If a session is still active after 20 hours, it used to be automatically removed as per the configuration above. In Selenium Grid 4.48.0 and 4.49.0, this functionality is broken. Sessions remain active indefinitely.

I have tried deleting the sessions with: curl --request DELETE "http://localhost:5555/se/grid/node/session/" --header "X-REGISTRATION-SECRET;"

but still not able to do so and I get the error { "value": { "error": "invalid session id", "stacktrace": "org.openqa.selenium.NoSuchSessionException: Cannot find session with id: 721500a671676dcf1e489c30f24eeb63\nBuild info: version: '4.49.0', revision: 'bedb24f bedb24f6f703876e7e4c5d506f0d697eb358c720'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '4.18.0-553.84.1.el8_10.x86_64', java.version: '17.0.17'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.node.local.LocalNode.stop(LocalNode.java:1178)\n\tat org.openqa.selenium.grid.node.StopNodeSession.execute(StopNodeSession.java:38)\n\tat org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:61)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:87)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:358)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.node.Node.execute(Node.java:316)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:358)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:49)\n\tat java.base\u002fjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)\n\tat java.base\u002fjava.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:840)\n", "message": "Cannot find session with id: 721500a671676dcf1e489c30f24eeb63\nBuild info: version: '4.49.0', revision: 'bedb24f bedb24f6f703876e7e4c5d506f0d697eb358c720'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '4.18.0-553.84.1.el8_10.x86_64', java.version: '17.0.17'\nDriver info: driver.version: unknown"

Reproducible Code

bash
--session-timeout config in CLI does not work

and

curl --request DELETE "http://localhost:5555/se/grid/node/session/<session-id>" --header "X-REGISTRATION-SECRET;"

results in below error:

{
  "value": {
    "error": "invalid session id",
    "stacktrace": "org.openqa.selenium.NoSuchSessionException: Cannot find session with id: 721500a671676dcf1e489c30f24eeb63\nBuild info: version: '4.49.0', revision: 'bedb24f bedb24f6f703876e7e4c5d506f0d697eb358c720'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '4.18.0-553.84.1.el8_10.x86_64', java.version: '17.0.17'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.grid.node.local.LocalNode.stop(LocalNode.java:1178)\n\tat org.openqa.selenium.grid.node.StopNodeSession.execute(StopNodeSession.java:38)\n\tat org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:61)\n\tat org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:87)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:358)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.node.Node.execute(Node.java:316)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:358)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)\n\tat org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)\n\tat org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:49)\n\tat java.base\u002fjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)\n\tat java.base\u002fjava.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:840)\n",
    "message": "Cannot find session with id: 721500a671676dcf1e489c30f24eeb63\nBuild info: version: '4.49.0', revision: 'bedb24f bedb24f6f703876e7e4c5d506f0d697eb358c720'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '4.18.0-553.84.1.el8_10.x86_64', java.version: '17.0.17'\nDriver info: driver.version: unknown"

ℹ️ Last known working version: 4.44.0