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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悰 Bug]: selenium.NoSuchSessionException: Unable to find session with ID #2135

Open
YaronMordAnaplan opened this issue Feb 13, 2024 · 5 comments

Comments

@YaronMordAnaplan
Copy link

What happened?

In the middle of the test, the connection with the selenium hub lost and It happens once a day

Command used to start Selenium Grid with Docker (or Kubernetes)

global:
  seleniumGrid:
    # Image registry for all selenium components
    imageRegistry: selenium
    logLevel: INFO

components:
  extraEnvironmentVariables:
    - name: SE_SESSION_REQUEST_TIMEOUT
      value: "7200"
    - name: SE_SESSION_RETRY_INTERVAL
      value: "3" 

chromeNode:
  # Enable chrome nodes
  enabled: true

  # NOTE: Only used when autoscaling.enabled is false
  # Enable creation of Deployment
  # true (default) - if you want long living pods
  # false - for provisioning your own custom type such as Jobs
  deploymentEnabled: true

  # Number of chrome nodes
  replicas: 10
  # imageRegistry: selenium
  # Image of chrome nodes
  imageName: node-chrome
  resources:
    requests:
      memory: "2Gi"
      cpu: "1"
    limits:
      memory: "3Gi"
      cpu: "3"


  extraEnvironmentVariables:
    - name: SE_SESSION_RETRY_INTERVAL
      value: "5"
    - name: SE_NODE_SESSION_TIMEOUT
      value: "7200"    

firefoxNode:
  # Enable firefox nodes
  enabled: true

  # NOTE: Only used when autoscaling.enabled is false
  # Enable creation of Deployment
  # true (default) - if you want long living pods
  # false - for provisioning your own custom type such as Jobs
  deploymentEnabled: true

  # Number of firefox nodes
  replicas: 2
  # imageRegistry: selenium
  # Image of firefox nodes
  imageName: node-firefox
  resources:
    requests:
      memory: "1Gi"
      cpu: "1"
    limits:
      memory: "2Gi"
      cpu: "2"
  extraEnvironmentVariables:
    - name: SE_SESSION_RETRY_INTERVAL
      value: "5"
    - name: SE_NODE_SESSION_TIMEOUT
      value: "3600"       

edgeNode:
  # Enable edge nodes
  enabled: true

  # NOTE: Only used when autoscaling.enabled is false
  # Enable creation of Deployment
  # true (default) - if you want long living pods
  # false - for provisioning your own custom type such as Jobs
  deploymentEnabled: true

  # Number of edge nodes
  replicas: 2
  # imageRegistry: selenium
  # Image of edge nodes
  imageName: node-edge
  resources:
    requests:
      memory: "1Gi"
      cpu: "1"
    limits:
      memory: "2Gi"
      cpu: "2"
  extraEnvironmentVariables:
    - name: SE_SESSION_RETRY_INTERVAL
      value: "5"
    - name: SE_NODE_SESSION_TIMEOUT
      value: "3600"

Relevant log output

urllib3.connectionpool:connectionpool.py:872 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fac7f217670>: Failed to establish a new connection: [Errno 111] Connection refused')'


selenium.common.exceptions.InvalidSessionIdException: Message: Unable to find session with ID: 3cff0b1bcb48d1caf20bd9986ec25401
Build info: version: '4.17.0', revision: 'e52b1be057*'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.205-195.807.amzn2.x86_64', java.version: '11.0.21'
Driver info: driver.version: unknown
Stacktrace:
org.openqa.selenium.NoSuchSessionException: Unable to find session with ID: 3cff0b1bcb48d1caf20bd9986ec25401
Build info: version: '4.17.0', revision: 'e52b1be057*'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.205-195.807.amzn2.x86_64', java.version: '11.0.21'
Driver info: driver.version: unknown
	at org.openqa.selenium.grid.sessionmap.local.LocalSessionMap.get(LocalSessionMap.java:132)
	at org.openqa.selenium.grid.sessionmap.SessionMap.getUri(SessionMap.java:84)
	at org.openqa.selenium.grid.router.HandleSession.lambda$loadSessionId$4(HandleSession.java:223)
	at io.opentelemetry.context.Context.lambda$wrap$2(Context.java:224)
	at org.openqa.selenium.grid.router.HandleSession.execute(HandleSession.java:180)
	at org.openqa.selenium.remote.http.Route$PredicatedRoute.handle(Route.java:383)
	at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
	at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:346)
	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:346)
	at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
	at org.openqa.selenium.remote.http.Route$NestedRoute.handle(Route.java:270)
	at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
	at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:346)
	at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
	at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:346)
	at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
	at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:346)
	at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
	at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:346)
	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)

Operating System

kubernetes

Docker Selenium version (image tag)

4.17.0

Selenium Grid chart version (chart version)

No response

Copy link

@YaronMordAnaplan, 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!

Copy link

Hi, @YaronMordAnaplan.
Please follow the issue template, we need more information to reproduce the issue.

Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.

Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.

Reply to this issue when all information is provided, thank you.

@diemol
Copy link
Member

diemol commented Feb 13, 2024

We added the issue template label because we need a way to reproduce the issue.

@VietND96
Copy link
Member

urllib3.connectionpool:connectionpool.py:872 Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fac7f217670>: Failed to establish a new connection: [Errno 111] Connection refused')'
What is the Grid URL that you provided to create RemoteWebDriver?

@ghost
Copy link

ghost commented Apr 14, 2024

@YaronMordAnaplan can you try using a specific version of e.g node-chrome in your yml file. Considering that version 4.17.0 was only released 3 months ago, maybe try using an earlier version just to see if it resolves the issue. That would at least provide more insight as to whether the issue is related to versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants