docker-selenium icon indicating copy to clipboard operation
docker-selenium copied to clipboard

[🐛 Bug]: noVNC does not start due to malfunctioning -x check

Open sergeygrigorev opened this issue 1 year ago • 7 comments

What happened?

noVNC does not start. Investigation showed that startup script fails on executable attribute check though it's set correctly. The closest issue I managed to find is an old one in Alpine linux bug tracker. I think Ubuntu image might have something similar now.

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

version: '3'
services:
  selenium:
    image: selenium/standalone-chrome:4.25.0
    restart: unless-stopped
    shm_size: 2g
    ports:
      - "4444:4444"
      - "7900:7900"
    environment:
      - START_XVFB=true

Relevant log output

# docker logs <image-id>

WARN exited: novnc (exit status 1; not expected)

# docker exec -it <image-id> bash

seluser@host:/$ /opt/bin/start-novnc.sh
Trying to update the open file descriptor limit from 1048576 to 100000.
Successfully updated the open file descriptor limit.
Warning: could not find self.pem
The path /opt/bin/noVNC/utils/websockify exists, but /opt/bin/noVNC/utils/websockify/run either does not exist or is not executable.
If you intended to use an installed websockify package, please remove /opt/bin/noVNC/utils/websockify.

seluser@host:/$ ls -l /opt/bin/noVNC/utils/websockify/run
-rwxr-xr-x 1 root root 78 Aug 29 17:35 /opt/bin/noVNC/utils/websockify/run

seluser@host:/$ [ -x /opt/bin/noVNC/utils/websockify/run ]; echo $?
1

Operating System

Linux host 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 x86_64 x86_64 GNU/Linux

Docker Selenium version (image tag)

4.25.0

Selenium Grid chart version (chart version)

No response

sergeygrigorev avatar Sep 30 '24 22:09 sergeygrigorev

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

github-actions[bot] avatar Sep 30 '24 22:09 github-actions[bot]

Hi, we are using the latest code frommain of novnc and websockify, properly directory structure updated or something else. I will look around for the fix.

VietND96 avatar Oct 03 '24 01:10 VietND96

What is docker compose command that you used to start the container? Here is my try

$ docker exec -it frosty_easley bash
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

WARNING: Very high value reported by "ulimit -n". Consider passing "--ulimit nofile=32768" to "docker run".
seluser@780473f183d7:/$ /opt/bin/start-novnc.sh
Trying to update the open file descriptor limit from 1048576 to 100000.
Successfully updated the open file descriptor limit.
Port 7900 in use. Try --listen PORT
seluser@780473f183d7:/$ ls -l /opt/bin/noVNC/utils/websockify/run
-rwxr-xr-x 1 root root 78 Aug 29 14:35 /opt/bin/noVNC/utils/websockify/run

VietND96 avatar Oct 03 '24 06:10 VietND96

docker-compose up -d --build --force-recreate I also tried running it with docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:latest as recommended on Docker Hub page. Same results.

sergeygrigorev avatar Oct 03 '24 12:10 sergeygrigorev

Tried fixing the issue. Dockerfile:

FROM selenium/standalone-chrome:4.25.0
COPY ./novnc_proxy_updated /opt/bin/noVNC/utils/novnc_proxy

novnc_proxy_updated is a copy of original file with the failing -x check removed.

Running this:

# docker build .
# docker run -d --rm -p 4444:4444 -p 7900:7900 --shm-size="2g" <image-id>
# docker logs <container-id>
> WARN exited: novnc (exit status 1; not expected)
# docker exec -it <container-id> bash
# /opt/bin/start-novnc.sh

outputs this:

Trying to update the open file descriptor limit from 1048576 to 100000.
Successfully updated the open file descriptor limit.
Warning: could not find self.pem
Using local websockify at /opt/bin/noVNC/utils/websockify/run
realpath: /opt/bin/noVNC/utils/../: Operation not permitted
Starting webserver and WebSockets proxy on port 7900
/opt/bin/noVNC/utils/websockify/websockify/websocket.py:31: UserWarning: no 'numpy' module, HyBi protocol will be slower
  warnings.warn("no 'numpy' module, HyBi protocol will be slower")
Usage:
    __main__.py [options] [source_addr:]source_port target_addr:target_port
    __main__.py [options] --token-plugin=CLASS [source_addr:]source_port
    __main__.py [options] --unix-target=FILE [source_addr:]source_port
    __main__.py [options] [source_addr:]source_port -- WRAP_COMMAND_LINE

__main__.py: error: Too few arguments
Failed to start WebSockets proxy

sergeygrigorev avatar Oct 05 '24 13:10 sergeygrigorev

After fixing realpath: /opt/bin/noVNC/utils/../: Operation not permitted by making start-novnc.sh provide --web /opt/bin/noVNC to novnc_proxy script, noVNC starts successfully but shows wallpaper error:

fbsetbg: /usr/share/images/fluxbox/ubuntu-light.png isn't an existing wallpaper or a valid option.

sergeygrigorev avatar Oct 06 '24 12:10 sergeygrigorev

In latest image tag, this line is added https://github.com/SeleniumHQ/docker-selenium/blob/36ba1870f113aba414a08dd1211d5fc5409ff370/NodeBase/Dockerfile#L121 Can you try and confirm? If it didn't work, will check further, since in my env I also could not reproduce this.

VietND96 avatar Oct 14 '24 04:10 VietND96

I have the same problem with @sergeygrigorev . Did you find a solution? Many thanks to you

BlackManne avatar Oct 24 '24 11:10 BlackManne

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[bot] avatar Nov 25 '24 00:11 github-actions[bot]