[🐛 Bug]: Selenium grid 4.49.0 - idle sessions are not remove after session timeout and unable to delete sessions
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- java, linux
- Domain
- distributed-systems, testing
Research direction
Reproduce the session-timeout and DELETE behavior using Selenium Grid 4.49.0, then compare it with the last known working 4.44.0. Start with LocalNode.java and StopNodeSession.java, which appear in the reported stack trace; done means idle sessions are removed after the configured timeout and the node DELETE endpoint can remove an existing session.
Written by the indexing model from the issue text.
Description
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
--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
- Dominant language
- Java
- Stars
- 34.5k
- Forks
- 8.7k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 91
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SeleniumHQ/selenium
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
SeleniumHQ/selenium#17843 · 1 comment ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
SeleniumHQ/selenium#17836 ·
-
Latent NPE risk at ~25 call sites of Json.toType() (surfaced by nullability annotation in #17802) Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
SeleniumHQ/selenium#18031 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
SeleniumHQ/selenium#18020 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
SeleniumHQ/selenium#18019 · 7 comments ·
All issues in SeleniumHQ/selenium
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100