-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[computer-use-demo] noVNC Failed to connect to server #42
Comments
Does this persist after refreshing the browser or restarting the container? Can you access http://localhost:6080/vnc.html or vnc://localhost:5900 |
Same issue |
restart container helps. works for me now. |
I'm closing this as a known issue until we are able to reproduce and fix on our end |
From #48 here's the console error message prior to the restart:
|
On Ubuntu 24.10 running KDE and the web app in your docker container just tries to connect but doesn't do anything: The weird thing is that if I run the agent, it seems it can see it. It even shows a screenshot: Eventually (minutes later) I get the standard FAILED to connect to server noVNC from other people. Inside the docker container:
I do not see a computeruse@4213af600317:/tmp$ ls /tmp/
novnc.log outputs python-build.20241022145738.118.log server_logs.txt streamlit_stdout.log
computeruse@4213af600317:/tmp$ This is what computeruse@4213af600317:/tmp$ cat novnc.log
Warning: could not find self.pem
Using local websockify at /opt/noVNC/utils/websockify/run
Starting webserver and WebSockets proxy on port 6080
WebSocket server settings:
- Listen on :6080
- Web server. Web root: /opt/noVNC
- No SSL/TLS support (no cert file)
- proxying from :6080 to localhost:5900
Navigate to this URL:
http://4213af600317:6080/vnc.html?host=4213af600317&port=6080
Press Ctrl-C to exit
172.17.0.1 - - [22/Oct/2024 22:11:05] 172.17.0.1: Plain non-SSL (ws://) WebSocket connection
172.17.0.1 - - [22/Oct/2024 22:11:05] 172.17.0.1: Path: '/websockify'
172.17.0.1 - - [22/Oct/2024 22:11:05] connecting to: localhost:5900
handler exception: [Errno 107] Transport endpoint is not connected
172.17.0.1 - - [22/Oct/2024 22:36:33] 172.17.0.1: Plain non-SSL (ws://) WebSocket connection
172.17.0.1 - - [22/Oct/2024 22:36:33] 172.17.0.1: Path: '/websockify'
172.17.0.1 - - [22/Oct/2024 22:36:33] connecting to: localhost:5900
172.17.0.1 - - [22/Oct/2024 22:36:33] Failed to connect to localhost:5900: [Errno 111] Connection refused
computeruse@4213af600317:/tmp$ This is what netstat shows: computeruse@4213af600317:~$ netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:6080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8501 0.0.0.0:* LISTEN
tcp 0 0 4213af600317:8501 172.17.0.1:40714 ESTABLISHED
tcp 0 0 localhost:57068 localhost:6080 TIME_WAIT
tcp 25 0 4213af600317:33000 160.79.104.10:https CLOSE_WAIT
tcp 25 0 4213af600317:32996 160.79.104.10:https CLOSE_WAIT
tcp6 0 0 [::]:http-alt [::]:* LISTEN
tcp6 0 0 [::]:8501 [::]:* LISTEN
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 3 [ ] STREAM CONNECTED 347318 @/tmp/.X11-unix/X1
unix 3 [ ] STREAM CONNECTED 343724
unix 3 [ ] STREAM CONNECTED 340514 @/tmp/.X11-unix/X1
unix 3 [ ] STREAM CONNECTED 347339
unix 3 [ ] STREAM CONNECTED 347338
unix 3 [ ] STREAM CONNECTED 347317
unix 3 [ ] STREAM CONNECTED 328702 @/tmp/.X11-unix/X1
unix 3 [ ] STREAM CONNECTED 326964
unix 2 [ ACC ] STREAM LISTENING 339840 @/tmp/.X11-unix/X1
computeruse@4213af600317:~$ I tried running the vnc server manually inside the Docker container and got this output: computeruse@4213af600317:~$ x11vnc -display $DISPLAY \
-forever \
-shared \
-wait 50 \
-timeout 60 \
-noxrecord \
-noxfixes \
-noxdamage \
-rfbport 5900
22/10/2024 22:45:14 passing arg to libvncserver: -rfbport
22/10/2024 22:45:14 passing arg to libvncserver: 5900
###############################################################
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
#@ @#
#@ ** WARNING ** WARNING ** WARNING ** WARNING ** @#
#@ @#
#@ YOU ARE RUNNING X11VNC WITHOUT A PASSWORD!! @#
#@ @#
#@ This means anyone with network access to this computer @#
#@ may be able to view and control your desktop. @#
#@ @#
#@ >>> If you did not mean to do this Press CTRL-C now!! <<< @#
#@ @#
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
#@ @#
#@ You can create an x11vnc password file by running: @#
#@ @#
#@ x11vnc -storepasswd password /path/to/passfile @#
#@ or x11vnc -storepasswd /path/to/passfile @#
#@ or x11vnc -storepasswd @#
#@ @#
#@ (the last one will use ~/.vnc/passwd) @#
#@ @#
#@ and then starting x11vnc via: @#
#@ @#
#@ x11vnc -rfbauth /path/to/passfile @#
#@ @#
#@ an existing ~/.vnc/passwd file from another VNC @#
#@ application will work fine too. @#
#@ @#
#@ You can also use the -passwdfile or -passwd options. @#
#@ (note -passwd is unsafe if local users are not trusted) @#
#@ @#
#@ Make sure any -rfbauth and -passwdfile password files @#
#@ cannot be read by untrusted users. @#
#@ @#
#@ Use x11vnc -usepw to automatically use your @#
#@ ~/.vnc/passwd or ~/.vnc/passwdfile password files. @#
#@ (and prompt you to create ~/.vnc/passwd if neither @#
#@ file exists.) Under -usepw, x11vnc will exit if it @#
#@ cannot find a password to use. @#
#@ @#
#@ @#
#@ Even with a password, the subsequent VNC traffic is @#
#@ sent in the clear. Consider tunnelling via ssh(1): @#
#@ @#
#@ http://www.karlrunge.com/x11vnc/#tunnelling @#
#@ @#
#@ Or using the x11vnc SSL options: -ssl and -stunnel @#
#@ @#
#@ Please Read the documentation for more info about @#
#@ passwords, security, and encryption. @#
#@ @#
#@ http://www.karlrunge.com/x11vnc/faq.html#faq-passwd @#
#@ @#
#@ To disable this warning use the -nopw option, or put @#
#@ 'nopw' on a line in your ~/.x11vncrc file. @#
#@ @#
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
###############################################################
22/10/2024 22:45:15 x11vnc version: 0.9.16 lastmod: 2019-01-05 pid: 731
22/10/2024 22:45:15 XOpenDisplay("-forever") failed.
22/10/2024 22:45:15 Trying again with XAUTHLOCALHOSTNAME=localhost ...
22/10/2024 22:45:15 ***************************************
22/10/2024 22:45:15 *** XOpenDisplay failed (-forever)
*** x11vnc was unable to open the X DISPLAY: "-forever", it cannot continue.
*** There may be "Xlib:" error messages above with details about the failure.
Some tips and guidelines:
** An X server (the one you wish to view) must be running before x11vnc is
started: x11vnc does not start the X server. (however, see the -create
option if that is what you really want).
** You must use -display <disp>, -OR- set and export your $DISPLAY
environment variable to refer to the display of the desired X server.
- Usually the display is simply ":0" (in fact x11vnc uses this if you forget
to specify it), but in some multi-user situations it could be ":1", ":2",
or even ":137". Ask your administrator or a guru if you are having
difficulty determining what your X DISPLAY is.
** Next, you need to have sufficient permissions (Xauthority)
to connect to the X DISPLAY. Here are some Tips:
- Often, you just need to run x11vnc as the user logged into the X session.
So make sure to be that user when you type x11vnc.
- Being root is usually not enough because the incorrect MIT-MAGIC-COOKIE
file may be accessed. The cookie file contains the secret key that
allows x11vnc to connect to the desired X DISPLAY.
- You can explicitly indicate which MIT-MAGIC-COOKIE file should be used
by the -auth option, e.g.:
x11vnc -auth /home/someuser/.Xauthority -display :0
x11vnc -auth /tmp/.gdmzndVlR -display :0
you must have read permission for the auth file.
See also '-auth guess' and '-findauth' discussed below.
** If NO ONE is logged into an X session yet, but there is a greeter login
program like "gdm", "kdm", "xdm", or "dtlogin" running, you will need
to find and use the raw display manager MIT-MAGIC-COOKIE file.
Some examples for various display managers:
gdm: -auth /var/gdm/:0.Xauth
-auth /var/lib/gdm/:0.Xauth
kdm: -auth /var/lib/kdm/A:0-crWk72
-auth /var/run/xauth/A:0-crWk72
xdm: -auth /var/lib/xdm/authdir/authfiles/A:0-XQvaJk
dtlogin: -auth /var/dt/A:0-UgaaXa
Sometimes the command "ps wwwwaux | grep auth" can reveal the file location.
Starting with x11vnc 0.9.9 you can have it try to guess by using:
-auth guess
(see also the x11vnc -findauth option.)
Only root will have read permission for the file, and so x11vnc must be run
as root (or copy it). The random characters in the filenames will of course
change and the directory the cookie file resides in is system dependent.
See also: http://www.karlrunge.com/x11vnc/faq.html
computeruse@4213af600317:~ |
@x5a let me know if you need any extra info to repro. Thanks |
@rburhum this is very helpful, I'll let you know what I find |
I also tried setting up DISPLAY to |
@rburhum
Can you pull the latest container and tell me if you see any logs from the docker execution? 0cd8e73 adds exception logging for x11vnc and automatic restart - specifically interested in logging that starts with |
This is the image I have: ❯ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ghcr.io/anthropics/anthropic-quickstarts computer-use-demo-latest e11803f5a79d 3 hours ago 2.8GB And I did run that updated docker image 3hrs ago. Every once in awhile, I see this in the stdout:
but the │ ~/src/anthropic-quickstarts/computer-use-demo │ main ?1 ──❯ docker exec -ti 23a7 /bin/bash
computeruse@23a7cb535f37:~$ cd /tmp/
computeruse@23a7cb535f37:/tmp$ ls
novnc.log server_logs.txt x11vnc_stderr.log
python-build.20241022145738.118.log streamlit_stdout.log
computeruse@23a7cb535f37:/tmp$ less x11vnc_stderr.log
computeruse@23a7cb535f37:/tmp$ cat x11vnc_stderr.log
computeruse@23a7cb535f37:/tmp$ ls
novnc.log server_logs.txt x11vnc_stderr.log
python-build.20241022145738.118.log streamlit_stdout.log
computeruse@23a7cb535f37:/tmp$ ls -l
total 1156
-rw-r--r-- 1 computeruse computeruse 1019 Oct 23 01:05 novnc.log
-rw-r--r-- 1 computeruse computeruse 1168312 Oct 22 14:59 python-build.20241022145738.118.log
-rw-r--r-- 1 computeruse computeruse 136 Oct 23 01:03 server_logs.txt
-rw-r--r-- 1 computeruse computeruse 172 Oct 23 00:56 streamlit_stdout.log
-rw-r--r-- 1 computeruse computeruse 0 Oct 23 01:06 x11vnc_stderr.log
computeruse@23a7cb535f37:/tmp$ Here are all the other log files just in case (except the python-build): computeruse@23a7cb535f37:/tmp$ for file in *; do
if [ -f "$file" ] && [ "$file" != "python-build.20241022145738.118.log" ]; then
echo "=== $file ==="
cat "$file"
echo
fi
done
=== novnc.log ===
Warning: could not find self.pem
Using local websockify at /opt/noVNC/utils/websockify/run
Starting webserver and WebSockets proxy on port 6080
WebSocket server settings:
- Listen on :6080
- Web server. Web root: /opt/noVNC
- No SSL/TLS support (no cert file)
- proxying from :6080 to localhost:5900
Navigate to this URL:
http://23a7cb535f37:6080/vnc.html?host=23a7cb535f37&port=6080
Press Ctrl-C to exit
172.17.0.1 - - [23/Oct/2024 00:57:19] 172.17.0.1: Plain non-SSL (ws://) WebSocket connection
172.17.0.1 - - [23/Oct/2024 00:57:19] 172.17.0.1: Path: '/websockify'
172.17.0.1 - - [23/Oct/2024 00:57:19] connecting to: localhost:5900
handler exception: [Errno 107] Transport endpoint is not connected
172.17.0.1 - - [23/Oct/2024 01:03:07] 172.17.0.1: Plain non-SSL (ws://) WebSocket connection
172.17.0.1 - - [23/Oct/2024 01:03:07] 172.17.0.1: Path: '/websockify'
172.17.0.1 - - [23/Oct/2024 01:03:07] connecting to: localhost:5900
handler exception: [Errno 107] Transport endpoint is not connected
=== output.txt ===
=== novnc.log ===
Warning: could not find self.pem
Using local websockify at /opt/noVNC/utils/websockify/run
Starting webserver and WebSockets proxy on port 6080
WebSocket server settings:
- Listen on :6080
- Web server. Web root: /opt/noVNC
- No SSL/TLS support (no cert file)
- proxying from :6080 to localhost:5900
Navigate to this URL:
http://23a7cb535f37:6080/vnc.html?host=23a7cb535f37&port=6080
Press Ctrl-C to exit
172.17.0.1 - - [23/Oct/2024 00:57:19] 172.17.0.1: Plain non-SSL (ws://) WebSocket connection
172.17.0.1 - - [23/Oct/2024 00:57:19] 172.17.0.1: Path: '/websockify'
172.17.0.1 - - [23/Oct/2024 00:57:19] connecting to: localhost:5900
handler exception: [Errno 107] Transport endpoint is not connected
172.17.0.1 - - [23/Oct/2024 01:03:07] 172.17.0.1: Plain non-SSL (ws://) WebSocket connection
172.17.0.1 - - [23/Oct/2024 01:03:07] 172.17.0.1: Path: '/websockify'
172.17.0.1 - - [23/Oct/2024 01:03:07] connecting to: localhost:5900
handler exception: [Errno 107] Transport endpoint is not connected
=== server_logs.txt ===
::ffff:172.17.0.1 - - [23/Oct/2024 00:57:19] "GET / HTTP/1.1" 200 -
::ffff:172.17.0.1 - - [23/Oct/2024 01:03:07] "GET / HTTP/1.1" 304 -
=== streamlit_stdout.log ===
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://172.17.0.2:8501
External URL: http://184.179.2.90:8501
=== x11vnc_stderr.log ===
=== server_logs.txt ===
::ffff:172.17.0.1 - - [23/Oct/2024 00:57:19] "GET / HTTP/1.1" 200 -
::ffff:172.17.0.1 - - [23/Oct/2024 01:03:07] "GET / HTTP/1.1" 304 -
=== streamlit_stdout.log ===
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://172.17.0.2:8501
External URL: http://184.179.2.90:8501
=== x11vnc_stderr.log ===
computeruse@23a7cb535f37:/tmp$ Same issue. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Same issue here. It seems
Main docker container logs:
Tried building from latest commit
|
Ran into the same issue with computer-use-demo-latest (computer-use-demo-a306792). Restarting the docker service or container did not help, but this worked for me: TL;DRI killed the Longer version:Start docker container. Same as demo docs, but with added WIDTH and HEIGHT env variables.
Open bash in the docker container:
Kill the
After that I ran x11vnc like this, with fewer flags and
After that I had my first succesful connects in NoVNC at http://localhost:6080/vnc.html and the demo app at https://localhost:8080.
|
@jd7h solution worked for me too. It is running slow, but it works. I am going to play with the memory settings. Thanks all! |
Thanks @jd7h for the investigation - while I can't reproduce this on my side, can you check that vnc this image works out of the box: i.e.,:
|
Still getting "Connecting..." I can add another data point, though, the original My laptop is running arch (updated today):
|
@jd7h's solution worked for me but i had to be real patient, took about 3 minutes to "boot". thanks!
i would also raise the issue that the iframes are targeting |
|
|
My computer turned out to be too slow, so it took about half an hour for the virtual machine to boot up. During all that time I had this error, and then the desktop appeared. :-) |
noVNC Failed to connect to server.
Normal chat and screen cap works.
The text was updated successfully, but these errors were encountered: