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]: noVNC does not start due to malfunctioning -x check #2416

Closed
sergeygrigorev opened this issue Sep 30, 2024 · 8 comments · Fixed by #2443
Closed

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

sergeygrigorev opened this issue Sep 30, 2024 · 8 comments · Fixed by #2443

Comments

@sergeygrigorev
Copy link

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

Copy link

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

@VietND96
Copy link
Member

VietND96 commented Oct 3, 2024

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
Copy link
Member

VietND96 commented Oct 3, 2024

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

@sergeygrigorev
Copy link
Author

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
Copy link
Author

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
Copy link
Author

sergeygrigorev commented Oct 6, 2024

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.

@VietND96
Copy link
Member

In latest image tag, this line is added

&& chmod +x /opt/bin/noVNC/utils/websockify/run \

Can you try and confirm? If it didn't work, will check further, since in my env I also could not reproduce this.

@BlackManne
Copy link

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

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

Successfully merging a pull request may close this issue.

3 participants