Localhost refused to connect

I'm not able to successfully connect when using a Google Cloud VertexAI notebook. The default port 8080 is used, so I changfed the host port to 8081 and changed the jupyter exension url to http://localhost:8081. I am able to get the web server up but am not able to connect through the jupyterlab extension due to the localhost refusing to connect.

Here are some debugging steps I've tried:

  • Running simple HTTP server
    • Can successfully connect locally
  • Changed Prodigy Jupyter Extension host to 0.0.0.0 & 127.0.0.1 from localhost
    • Still no connection
  • Retried the installation from scratch

I'd love to be able to host the Prodigy web server from a Gcloud Jupyterlab but have had no luck so far. Any help would be much appreciated.

One quick idea: Is there anything you need to set in Google Cloud to expose that port and make it public? Maybe it's just not open?

Thanks for the response. I was thinking about doing that but based on what I understand, that will only be useful if I'm trying to contact the server from another server. In the Jupyter extension, I believe I'm trying to contact the server within the same server. I've been thinking more and more that I should allow HTTP connections and just limit the addresses allowed to connect but would rather not go that route if possible. If you have any other things I can try in order to get the extension working, please shout them out. Thank you!

I have a new update. I was able to expose the port and access it from my local machine. I was exposing port 80 which means the webserver needs to run on port 80 but the tricky part was getting it to not run on localhost. I think that because it's a VM, it needs to run on 0.0.0.0 rather than localhost. When I try to specify that within prodigy.json or the env var PRODIGY_HOST, I enter "0.0.0.0" and it tries to run the server on "0.0.0.0":80 - which obviously isn't right. I need it to run on 0.0.0.0:80 - it looks like the address is including the quotes. Is there a way that I can fix this issue? I'm not sure how to specify this host without specifying it as a string but if I do that, it won't start up the server.

Also, in the Jupyterlab extension, it seems to not be reflecting the host and port I specify in the settings. Regardless of the host I specify, it tells me that it can't connect to localhost. Not sure if that's just the default error it returns regardless of the specified host or if my settings aren't being applied.

Hi @Joshmantova , to configure the Jupyterlab Prodigy extension, (in Jupyterlab) head to "Settings" > "Advanced Settings Editor" > "Prodigy Jupyter Extension" then update the prodigyConfig with the URL you're checking. It might also be better if you enable HTTP (or HTTPS) traffic in your Google Cloud VM (or the VM where the Vertex AI notebook runs).

Not sure what you meant by this. Where do you see that "0.0.0.0":80 is being run? For reference, my prodigy.json config shows this:

{
"port": 8080,
"host": "0.0.0.0"
}

Perhaps PRODIGY_HOST=0.0.0.0 should do the trick so that it won't parse the quotation marks :thinking: