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

Uncaught exception in ZMQStream callback - ValueError: signal only works in main thread #11258

Closed
louwers opened this issue Aug 7, 2018 · 6 comments
Milestone

Comments

@louwers
Copy link

louwers commented Aug 7, 2018

ERROR:tornado.general:Uncaught exception in ZMQStream callback
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
    return self.dispatch_shell(stream, msg)
  File "/usr/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell
    self.pre_handler_hook()
  File "/usr/lib/python3.7/site-packages/ipykernel/kernelbase.py", line 248, in pre_handler_hook
    self.saved_sigint_handler = signal(SIGINT, default_int_handler)
  File "/usr/lib/python3.7/signal.py", line 47, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread

After installing the newest versions of all Jupyter's dependencies, the notebook server crashes with multiple times this message whenever I try to run anything. Running 5.3.0 so it might be fixed as of now.

Edit: #11026 looks somewhat similar.

@louwers louwers changed the title Uncaught exception in ZMQStream callback Uncaught exception in ZMQStream callback - ValueError: signal only works in main thread Aug 7, 2018
@Carreau
Copy link
Member

Carreau commented Aug 28, 2018

That is most likely relevant to https://github.com/ipython/ipykernel, let's see if we can migrate it there.

@ipython ipython deleted a comment from lumberbot-app bot Aug 28, 2018
@Carreau
Copy link
Member

Carreau commented Aug 28, 2018

@meeseeksdev migrate to ipython/ipykernel

@lumberbot-app
Copy link
Contributor

lumberbot-app bot commented Aug 28, 2018

Done as ipython/ipykernel#335.

@lumberbot-app lumberbot-app bot closed this as completed Aug 28, 2018
@femiaiyeku
Copy link

Upgrading ipykernel worked for me
conda upgrade ipykernel

@Carreau Carreau added this to the not ipython milestone Sep 27, 2018
@natevm
Copy link

natevm commented Sep 28, 2018

I am still having this issue with the latest version of IPython.

I mentioned it in the thread mentioned by @meeseeksdev[bot] , but just for visibility:

I'm running into the same error message when trying to run an ipython kernel in a separate thread from the main thread. Once I receive that error message, I am unable to use ipython from jupyter.

If I surround the code in the pre_handler_hook and post_handler_hook of kernelbase.py, as well as the self.init_signal() in kernelapp.py file with a try catch, I'm able to use IPython within jupyter again and everything seems to work, although exceptions are just being caught in that case. I'm using the latest version of ipykernel, which I just cloned from github.

@csr818
Copy link

csr818 commented May 10, 2023

Upgrading ipykernel worked for me conda upgrade ipykernel

actually work,thank you!

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

5 participants