Skip to content
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

Intermittently occuring "Connection Failed" error nesccessitates cache refresh on Firefox for temporary fix #3873

Open
dburkhardt opened this issue Aug 22, 2018 · 3 comments

Comments

@dburkhardt
Copy link

dburkhardt commented Aug 22, 2018

I recently updated two workstations (Arch) including jupyter-notebook 5.3.0-3 -> 5.3.0-4. Since then, I've been having a strange issue with using Jupyter via SSH port forwarding. If I try to open a notebook on Firefox (61.0.2) by connecting to localhost:8888, I get the standard "Connection Failed" error. Looking at the web console in Firefox I get the following output which makes me think it's a websocket error.

Use of Mutation Events is deprecated. Use MutationObserver instead. jquery.min.js:5
actions jupyter-notebook:find-and-replace does not exist, still binding it in case it will be defined later... menubar.js:304
accessing "actions" on the global IPython/Jupyter is not recommended. Pass it to your objects contructors at creation time main.js:208
Loaded moment locale en bidi.js:19
load_extensions 
Arguments { 0: "jupyter-js-widgets/extension", … }
utils.js:60
Loading extension: jupyter-js-widgets/extension utils.js:37
Session: kernel_created (33583303-de4a-42c6-8b8b-b14e2573fda6) session.js:54
Starting WebSockets: ws://localhost:8888/api/kernels/7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856 kernel.js:459
Firefox can’t establish a connection to the server at ws://localhost:8888/api/kernels/7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856/channels?session_id=E94F7CA503584275A5037A15B0AC6E23. kernel.js:461
Kernel: kernel_disconnected (7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856) kernel.js:103
WebSocket connection failed:  ws://localhost:8888/api/kernels/7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856 true kernel.js:544
Connection lost, reconnecting in 1 seconds. kernel.js:562
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at about:blank. (Reason: CORS request not http).
Kernel: kernel_reconnecting (7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856) kernel.js:103
Starting WebSockets: ws://localhost:8888/api/kernels/7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856 kernel.js:459
Firefox can’t establish a connection to the server at ws://localhost:8888/api/kernels/7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856/channels?session_id=E94F7CA503584275A5037A15B0AC6E23. kernel.js:461
Kernel: kernel_disconnected (7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856) kernel.js:103
WebSocket connection failed:  ws://localhost:8888/api/kernels/7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856 true kernel.js:544
Connection lost, reconnecting in 2 seconds. kernel.js:562
Kernel: kernel_reconnecting (7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856) kernel.js:103
Starting WebSockets: ws://localhost:8888/api/kernels/7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856 kernel.js:459
Firefox can’t establish a connection to the server at ws://localhost:8888/api/kernels/7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856/channels?session_id=E94F7CA503584275A5037A15B0AC6E23. kernel.js:461
Kernel: kernel_disconnected (7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856) kernel.js:103
WebSocket connection failed:  ws://localhost:8888/api/kernels/7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856 true kernel.js:544
Connection lost, reconnecting in 4 seconds. kernel.js:562
Kernel: kernel_reconnecting (7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856) kernel.js:103
Starting WebSockets: ws://localhost:8888/api/kernels/7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856 kernel.js:459
Firefox can’t establish a connection to the server at ws://localhost:8888/api/kernels/7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856/channels?session_id=E94F7CA503584275A5037A15B0AC6E23. kernel.js:461
Kernel: kernel_disconnected (7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856) kernel.js:103
WebSocket connection failed:  ws://localhost:8888/api/kernels/7e7b81aa-d0a0-4a5a-be2c-cba2c4e67856 true kernel.js:544
Connection lost, reconnecting in 8 seconds.

On the server side, I see this:

[I 11:02:20.033 NotebookApp] Creating new notebook in /notebooks
[I 11:02:21.686 NotebookApp] Kernel started: 7b8c19b0-835f-4448-bdc1-700ec02eb4ff
[I 11:02:29.361 NotebookApp] Saving file at /notebooks/Untitled.ipynb

When I try to refresh the browser, I see no activity on the jupyter server. However, if I clear the cache in Firefox or if I open the same url in Safari or Chrome, it works. However, after a while (in Firefox at least) the same error comes up again, necessitating another cache refresh. I haven’t used Safari or Chrome for very long so I don’t know if the error pops up there as well for me.

What’s also interesting is this is reproducible on multiple machines in the building running Arch, but my colleague who uses Safari has not seen the error. Any idea where to look? I would usually expect a websocket issue to be a problem with the network, but the fact that a cache refresh fixes the problem sounds like something “bad” is getting cached.

Update 8/23: Today this happened again and I had to both refresh the cache on Firefox and restart the jupyter server. All the while jupyter is working fine through safari.

@meeotch
Copy link

meeotch commented Feb 2, 2019

Did you ever get this figured out? I'm having the same problem with Firefox. Running jupyter server on my workstation on Windows 10, connecting from laptop on local net. I'll be cruising along all day with no problems, and all of a sudden, my jupyter windows in Firefox will get flaky/slow, and then start refusing to connect at all. Chrome works fine on those same documents. Clearing the Firefox cache doesn't fix it. Restarting the kernel doesn't fix it. Restarting jupyter server doesn't fix it. Disabling all firewalls on all machines doesn't fix it. Disabling all Firefox add-ons doesn't fix it.

@Nazira73
Copy link

did this got fixed. i am struggling from months on this

@satyajitghana
Copy link

I'm on Arch and still facing this issue, i had never faced this issue while on Windows. resetting cache doesn't fix the problem either, although opening incognito fixes, could it be because of a specific plugin ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants