-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ZMQError: Address already in use when restarting the kernel #14739
Comments
Hi @HBolandi thanks for reporting this. I'll assign @CAM-Gerlach to take care of this one. |
Hello @HBolandi , sorry for the trouble. Its a little unclear to me if the restart was manually triggered by your action or simply happens on its own after your code is running for long enough, but the immediate cause of the error message appears to be that the previous kernel evidently hangs and doesn't free the ZMQ connection/port that Spyder uses to communicate it. This has been reported elsewhere with other Jupyter kernel clients, in various situations, but without a clear-cut solution. Assuming you aren't manually interrupting or trying to restart the kernel, it seems likely there was either a serious problem with your code, or it ran out of memory/other resources. To determine if the error is due to something Spyder can directly control, can you run the same code in QtConsole and see if it happens again? You can open it from Anaconda Navigator or by typing If it only happens in Spyder, can you share a minimal example of some code that will reproduce it, as well as any additional information on what you're trying to do and the circumstances in which it occurs? Thanks. As for the error on reconnecting, you can either try re-opening a new console, or use I'm not sure if there's anything we can do about it on our end, but if so its pretty deep in the interaction between spyder_kernels, Hopefully this is helpful—let us know, thanks. |
Thanks for your response. The restart happened on its own after my code is running for long enough. As you mentioned it could be running out of memory/other resources since the code is working fine with less data. I will try to implement DDP in my code and will return back to you. |
Thanks for letting us know; we really appreciate it. Best of luck with that, and we look forward to hearing good news; if not, we can see if there's anything we can do on our end. Cheers. |
Hi, I'm having the same problem, without running any code, but just by starting Spyder and restarting the kernel. Opening a new console, or closing the current one solves it, However, I'm not sure if it's a good idea to open tens of consoles. |
Hey @deMalmazet , sorry you're running into this issue. Could you verify you get the exact same full traceback as above, and confirm what version of Spyder you are using with Anaconda and standalone, your operating system version, the Python and Spyder-Kernels version in the working environment you have selected by default (i.e. the one that starts when you open Spyder, which it sounds like you're experiencing an issue in), and whether you can reproduce the issue both using the internal default env as your working environment, and other Anaconda environments? With regard to opening many consoles, you can open as many as you want in one session, though its probably good idea to keep it to between a half dozen to a dozen at any given time, given each runs in a seperate process that consumes a non-trivial amount of RAM. Also, with regard to the file being run when you mean to just run the sell or line, you've confirmed this still occurs when you use the menu item or the toolbar button, right? |
Hi @CAM-Gerlach , Thank you for your prompt answer. I originally posted my issue here, with my specs (#14994). I'll copy them here: Versions Mandatory:atomicwrites >=1.2.0 : 1.4.0 (OK) Optional:cython >=0.21 : 0.29.22 (OK) |
Here is the traceback : An error ocurred while starting the kernel Traceback (most recent call last):
File "C:\Users\Daniel\anaconda3\envs\TrackPlat\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Daniel\anaconda3\envs\TrackPlat\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\Daniel\anaconda3\envs\TrackPlat\lib\site‑packages\spyder_kernels\console_main.py", line 23, in
start.main()
File "C:\Users\Daniel\anaconda3\envs\TrackPlat\lib\site‑packages\spyder_kernels\console\start.py", line 284, in main
kernel.initialize()
File "C:\Users\Daniel\anaconda3\envs\TrackPlat\lib\site‑packages\traitlets\config\application.py", line 87, in inner
return method(app, *args, **kwargs)
File "C:\Users\Daniel\anaconda3\envs\TrackPlat\lib\site‑packages\ipykernel\kernelapp.py", line 567, in initialize
self.init_sockets()
File "C:\Users\Daniel\anaconda3\envs\TrackPlat\lib\site‑packages\ipykernel\kernelapp.py", line 271, in init_sockets
self.shell_port = self._bind_socket(self.shell_socket, self.shell_port)
File "C:\Users\Daniel\anaconda3\envs\TrackPlat\lib\site‑packages\ipykernel\kernelapp.py", line 218, in _bind_socket
return self._try_bind_socket(s, port)
File "C:\Users\Daniel\anaconda3\envs\TrackPlat\lib\site‑packages\ipykernel\kernelapp.py", line 194, in _try_bind_socket
s.bind("tcp://%s:%i" % (self.ip, port))
File "C:\Users\Daniel\anaconda3\envs\TrackPlat\lib\site‑packages\zmq\sugar\socket.py", line 172, in bind
super().bind(addr)
File "zmq/backend/cython/socket.pyx", line 540, in zmq.backend.cython.socket.Socket.bind
File "zmq/backend/cython/checkrc.pxd", line 28, in zmq.backend.cython.checkrc._check_rc
zmq.error.ZMQError: Address in use |
I am using the same default environment with the standalone version and with the Conda version, and also the same system. Also, I just tried with the standalone version 4.2.5, and the problem remains. |
With regard to the file being run when I mean to just run the sell or line, this seems to be working well now. |
@minrk, sorry to ping you out of the blue, but do you know why this happens in some cases? It's only an issue when restarting kernels. |
Hi, I am having the same issue with Spyder 5.0.0. This occurs whenever I manually restart the kernel, even immediately after opening Spyder (I mean before running any code). The kernel restarts if I manually close the console, but the problem persists in the new console. I installed Spyder through conda, not standalone.
Claudio |
|
According to the Jupyter team (we use the same architecture as them to run code), this is caused by slow to start kernels. It should be fixed in our latest version (5.2.1), when |
We'll fix this by requiring that version of |
I have installed Anaconda (python 3.7) in my ubuntu 20.04 system and I am using Spyder. I am running CNN and while runs for some part of data it's fine but when I run it for entire data (more that 100000) I am getting the following error:
an error occurred while starting the kernel
Steps that reproduce the problem:
Versions:
Dependencies:
The text was updated successfully, but these errors were encountered: