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]: Disabling VNC does not quite work #2500

Open
MJB222398 opened this issue Dec 10, 2024 · 6 comments
Open

[🐛 Bug]: Disabling VNC does not quite work #2500

MJB222398 opened this issue Dec 10, 2024 · 6 comments

Comments

@MJB222398
Copy link

MJB222398 commented Dec 10, 2024

What happened?

I have to use a poverty spec machine so need to conserve resources. I do not need VNC so I want to disable that to save memory etc. I set the following environment variables:

SE_START_VNC=false
SE_START_NO_VNC=false

This does seem to disable VNC in the sense that I can longer connect using my VNC client. However if I look at the Selenium Grid web UI at http://localhost:4444/ui/# this doesn't appear to reflect this properly.

Hovering over the '1' icon for my Chrome Node I can see the following:

{"browserName":"chrome","browserVersion":"127.0","goog:chromeOptions":{"binary":"/usr/bin/google-chrome"},"platformName":"linux","se:containerName":"","se:noVncPort":7900,"se:vncEnabled":true}

Why is it saying "se:vncEnabled":true? And also why is it saying "se:noVncPort":7900 for that matter?

Furthermore if I go to the sessions page (http://localhost:4444/ui/#/sessions) then I can see a camera/video icon next to my session to launch the VNC viewer. If I click this it doesn't work but I would expect that this icon/button should not be there at all.

Have I managed to disable VNC or not? Am I saving resources or not? Do I need to set START_VNC and START__NO_VNC too? Its just unclear and doesn't fill me with confidence that it is doing what I want it to.

As well as the variables above do I also need to set SE_START_XVFB=false? If I do then I get catastrophic issues so assume not.

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

# To execute this docker-compose yml file use `docker-compose -f docker-compose.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose.yml down`
version: "3"
services:
  chrome:
    image: selenium/node-chrome:4.23.0-20240727
    container_name: chrome-node
    shm_size: 2gb
    privileged: true
    depends_on:
      - selenium-hub
    environment:
      - HUB_HOST=selenium-hub
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_START_VNC=false
      - SE_START_NO_VNC=false
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
      - SE_NODE_MAX_SESSIONS=1
      - SE_NODE_GRID_URL=http://localhost:4444
      - SE_NODE_SESSION_TIMEOUT=180
    ports:
      - "6900:5900"
    networks:
      - selenium_grid_internal

  chrome_video:
    image: selenium/video:ffmpeg-7.0.1-20240727
    container_name: chrome-video
    privileged: true
    volumes:
      - ${VIDEOS_DIRECTORY:-./videos}:/videos
    depends_on:
      - chrome
    environment:
      - DISPLAY_CONTAINER_NAME=chrome
      - FILE_NAME=chrome_video.mp4
    networks:
      - selenium_grid_internal

  selenium-hub:
    image: selenium/hub:4.23.0-20240727
    privileged: true
    container_name: selenium-hub
    hostname: selenium-hub
    ports:
      - "4442:4442"
      - "4443:4443"
      - "4444:4444"
    environment:
      - GRID_TIMEOUT=120000
      - GRID_BROWSER_TIMEOUT=120000
    networks:
      - selenium_grid_internal

networks:
  selenium_grid_internal:

Relevant log output

2024-12-10 19:14:29,438 INFO spawned: 'vnc' with pid 1412
2024-12-10 19:14:29,439 INFO spawned: 'novnc' with pid 1413
2024-12-10 19:14:29,441 WARN exited: vnc (exit status 0; not expected)
2024-12-10 19:14:29,442 WARN exited: novnc (exit status 0; not expected)
2024-12-10 19:14:32,446 INFO spawned: 'vnc' with pid 1425
2024-12-10 19:14:32,447 INFO spawned: 'novnc' with pid 1426
2024-12-10 19:14:32,449 WARN exited: vnc (exit status 0; not expected)
2024-12-10 19:14:32,449 INFO gave up: vnc entered FATAL state, too many start retries too quickly
2024-12-10 19:14:32,450 WARN exited: novnc (exit status 0; not expected)
2024-12-10 19:14:33,451 INFO gave up: novnc entered FATAL state, too many start retries too quickly

Operating System

Ubuntu 20.04

Docker Selenium version (image tag)

4.23.0-20240727

Selenium Grid chart version (chart version)

No response

Copy link

@MJB222398, 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

Try to use Node version 4.26.0+, I think it will be fixed by SeleniumHQ/selenium#14584

@MJB222398
Copy link
Author

@VietND96 Thanks, unfortunately I cannot update right now due to other bugs/deprecations/limitations so I will take your word for it. Looking at your PR though I see it only deals with the SE_ prefixed versions of the variables. My understanding from reading other code was that these SE_ prefixed ones are only used as fallbacks if the unprefixed ones are not set. So I suppose my questions is, if I were to upgrade to 4.26+ could you be explicit about which variables (out of START_VNC, START_NO_VNC, START_XVFB, SE_START_VNC, SE_START_NO_VNC, SE_START_XVFB) I need to set to disable any and all VNC servers for my peace of mind?

@VietND96
Copy link
Member

It's AND logic, so just one env var is false e.g SE_START_VNC=false, the recorder icon should be disabled (in the container, VNC will not start, and noVNC as well).
List env vars can be configured - https://www.selenium.dev/documentation/grid/configuration/cli_options/#node
Via SE_OPTS, set --vnc-env-var START_XVFB START_VNC START_NO_VNC.

@MJB222398
Copy link
Author

@VietND96 Ok thanks, I just noticed also in the logs that I get this:

2024-12-10 19:14:29,438 INFO spawned: 'vnc' with pid 1412
2024-12-10 19:14:29,439 INFO spawned: 'novnc' with pid 1413
2024-12-10 19:14:29,441 WARN exited: vnc (exit status 0; not expected)
2024-12-10 19:14:29,442 WARN exited: novnc (exit status 0; not expected)
2024-12-10 19:14:32,446 INFO spawned: 'vnc' with pid 1425
2024-12-10 19:14:32,447 INFO spawned: 'novnc' with pid 1426
2024-12-10 19:14:32,449 WARN exited: vnc (exit status 0; not expected)
2024-12-10 19:14:32,449 INFO gave up: vnc entered FATAL state, too many start retries too quickly
2024-12-10 19:14:32,450 WARN exited: novnc (exit status 0; not expected)
2024-12-10 19:14:33,451 INFO gave up: novnc entered FATAL state, too many start retries too quickly

Doesn't seem right?

@VietND96
Copy link
Member

Let me check it. It should not spawn pid again with a confused message.

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