Notebook: Connection refused

Created on 13 Oct 2016  Â·  19Comments  Â·  Source: jupyter/notebook

Every time I launch the Jupyter notebook using


I get a

Connection refused: localhost:8888

I have to replace localhost with 127.0.0.1 for it to work.

This occurs with all browsers I use: Opera, Firefox, Chromium
OS: Ubuntu Gnome 16.04

Needs Info Environment

Most helpful comment

@takluyver I just found out that it happens because I had Turbo mode on.

All 19 comments

This sounds like an environment issue. Have you tried running any other servers in your environment? For example, you can run python -m SimpleHTTPServer 8888 to serve a directory with an index.html in it. If you're experiencing a similar issue with localhost not resolving, then I suggest doing a Google search for "ubuntu localhost connection refused".

@gnestor I ran the command and got

~/anaconda3/bin/python: No module named SimpleHTTPServer

The Python 3 version of that command is:

python -m http.server 8888

Thanks @takluyver

@takluyver @gnestor
Running it runs: Serving HTTP on 0.0.0.0 port 8888 ...
until I close it.

I should update you that it is not working just in Opera. In Firefox and Chromium it works.

When Opera is used the url being used is http://openurl%28http//localhost:8888/tree,new-page). And when using localhost:8888/tree) I get the Connection error.

When Opera is used the url being used is http://openurl%28http//localhost:8888/tree,new-page)

That sounds like something is misconfigured in Opera.

@takluyver I just found out that it happens because I had Turbo mode on.

Aha. I think 'Turbo' mode in Opera uses a proxy server to prefetch pages. I'm surprised it doesn't know to skip that for localhost, but I guess it doesn't.

I have the same issue both with and without opera turbo, with or without VPN. If anyone finds a workaround, I'd be happy to hear about it

I have also this problem please help This site can’t be reached when using Chrone

This could be caused by a firewall or environment like Docker where a specific IP address must be used vs. localhost. What does the console output look like after you run jupyter notebook?

I have this same issue, and am running a rails app on localhost:3000. My error in console is:
Refused to display 'http://localhost:8888/notebooks/jupyterNotebook/jupyter2.ipynb' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".

If I use the '"child-src *" then I get the error: "localhost refused to connect"

How can I debug Jupyter connection issues? I am trying to access a Jupyter server running on AWS from a remote Chrome browser. I tested that port 8888 is open and working using both nc -l 8888 on AWS as well as the python -m http.server 8888 command and both work without any issue.

If you can access the HTML interface but can't stay connected with a kernel, it's probably an issue with some proxy layer that is dropping the websocket connection.

I am getting this issue:
Failed to connect to server 127.0.0.1
please help
same case with local host too

I am using Putty and I was having the same issue because I forgot to click "add" after specifying the source and the local host :) if you click the "add" it will work. ;)
If you are still facing this problem you could check my Youtube channel for a detailed solution, I will be doing a video about it in the near future. If I still have not done the video by that time please write me in the comments so I can help you.

My youtube Channel:
https://www.youtube.com/channel/UCi46pc2k7P6FeFJWhS7qFwQ

Hello, I have jupyter connection issue. Can you help me out please?

Hi bettyshow, I am sorry I did not have the chance to make a video, could you please tell me more or add screenshots to your problem, then maybe I can help. Are you using Anaconda?

Thanks for your response, Shayal. D problem have been resolved. It's
working now

On Sat, Jun 29, 2019, 21:47 Sha-am Al Shayah notifications@github.com
wrote:

Hi bettyshow, I am sorry I did not have the chance to make a video, could
you please tell me more or add screenshots to your problem, then maybe I
can help. Are you using Anaconda?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/jupyter/notebook/issues/1832?email_source=notifications&email_token=AMOS6AC2L7BWDDXVZ3EIQ43P47C6JA5CNFSM4CSYZOE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY374XQ#issuecomment-506986078,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMOS6AE4Q3MRSH7WDEQUNVTP47C6JANCNFSM4CSYZOEQ
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikepqr picture mikepqr  Â·  3Comments

arilwan picture arilwan  Â·  3Comments

cmesro picture cmesro  Â·  3Comments

uolter picture uolter  Â·  3Comments

ehossain1982 picture ehossain1982  Â·  3Comments