Closed debsahu closed 6 years ago
Were you using Colaboratory from a different browser or user profile than your local Jupyter instance?
This extension uses Jupyter's token authorization flow, which sets an authorization cookie in your browser. If the cookie isn't present when Colaboratory attempts a connection, you'll see behavior like you described.
To help prevent issues like these from cropping up, you could start your Jupyter server using the --no-browser
flag and open the provided link that appears in the terminal from the same browser that you currently have Colaboratory open in.
Example:
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' \
--port=9090 --no-browser
I completely disabled my firewall/antivirus. It is the same browser (chrome), that https://colab.research.google.com was open. Just for testing I did issue the command suggested above with --no-browser option, I get the same errors. I closed everything and used firefox as well (enabling network.websocket.allowInsecureFromHTTPS) and the same result.
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=9090
--no-browser
jupyter_http_over_ws extension initialized. Listening on /http_over_websocket
[I 17:57:49.410 NotebookApp] JupyterLab beta preview extension loaded from C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab
[I 17:57:49.410 NotebookApp] JupyterLab application directory is C:\ProgramData\Anaconda3\share\jupyter\lab
[W 17:57:49.434 NotebookApp] Error loading server extension jupyterlab
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 321, in __init__
self._run(['node', 'node-version-check.js'], cwd=HERE, quiet=True)
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 1165, in _run
proc = Process(cmd, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab\process.py", line 73, in __init__
self.proc = self._create_process(cwd=cwd, env=env)
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab\process.py", line 131, in _create_process
cmd[0] = which(cmd[0], kwargs.get('env'))
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab\jlpmapp.py", line 59, in which
raise ValueError(msg)
ValueError: Please install nodejs 5+ and npm before continuing installation. nodejs may be installed using conda or directly from the nodejs website.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 1454, in init_server_extensions
func(self)
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab\extension.py", line 111, in load_jupyter_server_extension
info = get_app_info(app_dir)
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 244, in get_app_info
handler = _AppHandler(app_dir, logger)
File "C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 324, in __init__
raise ValueError(msg)
ValueError: Please install nodejs 5+ and npm before continuing installation. nodejs may be installed using conda or directly from the nodejs website.
[I 17:57:49.648 NotebookApp] Serving notebooks from local directory: C:\programdata\Anaconda3
[I 17:57:49.649 NotebookApp] 0 active kernels
[I 17:57:49.650 NotebookApp] The Jupyter Notebook is running at:
[I 17:57:49.650 NotebookApp] http://localhost:9090/?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[I 17:57:49.651 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 17:57:49.654 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:9090/?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[W 18:00:21.655 NotebookApp] Forbidden
[W 18:00:21.657 NotebookApp] 403 GET /api/kernelspecs (::1) 3.00ms referer=None
I used simple websocket client and connected to ws://localhost:9090/http_over_websocket?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
and it connects, even though the origin was localhost and not https://colab.research.google.com! So either way, the websocket component is working from Jupyter's perspective.
~Do you think my network provider is blocking certain ports from colab? I will retry on a private network.~ same result on private network
Ok got it working! It was the ad blockers. Had to disable them to get this working, add that info to the README?
I get a similar issue where even adding --no-browser
cannot fix that problem.
A potential (but not safe at all) solution is by adding --NotebookApp.token='' --NotebookApp.disable_check_xsrf=True
.
My final running command looks like:
jupyter notebook --no-browser --allow-root --NotebookApp.allow_origin='https://colab.research.google.com' --NotebookApp.token='' --NotebookApp.disable_check_xsrf=True
I'm getting below error,need help to trobleshoot
I'm also getting this it keep saying connecting but at the end this dialog shows up!
I've followed the steps in here and checked on the issues on this page, but still can't connect to local.
By using:
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' \
> --port=9090 --no-browser
response is:
jupyter_http_over_ws extension initialized. Listening on /http_over_websocket
JupyterLab beta preview extension loaded from /Users/myUser/anaconda3/lib/python3.6/site-packages/jupyterlab
JupyterLab application directory is /Users/myUser/anaconda3/share/jupyter/lab
Serving notebooks from local directory: /Users/myUser
0 active kernels
The Jupyter Notebook is running at:
http://localhost:9090/?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:9090/?token= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&token= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
So I copy and paste
http://localhost:9090/?token= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&token= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
in my browser (Safari) and get the page response:
302 GET /?token= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&token= xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (::1) 1.56ms
But when I go on Colab and try to connect to local runtime (with the right port 9090 in this case) it says: Unable to connect to the runtime. Troubleshoot.
And it asks me to check:
Ensure the jupyter_http_over_ws Jupyter extension is enabled and up to date on your machine.
pip install --upgrade jupyter_http_over_ws>=0.0.1a3 && \ jupyter serverextension enable --py jupyter_http_over_ws
Ensure the notebook server on your machine is running on port 9090 and accepting requests from https://colab.research.google.com.
jupyter notebook \ --NotebookApp.allow_origin='https://colab.research.google.com' \ --port=9090 \ --NotebookApp.port_retries=0
which I tried but have the same results.
About jupyter_http_over_ws in my system, it shows:
pip show jupyter_http_over_ws
Name: jupyter-http-over-ws
Version: 0.0.6
Summary: Jupyter support for HTTP-over-ws
Home-page: https://github.com/googlecolab/jupyter_http_over_ws
Author: Google Colaboratory team
Author-email: colaboratory-team@google.com
License: Apache 2.0
Location: /Users/myUser/anaconda3/lib/python3.6/site-packages
Requires: six, notebook, tornado, enum34
Required-by:
This happens for any notebook on Colab, even with a new one or with just markdown or import package
Hi, has anyone found an alternative solution to disable_check_xsrf? Disabling the ad blockers does not solve the problem for me.
This is super frustrating I have even attempted to use the disable_check_xsrf, disabled my Norton software and disabled my MacOS firewall and still nothing. BTW the firewall is not the problem because this works just fine in Chrome with the normal suggested jupiter notebook command.
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=9090 --NotebookApp.port_retries=0 --no-browser --NotebookApp.disable_check_xsrf=True --NotebookApp.token=''
Does not work on Safari
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=9090 --NotebookApp.port_retries=0 --no-browser
Does not work on Safari Does work in Chrome
When attempting with Safari, the terminal window where I executed jupyter notebook
does not show any STDERR or STDOUT, the browser window simply and immediately returns a could not connect... troubleshoot message with NO details.
Colaboratory attempts to make a connection to your local kernel using a WebSocket (ws://). Safari disallows connections from HTTPS domains using insecure WebSockets. Due to this, you won't be able to connect to your local kernel using Safari.
We'll work to update our documentation and error handling to try and make this more clear. An additional place to look when encountering issues like this is in the console of your browser's developer tools.
I had this issue because I had disabled 3rd party cookies. Fixed by enabling them.
My colab notebook has suddenly stopped connecting to jupyter runtime - does anyone know how to fix this? I get the same connection output as below
I'm getting below error,need help to trobleshoot
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --NotebookApp.port_retries=0 --notebook-dir="
worked for me chrome : 78.0.3904.108 win 10 : 1909 update
Thank you talk2sunil83. It also worked for me after hours of trying other solutions.
@colaboratory-team I still could not connect (Windows 10, Chrome 81 beta, Anaconda3) after following troubleshooting steps, updating jupyter config, spending an hour on it. The command from @talk2sunil83 worked like a charm. Perhaps this command should be added as an alternative step to try in the official troubleshooting document?
Fixed it. The only option for me was to remove the password from the jupyter config file (the one you set when you first open jupyter notebooks) and simply copy and paste the generated token into the backend url when connecting to colab.
The password in the jupyter config file was my problem too. Removing the password fixed it. Thanks @cmp1 !
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --NotebookApp.port_retries=0 --notebook-dir="" --no-browser --allow-root --NotebookApp.token='' --NotebookApp.disable_check_xsrf=True --port=8888
worked for me chrome : 78.0.3904.108 win 10 : 1909 update
I tried this but still can't connect
[I 13:09:14.093 NotebookApp] 302 GET / (::1) 0.00ms
[I 13:09:14.096 NotebookApp] Refusing to serve hidden directory, via 404 Error
[W 13:09:14.098 NotebookApp] 404 GET /tree (::1) 2.00ms referer=None
[E 13:09:14.098 NotebookApp] Uncaught error when proxying request
Traceback (most recent call last):
File "c:\python\python37\lib\site-packages\jupyter_http_over_ws\handlers.py", line 180, in _attach_auth_cookies
parsed_auth_url, self.ca_certs, self._get_http_client())
File "c:\python\python37\lib\site-packages\tornado\gen.py", line 1055, in run
value = future.result()
File "c:\python\python37\lib\site-packages\tornado\concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "
Is Safari one of the supported browsers at all? I've been trying all the mentioned solutions above, but all my attempts were in vain. Any help is appreciated, thank you!
Followed instructions as described here. Jupyter works on localhost without issues. I open the firewall to allow TCP over port 9090 and issued this
and tried to reconnect in codelab, it fails and this is what is seen on the jupyter terminal.
Any help appreciated!