Skip to content

A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration. #4630

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

Closed
Aravinviju opened this issue May 14, 2019 · 16 comments

Comments

@Aravinviju
Copy link

Hi
I have tried all the versions of the tornado, it doesn't solve the issue.
I started with python 3.6 and tried till python 3.7.3 with all the combinations of tornado versions.
Its still giving the same problem.
As I said I'm using jupyter in a GCP instance(ubuntu).
In the Same instance it works perfectly well for my colleague.
I have tried changing my machine too, but there wasn't any effect.
Check:
Isntance - checked with new instance.
Machine - Checked in a different machine.
Tornado versions - Tried all combinations, non worked.

The Jupyter notebook was perfectly work till last week and suddenly this happened. I'm not sure what the problem is. I have tried all the solutions you guys have mentioned on the other related issues.
image (4)
image (5)

I Connected from home on a Thursday and it was working fine, the next day at office when I connected back it started showing this error. Can Network change be an issue? or would it have changed or put some kind of security barrier in my office user profile or ID?

I clearly don't have a clue!

Any help on this is much appreciated.

Thanks
Arav

@TonyFly3000
Copy link

I am having the same issue here with Google cloud . I am able to open jupyter notebook .
But its keep saying "A connection to the notebook server could not be established"

I follow the step
https://towardsdatascience.com/running-jupyter-notebook-in-google-cloud-platform-in-15-min-61e16da34d52

@Aravinviju
Copy link
Author

@TonyFly3000 Can you please post the errors you are getting?

are you getting it as - Jupyter can't connect to kernel?

if yes, click on f12 to see if its a websocket issue
if yes, try downgrading the tornado versions to 5.1.1 or 4.5.3 as,

conda install tornado==4.5.3

If this doesn't work there could be a network issue for which none has found a solution yet.
Because none of the above solutions worked for me. Its my office network which was creating a problem, and it eventually rectified itself for me and I'm not sure what has changed it.

if none of these works for you, you can chuck this off and use google's notebook instance from AI platform option, go through this,
https://cloud.google.com/ml-engine/docs/notebooks/create-new

Let me know how it goes!

Thanks
Arav

@TonyFly3000
Copy link

@Aravinviju Hi Arav,

It turns out that its my company network issue. I am able to run the jupyter in a GCP at my home.

Its weird that when I run it in the company ,it keep showing "A connection to the notebook server could not be established"

I installed the R studio server at the same VM in GCP and its work fine in my company network.

Thank you
Tony Duan

@Aravinviju
Copy link
Author

@TonyFly3000 Hi Tony

Thanks for the update. This problem has been happening for a while for quite a lot of people.
But if you want to use the jupyter notebook in your organisation's network...you can do using the gcp notebook instance..its pretty straight forward. I'm using that as a back up if the problem comes again in my old GCP instance. The AI platform notebook instance doesn't show any kind of connection error because it doesn't really use private port or port specified by the user...and also the installation and set are done by google itself, so there shouldn't be any problem. I'm using it currently and it works perfectly for me.

But if you're comfortable using the R studio, its up to you.

Thanks
Arav

@intotecho
Copy link

I am using GCP AI Platform and am regularly getting this Server Connection Error error on a 'Terminal' flavoured Notebook. Started occurring about 3 weeks ago. Never noticed it before then. I was connecting via a hotel WiFi so thought it was the transport layer, but now I am connected at home with a fixed connection.
"A connection to the Jupyter server could not be established. JupyterLab will continue trying to reconnect. Check your network connection or Jupyter server configuration."

@AmazaspShumik
Copy link

@intotecho I have the same issue

@fedrer
Copy link

fedrer commented Apr 6, 2020

@TonyFly3000 Can you please post the errors you are getting?

are you getting it as - Jupyter can't connect to kernel?

if yes, click on f12 to see if its a websocket issue
if yes, try downgrading the tornado versions to 5.1.1 or 4.5.3 as,

conda install tornado==4.5.3

If this doesn't work there could be a network issue for which none has found a solution yet.
Because none of the above solutions worked for me. Its my office network which was creating a problem, and it eventually rectified itself for me and I'm not sure what has changed it.

if none of these works for you, you can chuck this off and use google's notebook instance from AI platform option, go through this,
https://cloud.google.com/ml-engine/docs/notebooks/create-new

Let me know how it goes!

Thanks
Arav

I had websocket issue and your conversation have helped me .. thank alot :)

@mikful
Copy link

mikful commented Apr 9, 2020

I'm also having this problem with an AI Notebook Instance, the same as here:

https://stackoverflow.com/questions/60423090/server-connection-error-on-gcp-ai-platform-notebook

@adi5686
Copy link

adi5686 commented Apr 15, 2020

hi guys

i am facing the same issue..and looks like none of the suggestions given here are working for me
I have downgraded the tornado version from 6 to 5.1.1
have re-installed the navigator at a different location a couple of time.
This is really turning into a nightmare for me...really looking for some help!

thanks
Aditya

@gertorro
Copy link

Same here,
downgraded tornado and the browser console says this:

load_extensions
Arguments(1)
bidi.js:19 Loaded moment locale es
session.js:54 Session: kernel_created (e822ce90-e272-4a25-9b9b-69d269e2ab12)
kernel.js:462 Starting WebSockets: ws://localhost:8888/api/kernels/9dd17b4d-fec9-436e-8265-fc17410c9134
utils.js:37 Loading extension: jupyter-js-widgets/extension
kernel.js:106 Kernel: kernel_connected (9dd17b4d-fec9-436e-8265-fc17410c9134)
kernel.js:492 WebSocket closed unexpectedly
CloseEvent
kernel.js:106 Kernel: kernel_disconnected (9dd17b4d-fec9-436e-8265-fc17410c9134)
kernel.js:563 Connection lost, reconnecting in 1 seconds.
kernel.js:106 Kernel: kernel_reconnecting (9dd17b4d-fec9-436e-8265-fc17410c9134)
kernel.js:462 Starting WebSockets: ws://localhost:8888/api/kernels/9dd17b4d-fec9-436e-8265-fc17410c9134

​After that is timeout after timeout:
kernel.js:464 WebSocket connection to 'ws://localhost:8888/api/kernels/9dd17b4d-fec9-436e-8265-fc17410c9134/channels?session_id=fa67e98fa3084899988dd980d929265f' failed: WebSocket opening handshake timed out
Kernel.start_channels @ kernel.js:464
kernel.js:106 Kernel: kernel_disconnected (9dd17b4d-fec9-436e-8265-fc17410c9134)
kernel.js:545 WebSocket connection failed: ws://localhost:8888/api/kernels/9dd17b4d-fec9-436e-8265-fc17410c9134 true
kernel.js:563 Connection lost, reconnecting in 2 seconds.
kernel.js:492 WebSocket closed unexpectedly CloseEvent {isTrusted: true, wasClean: false, code: 1006, reason: "", type: "close", …}
kernel.js:106 Kernel: kernel_reconnecting (9dd17b4d-fec9-436e-8265-fc17410c9134)
kernel.js:462 Starting WebSockets: ws://localhost:8888/api/kernels/9dd17b4d-fec9-436e-8265-fc17410c9134

Any suggestion?
Thanks,
Germán

@erdalkaraca
Copy link

I had the same issue. For me it was due to a reverse proxy that I had to also enable WebSockets for by adding the appropriate headers.

@BjarkePedersen
Copy link

I had a VPN running. Disabling it fixed the problem for me.

@AlhiloMustafa
Copy link

on my "C:\Users\musal" directory I got this same error :
"A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration."

But I installed it on another directory ( C:\pythonDeepdivPdf\5_objects and classes ) it is working fine now, I installed it using official website https://jupyter.org/install :

If you use pip, you can install it with (but make sure to install it in the directory you want ):

  • pip install notebook

Congratulations, you have installed Jupyter Notebook! To run the notebook, run the following command at the Terminal (Mac/Linux) or Command Prompt (Windows):

  • jupyter notebook

@BayoOlawumi
Copy link

I installed Python on my PC and everything started working....I didn't install python before installing anaconda

@rachel662
Copy link

hi there, I have this same issue, but I only get this when running jupyter notebooks in R, when i use python 3 notebooks it connects to the kernel fine - would anyone be able to help?

Kind regards,
Rachel

@kevin-bates
Copy link
Member

Hi @rachel662 - I would check the argv: stanza of the R kernel's kernel.json file and ensure it's pointing to a valid R program. To locate the kernel.json file, issue jupyter kernelspec list from the command line, locate the name of the R kernel in the column on the left and its directory in the column on the right. In there should be the kernel.json file.

FWIW, mine looks as follows (running on a Mac OS):

{
  "argv": ["/Library/Frameworks/R.framework/Resources/bin/R", "--slave", "-e", "IRkernel::main()", "--args", "{connection_file}"],
  "display_name": "R",
  "language": "R"
}

Should you still encounter issues, it might be a good idea to include the output of the notebook server's console in a follow-up comment as connection issues have many manifestations.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests