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

Localhost refused to work #41

Open
arafatkatze opened this issue Oct 22, 2024 · 16 comments
Open

Localhost refused to work #41

arafatkatze opened this issue Oct 22, 2024 · 16 comments

Comments

@arafatkatze
Copy link

image I am using MacOs and running VNC and that works perfectly for me but localhost refused to load.

Docker logs for me are perfectly okay


 anthropic-quickstarts git:(main) docker ps   
CONTAINER ID   IMAGE                                                               COMMAND                  CREATED              STATUS              PORTS                                                                                            NAMES
803ff1130258   ghcr.io/anthropics/anthropic-quickstarts:computer-use-demo-latest   "./entrypoint.sh"        About a minute ago   Up About a minute   0.0.0.0:5900->5900/tcp, 0.0.0.0:6080->6080/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8501->8501/tcp   vigorous_archimedes
9e3d9a6329db   sourcegraph/syntax-highlighter:insiders                             "/sbin/tini -- /synt…"   2 hours ago          Up 2 hours          0.0.0.0:9238->9238/tcp                                                                           syntax-highlighter
➜  anthropic-quickstarts git:(main) docker logs 803ff1130258            
Xvfb started successfully on display :1
Xvfb PID: 8
starting tint2 on display :1 ...
starting mutter
starting vnc
PORT=5900
starting noVNC
noVNC started successfully
✨ Computer Use Demo is ready!
➡️  Open http://localhost:8080 in your browser to begin
➜  anthropic-quickstarts git:(main) 

And also my anthropic key is fine too(Tested wtih a curl request that worked fine).

@arafatkatze arafatkatze changed the title Localhost refused to work on Chrome Localhost refused to work Oct 22, 2024
@arafatkatze
Copy link
Author

Getting the same error on both arc browser and chrome and I have turned off all security warnings.

@chrisgorgo
Copy link
Collaborator

Thanks for reporting.

  1. Can you access http://localhost:8501/ ?
  2. Does this happen even if you restart the docker container?

@arafatkatze
Copy link
Author

1.Can you access http://localhost:8501/ ?
Yes that works perfectly and I can see the actions on my preopened 8080 port and in the screenshots from 8501 port

  1. Does this happen even if you restart the docker container?
    Yes it does

@arafatkatze
Copy link
Author

The only error in my docker logs


`cody git:(main) ✗ docker ps                                        
CONTAINER ID   IMAGE                                                               COMMAND                  CREATED          STATUS          PORTS                                                                                            NAMES
803ff1130258   ghcr.io/anthropics/anthropic-quickstarts:computer-use-demo-latest   "./entrypoint.sh"        23 minutes ago   Up 23 minutes   0.0.0.0:5900->5900/tcp, 0.0.0.0:6080->6080/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8501->8501/tcp   vigorous_archimedes
9e3d9a6329db   sourcegraph/syntax-highlighter:insiders                             "/sbin/tini -- /synt…"   2 hours ago      Up 2 hours      0.0.0.0:9238->9238/tcp                                                                           syntax-highlighter
➜  cody git:(openai-newtype) ✗ docker logs 803ff1130258            
Xvfb started successfully on display :1
Xvfb PID: 8
starting tint2 on display :1 ...
starting mutter
starting vnc
PORT=5900
starting noVNC
noVNC started successfully
✨ Computer Use Demo is ready!
➡️  Open http://localhost:8080 in your browser to begin
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libpci missing (t=0.283) [GFX1-]: glxtest: libpci missing
➜  cody git:(openai-newtype) ✗ `

@x5a
Copy link
Collaborator

x5a commented Oct 22, 2024

@arafatkatze do you know if you're using dualstack ipv6/ipv4 docker?
do both of these commands return successfully?

curl -6 -v localhost:8501
curl -4 -v localhost:8501

@arafatkatze
Copy link
Author

I am using ipv4



docker network inspect bridge
[
    {
        "Name": "bridge",
        "Id": "fdc1b4a5fbe7c71efdf350c56fef7311913570d3d52c19ecb243040cb2add8da",
        "Created": "2024-10-17T17:27:33.446817291Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.17.0.0/16",
                    "Gateway": "172.17.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "803ff1130258272d03d3076ac48dfcb339a36ead785904c52e03ad3699769f91": {
                "Name": "vigorous_archimedes",
                "EndpointID": "87c5571021685ece15291bb1e43c8175dc2711b5fd0791df30f37a293e6cba73",
                "MacAddress": "02:42:ac:11:00:03",
                "IPv4Address": "172.17.0.3/16",
                "IPv6Address": ""
            },
            "9e3d9a6329db288d472b671c1ff2a9900cce70ce631d5de9c866bf6a4f76d06a": {
                "Name": "syntax-highlighter",
                "EndpointID": "1b95a5fe09182d270ee6841cb7e91605e48a3aeaf5d8c31f7df1c4dce2e9b4a5",
                "MacAddress": "02:42:ac:11:00:02",
                "IPv4Address": "172.17.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.bridge.default_bridge": "true",
            "com.docker.network.bridge.enable_icc": "true",
            "com.docker.network.bridge.enable_ip_masquerade": "true",
            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
            "com.docker.network.bridge.name": "docker0",
            "com.docker.network.driver.mtu": "65535"
        },
        "Labels": {}
    }
]

And both the curl commands return successfully though


* Host localhost:8501 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8501...
* Connected to localhost (::1) port 8501
> GET / HTTP/1.1
> Host: localhost:8501
> User-Agent: curl/8.6.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: TornadoServer/6.4.1
< Content-Type: text/html
< Date: Tue, 22 Oct 2024 18:22:18 GMT
< Accept-Ranges: bytes
< Etag: "2c06f1bb433d252a1eb544504956def4a269feb16611ea654d8c1a75495c830ea0b3d387e5cd3ddc0016819f4db0fc85474a0465d138dd293b9d952e5b947140"
< Last-Modified: Tue, 22 Oct 2024 14:34:30 GMT
< Cache-Control: no-cache
< Content-Length: 891
< Vary: Accept-Encoding
<
* Connection #0 to host localhost left intact
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.33ba0d1c.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>%          



curl -4 -v localhost:8501
* Host localhost:8501 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying 127.0.0.1:8501...
* Connected to localhost (127.0.0.1) port 8501
> GET / HTTP/1.1
> Host: localhost:8501
> User-Agent: curl/8.6.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: TornadoServer/6.4.1
< Content-Type: text/html
< Date: Tue, 22 Oct 2024 18:22:34 GMT
< Accept-Ranges: bytes
< Etag: "2c06f1bb433d252a1eb544504956def4a269feb16611ea654d8c1a75495c830ea0b3d387e5cd3ddc0016819f4db0fc85474a0465d138dd293b9d952e5b947140"
< Last-Modified: Tue, 22 Oct 2024 14:34:30 GMT
< Cache-Control: no-cache
< Content-Length: 891
< Vary: Accept-Encoding
<
* Connection #0 to host localhost left intact
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.33ba0d1c.js"></script><link href="./static/css/main.5513bd04.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>%                                                                     

@0xh3x
Copy link

0xh3x commented Oct 22, 2024

I had the same issue; restarting the container fixed it.

@arafatkatze
Copy link
Author

Solved for me now after re starting the container for the second time

@Malli88
Copy link

Malli88 commented Oct 29, 2024

Have the same problem on my environment but restarting is not fixing it.
localhost refuses connection and after several restarts and retries the container crashes

@Malli88
Copy link

Malli88 commented Oct 31, 2024

Thank you for reopening the issue.
Is there a workaround to fix the issue?

@arafatkatze
Copy link
Author

I added some thoughts here #141 since I couldn't make this work I will perhaps just make a separate VM and run this on it https://github.com/suitedaces/computer-agent/tree/main

To me it seems like the essence of the issue is that docker's port are not "showing up" and I can't do the port forwarding to my machine so perhaps I can just run a cheap VM on AWS and run the project above on it.

@Malli88
Copy link

Malli88 commented Oct 31, 2024 via email

@arafatkatze
Copy link
Author

For me restarting the whole computer and deleting chrome history specifically somehow worked right now but not sure how that happened.

@Malli88
Copy link

Malli88 commented Nov 1, 2024 via email

@p-i-
Copy link

p-i- commented Nov 3, 2024

It's not #147 <-- this issue, is it?

@tms1337
Copy link

tms1337 commented Nov 5, 2024

ok fixed it by:

  1. clearing site data for localhost:8080
  2. including more ports to open (see cmd below)

full cmd:

docker run \
  -p 5900:5900 \
  -p 6080:6080 \
  -p 8080:8080 \
  -p 8501:8501 \
  -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
  -it ghcr.io/anthropics/anthropic-quickstarts:computer-use-demo-latest

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

No branches or pull requests

7 participants