Both the issues posted on Github seems to be stemming from a different issue and didn’t work for me (I’ve tried the solutions given,) however, I have also posted this issue on Github’s Jupyter section, let me see if someone gets back.
In the meantime, I deleted my instance on EC2 and tried everything all over again
(based on the video Jeremy posted). Quite ‘surprisingly’, it did not work too.
Have you tried temporarily shutting down all virus checkers and firewall software, including whatever is built into your OS? Is this on a laptop? Have you tried going to an internet cafe and connecting to the wifi there? Seems like something on your computer or network is blocking web sockets.
The alternative would be to run ipython (not the notebook) in the terminal. You can then view the notebooks directly on github, and copy and paste commands into your terminal. It’s not ideal, but it would do the job. Here’s how to use the terminal version: http://www.pythonforbeginners.com/basics/ipython-a-short-introduction
Not sure if this error I am getting related or not but at the line of downloading models from vgg I am getting following error on conda prompt.
HTTPServerRequest(protocol=‘http’, host=‘localhost:8888’, method=‘GET’, uri=’/api/kernels/3a89cdae-dd90-488a-bfaa-d1a0d906b6f9/channels?session_id=268F6A8A991C48608D354B4ACBE95C00’, version=‘HTTP/1.1’, remote_ip=’::1’, headers={‘Origin’: ‘http://localhost:8888’, ‘Upgrade’: ‘websocket’, ‘Accept-Language’: ‘en-US,en;q=0.8’, ‘Accept-Encoding’: ‘gzip, deflate, sdch, br’, ‘Sec-Websocket-Version’: ‘13’, ‘Host’: ‘localhost:8888’, ‘Sec-Websocket-Key’: ‘x6UrpBLdjaVzaenzu36qSw==’, ‘User-Agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36’, ‘Connection’: ‘Upgrade’, ‘Cookie’: ‘username-localhost-8888=“2|1:0|10:1481996091|23:username-localhost-8888|44:YzUwNThlZGY5Y2ZmNDE1OWI3NjY1MjMxOGQyMWM0NTU=|a9f613e893bbb4ddc9aec4ffd886ca065e72700609c25edbfbd4e63fdf409a76”; username-localhost-8889=“2|1:0|10:1482105448|23:username-localhost-8889|44:MDVlNzRkZWUyMDA1NGU3MmFhY2JhOTgyYjI5ZTY2NWI=|4af4db6a6123a40ac4ac58bab78621ec375db0e71d1badd27661202cc1dff8ce”’, ‘Pragma’: ‘no-cache’, ‘Cache-Control’: ‘no-cache’, ‘Sec-Websocket-Extensions’: ‘permessage-deflate; client_max_window_bits’})
Traceback (most recent call last):
File “/Users/trinakarmakar/anaconda2/lib/python2.7/site-packages/tornado/web.py”, line 1425, in _stack_context_handle_exception
raise_exc_info((type, value, traceback))
File “/Users/trinakarmakar/anaconda2/lib/python2.7/site-packages/tornado/stack_context.py”, line 314, in wrapped
ret = fn(*args, **kwargs)
File “/Users/trinakarmakar/anaconda2/lib/python2.7/site-packages/zmq/eventloop/zmqstream.py”, line 191, in
self.on_recv(lambda msg: callback(self, msg), copy=copy)
File “/Users/trinakarmakar/anaconda2/lib/python2.7/site-packages/notebook/services/kernels/handlers.py”, line 373, in _on_zmq_reply
super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
File “/Users/trinakarmakar/anaconda2/lib/python2.7/site-packages/notebook/base/zmqhandlers.py”, line 258, in _on_zmq_reply
self.write_message(msg, binary=isinstance(msg, bytes))
File “/Users/trinakarmakar/anaconda2/lib/python2.7/site-packages/tornado/websocket.py”, line 210, in write_message
raise WebSocketClosedError()
WebSocketClosedError
At the moment, I’m experimenting this within my home connection and yes, I tried running the
Notebook with Anti-virus disabled - with the same kernel busy status.
However, I’m at a loss with this logic - When I attempt to run Jupyter through Anaconda prompt, it works
without any problems. But, trying to run it with Cygwin results in a Kernel busy status. How could this be the case ?
Isn’t the web-socket supposed to be blocked even with Anaconda Prompt ? Why am I able to run the codes ?
Should I install or enable something extra on Cygwin64 ?
I have faced similar issue, Kernel Busy/dying, before BUT it was for a different notebook and I was running the notebook locally from my Ubuntu workstation.
It was an extension problem for me and I had to install nbserver_extensions config key to resolve it.
Please check your browser logs —
Ok, so after 2 weeks of battle, I’ve been able to resolve the Kernel busy problem
that some of you may have experienced.
I want to first thank @jeremy and @lexsys for helping me out here.
This solution is recommended if anyone is experiencing the Kernel busy issue on their Jupyter Notebook
or if your connection goes from Kernel busy to a complete disconnect, or if it recurs again and again.
As shown on Jeremy’s very first Youtube video (AWS Deep Learning Setup), where an AWS instance environment is setup, you would have noticed that there were 3 important steps taken each time you want to connect your machine to an AWS instance.
USUAL STEPS as documented by Jeremy (this is great if all goes well)
Using Cygwin, entering the long SSH command that was generated while configuring AWS; which looks
like this -
However, there’a small modification required if you’re a little unlucky with a Kernel Dying syndrome (that I had)…
Keeping long story short, the Websocket ping timeout (as seen on the console output above) was
the problem and one method to take is to bypass the proxy with an SSH tunnel.
NEW STEPS
Using Cygwin Terminal, enter the command shown below (without the quotes and please modify
the “aws-key.pem” path in accordance to your own AWS hostname address that was generated while
creating the AWS instance)
What this command does is; it forwards 127.0.0.1:9999 from the machine to 127.0.0.1:8888 on
AWS Instance-hostname. Important thing to note is the arrangement of the command syntax (such as " -i ").
Please follow this format exactly as switching it fails the command.
Once Cygwin accesses the AWS instance, launch the address http://localhost:9999
(or 127.0.0.1 instead of localhost) from your favorite web browser.
@dinesh Thanks a million for this - you’re a lifesaver! My Jupyter Notebook kernels kept being disconnected forcing me to restart the whole fit() process. Your solution sorted it out.
From my own experience using a different port number would not be an issue. I checked that the port-32243
isn’t assigned to anything by IANA - Should be good.
I had a similar problem, and the SSH tunnel did not fix it for me. Reporting this in case it can be of help to others. In my case, I’ve built the environment starting from a standard Ubuntu 16.04 AMI on t2.micro, and I’ve tried both with and without Anaconda (much easier WITH). The end result is the same, kernels unreachable, cells stuck with “*”, websockets not going anywhere, “About” menu saying “Current Kernel Information: Waiting for kernel to be available…”.
For me the answer was simply, use https. I’ve not read anywhere that http can’t be used, but it just didn’t work for me (Jupyter notebook 5.0.0, Python 2.7.13, Anaconda 4.4.0, IPython 5.3.0, and Chrome 59.0.3071.115 on Windows 10 on the client side). I thought I was going to save time by avoiding creating a self-signed cert, and boy I was wrong…
So if you’re like me, don’t even bother trying http and use https instead (the difference is a cert and two lines of jupyter notebook config). The SSH tunnel is useful in its own right anyway (you don’t have to open extra ports on the security groups, and the out-of-box config of jupyter notebook works with localhost).
UPDATE: http://wiki.fast.ai/index.php/Jupyter_notebook describes a different solution (change port to 8889), but that didn’t work either for my environment (with a switch back to http). Only https works for me, with the default port 8888 too.