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

SoS notebook kernel restart fails because socket address already in use in Jupyter-Notebook #8

Open
DavidHuebner opened this issue Jun 10, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@DavidHuebner
Copy link
Collaborator

DavidHuebner commented Jun 10, 2021

Describe the bug
In jupyter-notebook, a kernel restart of a Notebook that uses the sos-kernel (i.e. those notebooks that contain Python AND Ruta code), fails with the following error.

[I 15:34:13.004 NotebookApp] Restoring connection for b0ce13e9-f374-4227-8fb7-9d147ea3f178:696ef6b3b33746d89f672c689160fccc
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.8/site-packages/sos_notebook/kernel.py", line 1956, in <module>
    IPKernelApp.launch_instance(kernel_class=SoS_Kernel)
  File "/usr/local/lib/python3.8/site-packages/traitlets/config/application.py", line 844, in launch_instance
    app.initialize(argv)
  File "/usr/local/lib/python3.8/site-packages/traitlets/config/application.py", line 87, in inner
    return method(app, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/ipykernel/kernelapp.py", line 567, in initialize
    self.init_sockets()
  File "/usr/local/lib/python3.8/site-packages/ipykernel/kernelapp.py", line 271, in init_sockets
    self.shell_port = self._bind_socket(self.shell_socket, self.shell_port)
  File "/usr/local/lib/python3.8/site-packages/ipykernel/kernelapp.py", line 218, in _bind_socket
    return self._try_bind_socket(s, port)
  File "/usr/local/lib/python3.8/site-packages/ipykernel/kernelapp.py", line 194, in _try_bind_socket
    s.bind("tcp://%s:%i" % (self.ip, port))
  File "/usr/local/lib/python3.8/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 already in use

Afterwards, if the dead kernel is restarted, it works.

To Reproduce
Steps to reproduce:

  1. Copy https://github.com/averbis/IRuta
  2. Build the docker image: docker build -t iruta
  3. Run the docker image: docker run -p 8888:8888 iruta
  4. Open the notebook Notebook [IRuta, IPython] - How to combine Ruta and Python
  5. Restart the notebook.

Steps to solve the problem
It seems that there is a bug in sos-notebook. I made a ticket there: vatlab/sos-notebook#317

Alternatively, it seems that this error does not exist in JupyterLab.

Versions

  • IRuta: version 0.2.0
  • sos-notebook: 0.22.5
@DavidHuebner DavidHuebner added the bug Something isn't working label Jun 10, 2021
@DavidHuebner DavidHuebner changed the title SoS notebook kernel restart fails because socket address already in use SoS notebook kernel restart fails because socket address already in use in Jupyter-Notebook Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant