Can’t connect to Jupyter Notebook (tried 3 different machines) ERR_CONNECTION_TIMED_OUT

(Vishnu Vemuru) #21

Wow, this works. Thanks a lot Diego.

(karenerobinson) #22

I had this problem too and did some investigation.

If @dmenin 's port forwarding solution works, that can mean that even though your security group is set to listen on the right ports, jupyter isn’t. (That’s what it meant for me.)

I verified this by running sudo netstat -nltp, which returned this:

$ sudo netstat -nltp 
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0    *               LISTEN      1177/sshd
tcp        0      0*               LISTEN      1859/python

The first line is for ssh (port 22). The means it listens for ssh on any IP. The second line is for port 8888, but there it only listens on its localhost IP,

If you want to dig further you can run ifconfig and you will probably see two another IP. For me it’s, which must be somehow magically mapped back to my “elastic IP” from AWS.

OK so to solve it you make jupyter notebook listen on both its IPs. I used this stackoverflow solution, which says to: check for jupyter notebook configuration file, in ~/.jupyter/ . If it’s not there, run jupyter notebook --generate-config. Then open the file in an editor and find the line to edit about IPs.

Then I realized that a better solution was to find the fast ai config file, which I found here (no guarantees that it’s up to date though):