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]: Error Could not start a new session. New session request timed out when upgrading node chrome to 127.0 #2436

Closed
nicolas-lefloch opened this issue Oct 21, 2024 · 6 comments

Comments

@nicolas-lefloch
Copy link

nicolas-lefloch commented Oct 21, 2024

What happened?

Context
We use Selenium with the Python client on a self-hosted EKS grid.
We are using a proxy to get out of our EKS cluster.

Problem
When upgrading Chrome node to 127.0 we noticed a significant increase in CPU on these pods, which was accompanied by numerous execution failures "Could not start a new session. New session request timed out".
It correctly works with node-chrome:126.0.

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

docker-compose 
 selenium-node-chrome:
    build:
      context: ./node/chrome/
    depends_on:
      - selenium-hub
    environment:
      SE_EVENT_BUS_HOST: "selenium-hub"
      SE_EVENT_BUS_PUBLISH_PORT: 4442
      SE_EVENT_BUS_SUBSCRIBE_PORT: 4443
      SE_START_XVFB: "false"
      TZ: "Europe/Paris"
      LANG: "fr_FR.UTF-8"
    restart: on-failure
    ports:
      - 6002:5555
    shm_size: 2gb
    links:
      - selenium-hub

manifest k8s

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: my-selenium-node-chrome-integration
    app.kubernetes.io/component: selenium-node-chrome
  name: my-selenium-node-chrome-deployment-integration
  namespace: my-robots
spec:
  selector:
    matchLabels:
      app: my-selenium-node-chrome-integration
  template:
    metadata:
      labels:
        app: my-selenium-node-chrome-integration
        app.kubernetes.io/component: selenium-node-chrome
    spec:
      containers:
        - env:
          - name: SE_DRAIN_AFTER_SESSION_COUNT
            value: "1000"
          - name: SE_ENABLE_TRACING
            value: "false"
          - name: SE_EVENT_BUS_HOST
            value: my-selenium-hub-service-integration
          - name: SE_EVENT_BUS_PUBLISH_PORT
            value: "4442"
          - name: SE_EVENT_BUS_SUBSCRIBE_PORT
            value: "4443"
          - name: SE_NODE_MAX_SESSIONS
            value: "2"
          - name: SE_START_XVFB
            value: "false"
          image: selenium/node-chrome:127.0
          imagePullPolicy: IfNotPresent
          lifecycle:
            preStop:
              exec:
                command:
                  - bash
                  - -c
                  - |
                    echo "[PRESTOPHOOK] Starting..." > /proc/1/fd/1
                    curl -X POST localhost:5555/se/grid/node/drain --header 'X-REGISTRATION-SECRET;' && (echo "[PRESTOPHOOK] Drain order sent successfully !" > /proc/1/fd/1) || (echo "[PRESTOPHOOK] Drain order failed !" > /proc/1/fd/1)
                    while curl localhost:5555/status; do echo "[PRESTOPHOOK] Status page is still up, waiting..." > /proc/1/fd/1; sleep 1; done;
                    echo "[PRESTOPHOOK] Status page down, exiting..." > /proc/1/fd/1

Relevant log output

SessionNotCreatedException: Message: Could not start a new session. New session request timed out Host info: host: 'my-selenium-hub-deployment-integration-69dccc8f96-qs9cv', ip: 'XX.XX.XX.XX' Build info: version: '4.25.0', revision: '030fcf7918' System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.225-213.878.amzn2.x86_64', java.version: '17.0.12' Driver info: driver.version: unknown Stacktrace: at org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue.addToQueue (LocalNewSessionQueue.java:221) at org.openqa.selenium.grid.sessionqueue.NewSessionQueue.lambda$new$0 (NewSessionQueue.java:68) at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle (Route.java:192) at org.openqa.selenium.remote.http.Route.execute (Route.java:69) at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:360) at org.openqa.selenium.remote.http.Route.execute (Route.java:69) at org.openqa.selenium.grid.sessionqueue.NewSessionQueue.execute (NewSe... [ Message content over the limit has been removed. ] ...org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:360) 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.util.concurrent.Executors$RunnableAdapter.call (Executors.java:539) at java.util.concurrent.FutureTask.run (FutureTask.java:264) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635) at java.lang.Thread.run (Thread.java:840)

Operating System

EKS

Docker Selenium version (image tag)

node-chrome:127.0

Selenium Grid chart version (chart version)

No response

Copy link

@nicolas-lefloch, 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!

@VietND96
Copy link
Member

VietND96 commented Oct 21, 2024

I saw

          - name: SE_START_XVFB
            value: "false"

Did you run the test with headless mode (arg --headless=new) is used?

@nicolas-lefloch
Copy link
Author

Thanks for your response, yes we use --headless=new

@VietND96
Copy link
Member

Let's starting it by setting to true. I remember someone feedback that in new version, headless mode requires xvfb

@nicolas-lefloch
Copy link
Author

nicolas-lefloch commented Oct 21, 2024

Setting the SE_START_XVFB parameter to true worked perfectly.

Thank you for your quick help.

https://github.com/SeleniumHQ/docker-selenium/blob/trunk/README.md#running-in-headless-mode

@VietND96
Copy link
Member

Yes, in README, there is a statement mentioned that xvfb is not needed. However, another statement in Troubleshooting mentioned a different - https://github.com/SeleniumHQ/docker-selenium/blob/trunk/README.md#headless
I will check and remove the old one since functionality could be changed depending on the browser version.

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

2 participants