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

Connecting to kernel + kernel died unexpectedly because of zeromq 4.0.6 #2485

Closed
narun4sk opened this issue Jun 13, 2015 · 17 comments
Closed

Comments

@narun4sk
Copy link

I was successfully running Spyder on Archlinux:

$ uname -mrs
Linux 4.0.5-1-ARCH x86_64
$ python2 --version
Python 2.7.10
$ ipython2 --version
3.1.0

But recently all of a sudden I'm getting following message:

It seems the kernel died unexpectedly. Use 'Restart kernel' to continue using this console.

I removed system package and installed from source, but that made things worse, I was stuck with:

Connecting to kernel...

Following fixed the problem:

spyder --reset
spyder --defaults

But now I'm stuck with the prior problem, after ~5-10 sec I again get:

It seems the kernel died unexpectedly. Use 'Restart kernel' to continue using this console.

Though running ipython2 qtconsole is perfectly fine and does not crash. Connecting to this kernel from Spyder renders prior error message.

Please advise how to debug/fix this issue.

BTW: currently installed _Spyder 3.0.0dev_

_EDIT1_
Every attempt to open ipython console in Spyder results in python2 burning 100% one of my CPU cores:

VIRT    RES  %CPU %MEM     TIME+ S COMMAND                                                                                                                                               
896.2m 104.8m 100.7  1.3  16:33.14 S python2

_EDIT2_

After ipython crash I see in the python console following trace:

Python 2.7.10 (default, May 26 2015, 04:16:29) 
[GCC 5.1.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/spyderlib/widgets/externalshell/inputhooks.py", line 107, in qt4
    app = QtCore.QCoreApplication.instance()
NameError: global name 'QtCore' is not defined
Got exception from inputhook, unregistering.
@ccordoba12
Copy link
Member

Are you trying to run Spyder using PyQt5?

@ccordoba12
Copy link
Member

My only advice (for now) is to switch back to our stable branch and see if things are working correctly there.

@narun4sk
Copy link
Author

Yes, I was trying to run it with PyQt5.

Anyways, I just removed dev version and reinstalled Archlinux package. Currently I have:

Spyder 2.3.4
Python 2.7.10 64bits, Qt 4.8.7, PyQt4 (API v2) 4.11.4 on Linux.

Problem persists, ipython kernel dies unexpectedly after ~5 sec.. And I have python2 burning at 100%.

Please advice how to debug.

@ccordoba12
Copy link
Member

Maybe it's a problem with a very recent version of pyzmq or zeromq, given that you seem to be living in the bleeding edge.

Please install a previous version, like zeromq 4.0.4 or less than that. There were some reports about problems with 4.0.6 that could be affecting Spyder. And 4.0.6 seems to be the current zeromq Arch version, at least according to this page:

https://www.archlinux.org/packages/community/x86_64/zeromq/

@narun4sk
Copy link
Author

# pacman -Qi python2-pyzmq | sed 's/^/    /'
Name           : python2-pyzmq
Version        : 14.6.0-1
Description    : Python2 bindings for zeromq, written in Cython
Architecture   : x86_64
URL            : http://www.zeromq.org/bindings:python
Licences       : LGPL
Groups         : None
Provides       : None
Depends On     : zeromq  python2
Optional Deps  : None
Required By    : ipython2-notebook  spyder
Optional For   : ipython2
Conflicts With : None
Replaces       : None
Installed Size : 1264.00 KiB
Packager       : Kyle Keen <keenerd@gmail.com>
Build Date     : Sun 31 May 2015 10:23:58 BST
Install Date   : Fri 12 Jun 2015 23:10:30 BST
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By   : Signature

I'll try to downgrade and then see how it goes :/

BTW:

git checkout remotes/origin/2.3
python2 bootstrap.py

I understand this is your stable? With it I get exactly the same error like with system package.

@ccordoba12
Copy link
Member

Yeah, sorry about the confusion. pyzmq and zeromq are two different packages. The one you need to downgrade is zeromq, not pyzmq (I say it because you're showing me your pyzmq info).

And yes, by checking our 2.3 git branch, you're using our stable version. But as I said, I doubt this is a Spyder problem, but a problem with zeromq.

@narun4sk
Copy link
Author

Indeed, downgrading zeromq to version _4.0.5-1_ has solved my problem.

Thank you for your time :)

For the completeness:

# pacman -Qi zeromq | sed 's/^/    /'
Name           : zeromq
Version        : 4.0.5-1
Description    : Fast messaging system built on sockets. C and C++ bindings. aka 0MQ, ZMQ.
Architecture   : x86_64
URL            : http://www.zeromq.org
Licences       : LGPL
Groups         : None
Provides       : None
Depends On     : gcc-libs  util-linux  libsodium
Optional Deps  : None
Required By    : python-pyzmq  python2-pyzmq
Optional For   : None
Conflicts With : None
Replaces       : None
Installed Size :   2.44 MiB
Packager       : Kyle Keen <keenerd@gmail.com>
Build Date     : Wed 15 Oct 2014 01:48:54 BST
Install Date   : Sat 13 Jun 2015 16:38:50 BST
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By   : None

@ccordoba12
Copy link
Member

Ok, really good to know! Please leave this issue open in case someone else reports this problem.

@ccordoba12 ccordoba12 changed the title Connecting to kernel + kernel died unexpectedly Connecting to kernel + kernel died unexpectedly because of zeromq 4.0.6 Jun 13, 2015
@clouds56
Copy link

confirm, and some additional information: (spyder 2.3.4 python 2.7.10, Qt 4.8.6, PyQt4 4.11.3)
and IPython 3.1.0, zeromq 4.0.6-1(arch linux x86_64)
it prints the message repeatly

It seems the kernel died unexpectedly. Use 'Restart kernel' to continue using this console.

every 1-2s.
but it seems having no affect to run command in ipython console (I mean, everything but the annoying message), the ipython REPL in spyder can run functionally (by using shift+enter in editor and then run in REPL).
just keep showing the message and eat up my CPU.

using ipython (python version 2.7.10) without spyder and using spyder with python version 3.4.3 both just act normally.

and thanks for the workaround.

@minrk
Copy link
Contributor

minrk commented Jun 13, 2015

This is a bug in zeromq-4.0.6 and 4.1.1. It's been fixed in the maintenance branches of zeromq, which will have releases with the fix as 4.0.7 and 4.1.2, respectively. Prompted by this, the recommended implementation of heartbeat on the kernel is changed, and some kernels have been updated to use an implementation not vulnerable to the bug (IPython, IJulia, IPerl, at least).

I don't think there's anything for Spyder to do on this one, other than suggest users wait for the next patch release before upgrading libzmq.

More info here.

@ccordoba12
Copy link
Member

Thanks @minrk. I read your post on the IPython mailing list, and that's why I knew about this problem with zeromq.

@BeAntares
Copy link

I have the same problem, I use Linux Manjaro, and upgraded zeromq to version 4.0.6-1. I don't know how to downgrade to version 4.0.5-1. Can anyone help me?

Thanks in advance.

@minrk
Copy link
Contributor

minrk commented Jun 18, 2015

zeromq-4.0.7 is out and fixes this problem. Hopefully it will come through soon.

@narun4sk
Copy link
Author

In Archlinux we already have zeromq 4.1.2-1 which puts things back to normal. Manjaro apparently is based on Archlinux? If so, you should upgrade your system, chances are you will get this package too.

@BeAntares
Copy link

Yes, Manjaro is based on Archlinux, although the new version of zeromq is not available yet. I guess I'll have to wait. Thanks for answering.

@ccordoba12
Copy link
Member

This is issue was already fixed upstream, so I'm closing it.

@salma26
Copy link

salma26 commented Jul 23, 2018

Hello, I'm running a deep learning code on Spyder.
My code contains two parts : training and test.
It's supposed to do the training on 50 epochs, after that, it automatically move to apply the network on 300 images (test).
However, as soon as it finishes the training, it never passes to the test, and always returns : kernel died, restarting
How can I solve this problem?

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

No branches or pull requests

6 participants