Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: version 4.10 java.util.concurrent.TimeoutException #1903

Closed
atranou opened this issue Jul 28, 2023 · 7 comments
Closed

[🐛 Bug]: version 4.10 java.util.concurrent.TimeoutException #1903

atranou opened this issue Jul 28, 2023 · 7 comments

Comments

@atranou
Copy link

atranou commented Jul 28, 2023

What happened?

Hello,

We recently upgraded to 4.10 version (selenium hub - selenium node chrome - selenium node firefox )
but we are getting the following error: selenium.common.exceptions.TimeoutException: Message: Unable to execute a request for an existing session: java.util.concurrent.TimeoutException.
Our setup is in the section: Command used to start Selenium Grid with Docker

  • In our running process, we open more than one selenium sessions on the same domain that they run concurrently.
  • This error doesn't always emerge, but it appears some and there.
  • Appears both on a Chrome session or on a Firefox session.

Is this a bug or something?
In case you need extra info in order to reproduce, I am kindly asking you to help me a bit with what exactly is important to you.

Thank you a lot!

Command used to start Selenium Grid with Docker

docker-compose.yml is provided

version: "3.9"

services:
  selenium:
    image: selenium/hub:4.10.0-20230607
    container_name: selenium

    environment:
      - SE_SESSION_REQUEST_TIMEOUT=259200
      - SE_SESSION_RETRY_INTERVAL=10
    ports:
      - "4442:4442"
      - "4443:4443"
      - "4444:4444"
    restart: always

  firefox:
    image: selenium/node-firefox:4.10.0-20230607
    container_name: firefox
    shm_size: 5gb
    links:
      -  selenium
    environment:
      - SE_EVENT_BUS_HOST=selenium
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
      - SE_NODE_OVERRIDE_MAX_SESSIONS=true
      - SE_NODE_MAX_SESSIONS=15
      - SE_NODE_SESSION_TIMEOUT=3600
      - START_XVFB=false
    ports:
      - "5901:5900"
    restart: always

  chrome:
    image: selenium/node-chrome:4.10.0-20230607
    container_name: chrome
    shm_size: 5gb
    links:
     - selenium
    environment:
      - SE_EVENT_BUS_HOST=selenium
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
      - SE_NODE_OVERRIDE_MAX_SESSIONS=true
      - SE_NODE_MAX_SESSIONS=10
      - SE_NODE_SESSION_TIMEOUT=3600
      - START_XVFB=false
    ports:
      - "5902:5900"
    restart: always

Relevant log output

Selenium Logs
`
12:58:01.652 WARN [SeleniumSpanExporter$1.lambda$export$1] - org.openqa.selenium.TimeoutException: java.util.concurrent.TimeoutException
Build info: version: '4.10.0', revision: 'c14d967899'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.0-19-amd64', java.version: '11.0.19'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:394)
at org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)
at org.openqa.selenium.grid.web.ReverseProxyHandler.execute(ReverseProxyHandler.java:91)
at org.openqa.selenium.grid.router.HandleSession.execute(HandleSession.java:125)
at org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:384)
at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
at org.openqa.selenium.grid.router.Router.execute(Router.java:87)
at org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0(EnsureSpecCompliantResponseHeaders.java:34)
at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
at org.openqa.selenium.remote.http.Route$NestedRoute.handle(Route.java:271)
at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)
at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
at org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)
at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)
at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)
at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
at org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.concurrent.TimeoutException
at java.base/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1886)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2021)
at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:377)
... 33 more

12:58:01.653 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "228b8553785f5f7fe6e0dd261fda6985","eventTime": 1690549081651153912,"eventName": "exception","attributes": {"exception.message": "Unable to execute request for an existing session: java.util.concurrent.TimeoutException\nBuild info: version: '4.10.0', revision: 'c14d967899'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.0-19-amd64', java.version: '11.0.19'\nDriver info: driver.version: unknown","exception.stacktrace": "org.openqa.selenium.TimeoutException: java.util.concurrent.TimeoutException\nBuild info: version: '4.10.0', revision: 'c14d967899'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.0-19-amd64', java.version: '11.0.19'\nDriver info: driver.version: unknown\n\tat org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:394)\n\tat org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)\n\tat org.openqa.selenium.grid.web.ReverseProxyHandler.execute(ReverseProxyHandler.java:91)\n\tat org.openqa.selenium.grid.router.HandleSession.execute(HandleSession.java:125)\n\tat org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:384)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.grid.router.Router.execute(Router.java:87)\n\tat org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0(EnsureSpecCompliantResponseHeaders.java:34)\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:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.http.Route$NestedRoute.handle(Route.java:271)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\n\tat org.openqa.selenium.remote.http.Route.execute(Route.java:69)\n\tat org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:347)\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:44)\n\tat java.base\u002fjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\n\tat java.base\u002fjava.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base\u002fjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base\u002fjava.lang.Thread.run(Thread.java:829)\nCaused by: java.util.concurrent.TimeoutException\n\tat java.base\u002fjava.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1886)\n\tat java.base\u002fjava.util.concurrent.CompletableFuture.get(CompletableFuture.java:2021)\n\tat org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:377)\n\t... 33 more\n","exception.type": "org.openqa.selenium.TimeoutException","http.flavor": 1,"http.handler_class": "org.openqa.selenium.grid.router.HandleSession","http.host": "172.18.0.7:4444","http.method": "POST","http.request_content_length": "145","http.scheme": "HTTP","http.target": "\u002fsession\u002f3cd0a714-40ec-4e4f-b105-50105d8ad855\u002furl","http.user_agent": "selenium\u002f3.141.0 (python linux)","session.id": "3cd0a714-40ec-4e4f-b105-50105d8ad855"}}
`

Firefox logs

13:00:01.662 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "228b8553785f5f7fe6e0dd261fda6985","eventTime": 1690549201661406994,"eventName": "HTTP request execution complete","attributes": {"http.flavor": 1,"http.handler_class": "org.openqa.selenium.remote.http.Route$PredicatedRoute","http.host": "172.18.0.9:5555","http.method": "POST","http.request_content_length": "145","http.scheme": "HTTP","http.status_code": 500,"http.target": "\u002fsession\u002f3cd0a714-40ec-4e4f-b105-50105d8ad855\u002furl","http.user_agent": "selenium\u002f3.141.0 (python linux)"}}

Operating System

linux

Docker Selenium version (tag)

4.10.0-20230607

@github-actions
Copy link

@atranou, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@diemol
Copy link
Member

diemol commented Jul 28, 2023

This usually happens when trying to run more concurrent sessions than the number of available slots in the Grid. They get queued, and then time out.

I will leave some links below so you can ask more questions and debug the situation.

@github-actions
Copy link

💬 Please ask questions at:

@atranou
Copy link
Author

atranou commented Jul 28, 2023

Hello thanks a lot for your comment!
I forgot to mention that I am pretty sure that there were available slots in the grid when these errors emerge
(the concurrency is around 50% all the time)
image
image

In our logs there is a http status 500
Does this mean that Firefox gets a 500 response could this ends up to timeout somehow?
image

@diemol
Copy link
Member

diemol commented Jul 28, 2023

That timeout means that the browser could not load the URL, it timed out.

For more questions please use the links above. It is really hard to keep track here.

@Akkasim46
Copy link

Akkasim46 commented Oct 18, 2023

@diemol

I see these errors when running junit5 concurrent tests on grid:
org.openqa.selenium.SessionNotCreatedException at RemoteWebDriver.java:536
Caused by: org.openqa.selenium.TimeoutException at NettyHttpHandler.java:65
Caused by: java.util.concurrent.TimeoutException at CompletableFuture.java:1886

Copy link

github-actions bot commented Dec 9, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants