ipython notebook kernel dies ("WebSocket ping timeout") when the SSH connection becomes idle
Asked Answered
L

1

15

I was trying to use tmux to start a remote ipython notebook on my Debian server. I then start browser on the Mac OS X local machine. After starting a long-run task, I detach the tmux session and exit the SSH connection.

However, after a while I came back and SSH back to the server, I found the following message in tmux session:

[W 19:15:52.617 NotebookApp] Notebook simplified_algo.ipynb is not trusted      # The first time I left 
[W 19:27:55.249 NotebookApp] WebSocket ping timeout after 119865 ms.  
[I 22:09:13.696 NotebookApp] Saving file at /simplified_algo.ipynb              # I then came back 
[W 22:09:13.698 NotebookApp] Saving untrusted notebook simplified_algo.ipynb
[W 22:15:18.390 NotebookApp] Notebook simplified_algo.ipynb is not trusted
[I 22:17:21.426 NotebookApp] Saving file at /simplified_algo.ipynb
[W 22:17:21.428 NotebookApp] Saving untrusted notebook simplified_algo.ipynb
[I 22:19:20.954 NotebookApp] Saving file at /simplified_algo.ipynb
[I 22:21:20.974 NotebookApp] Saving file at /simplified_algo.ipynb              # The second time I left
[W 22:38:33.102 NotebookApp] WebSocket ping timeout after 119992 ms.
[I 23:01:07.494 NotebookApp] Kernel shutdown: 75b0cf60-610e-4931-99cb-847d821a726b

It seems that the kernel dies when the SSH connection is halted and becomes idle. How can it be fixed? Any comment would be appreciated.

Latea answered 16/7, 2015 at 2:12 Comment(2)
Same question here! I used screen and I had exactly same problem. Anyone has a solution? Thanks!Workable
How are you connecting to the Notebook instance running on your server? It's possible it is connecting via an SSH tunnel, in which case the SSH connection obviously needs to stay up.Accounting
R
1

I've got this error of Websocket timeout (Websocket ping timeout after ... ms) using Keras library with IPython / Jupyter Notebook which is caused by a bug when dealing with progress bar. So you can, one of these solutions:

  1. Simply put verbose=0 in all model.fit(...) instructions

  2. Install keras-tqdm to manage progress bar

  3. Redirect the output to a file

Risk answered 21/11, 2018 at 4:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.