Unable to connect to Jupyter notebook server (Error 404) from Pyenv virtual environment
0
votes
0
answers
1804
views
_OS: 5.14.14-arch1-1 GNU/Linux x86_64_
_Pkgs:
> A connection to the notebook server could not be established. The > notebook will continue trying to reconnect. Check your network > connection or notebook server configuration. I document the trace when trying to launch : [I 14:54:07.039 NotebookApp] Loading IPython parallel extension [I 14:54:07.040 NotebookApp] Serving notebooks from local directory: /path/to/my_directory [I 14:54:07.040 NotebookApp] Jupyter Notebook 6.3.0 is running at: [I 14:54:07.041 NotebookApp] http://localhost:8888/ [I 14:54:07.041 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). ERROR:asyncio:Exception in callback () handle: ()> Traceback (most recent call last): File "/home/USER/.pyenv/versions/3.7.0/lib/python3.7/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) RuntimeError: Cannot enter into task wait_for= cb=[IOLoop.add_future..() at /home/USER/.pyenv/versions/3.7.0/lib/python3.7/site-packages/tornad/ioloop.py:688]> while another task cb=[IOLoop.add_future..() at /home/USER/.pyenv/versions/3.7.0/lib/python3.7/site-packages/tornado/ioloop.py:688]> is being executed. [I 14:54:09.773 NotebookApp] Kernel started: ad69df20-22a6-40b2-9778-5e1aa8781898, name: [I 14:54:12.770 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports [I 14:54:15.783 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports [I 14:54:18.785 NotebookApp] 302 GET /notebooks/01_cpu-only_inference.ipynb (127.0.0.1) 2.010000ms [I 14:54:18.795 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports [I 14:54:21.803 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports [W 14:54:24.814 NotebookApp] KernelRestarter: restart failed [W 14:54:24.815 NotebookApp] Kernel ad69df20-22a6-40b2-9778-5e1aa8781898 died, removing from map. [W 14:54:30.901 NotebookApp] Replacing stale connection: ad69df20-22a6-40b2-9778-5e1aa8781898:2eb96ae1751841d7801d200795a4bb30 [W 14:55:09.826 NotebookApp] Timeout waiting for kernel_info reply from ad69df20-22a6-40b2-9778-5e1aa8781898 [E 14:55:09.829 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: ad69df20-22a6-40b2-9778-5e1aa8781898) [W 14:55:09.832 NotebookApp] 404 GET /api/kernels/ad69df20-22a6-40b2-9778-5e1aa8781898/channels?session_id=2eb96ae1751841d7801d200795a4bb30 (127.0.0.1): Kernel does not exist: ad69df20-22a6-40b2-9778-5e1aa8781898 [W 14:55:09.848 NotebookApp] 404 GET /api/kernels/ad69df20-22a6-40b2-9778-5e1aa8781898/channels?session_id=2eb96ae1751841d7801d200795a4bb30 (127.0.0.1) 38952.030000ms referer=None ***EDIT 1***
- rolled back
_Pkgs:
jupyter
4.6.3, jupyter-notebook
6.4.4, pyenv
2.2.0 ]_
------------------------------------------
My setup consists in launching jupyter from a pyenv
virtual environment in directory /path/to/my_directory
with all necessary packages and python modules pre-installed and building a custom iPython kernel for that specific environment. Making the custom iPython kernel available in the notebook session involves:
$ cd /path/to/my_directory
$ pyenv local 3.7.0
$ python -m pip install -r
$ ipython kernel install --user --name --display-name "Python3.7.0 ()"
$ jupyter notebook
... followed by choosing "File > New Notebook" in Jupyter console menu, and picking "my_kernel" in the new notebook browser window. This method has worked flawlessly until today.
Yesterday everything worked, launching the custom kernel included. Today is a different day. Changes were basically a few package upgrades, among them a number of minor updates concerning builds:
[2021-10-27T08:42:39+0200] [ALPM] upgraded npm (8.1.0-1 -> 8.1.1-1)
[2021-10-27T21:42:20+0200] [ALPM] upgraded c-ares (1.18.0-1 -> 1.18.1-1)
[2021-10-27T21:42:20+0200] [ALPM] upgraded cmake (3.21.3-1 -> 3.21.4-1)
[2021-10-27T21:42:20+0200] [ALPM] upgraded jupyter-nbconvert (6.1.0-1 -> 6.1.0-2)
[2021-10-27T21:42:20+0200] [ALPM] upgraded jupyter (4.6.3-2 -> 4.6.3-3)
[2021-10-27T21:42:20+0200] [ALPM] upgraded ldb (2:2.4.0-1 -> 2:2.4.1-1)
[2021-10-27T21:42:20+0200] [ALPM] upgraded librsvg (2:2.52.0-1 -> 2:2.52.3-1)
[2021-10-27T21:42:20+0200] [ALPM] upgraded mercurial (5.9.2-1 -> 5.9.3-1)
[2021-10-27T21:42:21+0200] [ALPM] upgraded portmidi (217-9 -> 236-1)
[2021-10-27T21:42:21+0200] [ALPM] upgraded pyenv (2.1.0-1 -> 2.2.0-1)
[2021-10-27T21:42:21+0200] [ALPM] upgraded python-pygame (2.0.1-2 -> 2.0.1-3)
[2021-10-27T21:42:21+0200] [ALPM] upgraded python-sqlalchemy (1.3.23-1 -> 1.4.25-1)
[2021-10-27T21:42:21+0200] [ALPM] upgraded smbclient (4.15.0-1 -> 4.15.1-1)
[2021-10-27T21:42:21+0200] [ALPM] upgraded samba (4.15.0-1 -> 4.15.1-1)
[2021-10-28T08:18:33+0200] [ALPM] upgraded systemd-libs (249.5-2 -> 249.5-3)
[2021-10-28T08:18:33+0200] [ALPM] upgraded device-mapper (2.03.13-1 -> 2.03.14-1)
[2021-10-28T08:18:33+0200] [ALPM] upgraded cryptsetup (2.4.1-1 -> 2.4.1-3)
[2021-10-28T08:18:33+0200] [ALPM] upgraded lvm2 (2.03.13-1 -> 2.03.14-1)
[2021-10-28T08:18:33+0200] [ALPM] upgraded openexr (3.1.2-1 -> 3.1.3-1)
[2021-10-28T08:18:33+0200] [ALPM] upgraded python-joblib (1.0.1-1 -> 1.1.0-1)
[2021-10-28T08:18:33+0200] [ALPM] upgraded python-ptyprocess (0.7.0-1 -> 0.7.0-2)
[2021-10-28T08:18:33+0200] [ALPM] upgraded python-pexpect (4.8.0-3 -> 4.8.0-4)
[2021-10-28T08:18:33+0200] [ALPM] upgraded systemd (249.5-2 -> 249.5-3)
[2021-10-28T08:18:34+0200] [ALPM] upgraded systemd-sysvcompat (249.5-2 -> 249.5-3)
The error I get when trying to launch is:
> Connection failed> A connection to the notebook server could not be established. The > notebook will continue trying to reconnect. Check your network > connection or notebook server configuration. I document the trace when trying to launch : [I 14:54:07.039 NotebookApp] Loading IPython parallel extension [I 14:54:07.040 NotebookApp] Serving notebooks from local directory: /path/to/my_directory [I 14:54:07.040 NotebookApp] Jupyter Notebook 6.3.0 is running at: [I 14:54:07.041 NotebookApp] http://localhost:8888/ [I 14:54:07.041 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). ERROR:asyncio:Exception in callback () handle: ()> Traceback (most recent call last): File "/home/USER/.pyenv/versions/3.7.0/lib/python3.7/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) RuntimeError: Cannot enter into task wait_for= cb=[IOLoop.add_future..() at /home/USER/.pyenv/versions/3.7.0/lib/python3.7/site-packages/tornad/ioloop.py:688]> while another task cb=[IOLoop.add_future..() at /home/USER/.pyenv/versions/3.7.0/lib/python3.7/site-packages/tornado/ioloop.py:688]> is being executed. [I 14:54:09.773 NotebookApp] Kernel started: ad69df20-22a6-40b2-9778-5e1aa8781898, name: [I 14:54:12.770 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports [I 14:54:15.783 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports [I 14:54:18.785 NotebookApp] 302 GET /notebooks/01_cpu-only_inference.ipynb (127.0.0.1) 2.010000ms [I 14:54:18.795 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports [I 14:54:21.803 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports [W 14:54:24.814 NotebookApp] KernelRestarter: restart failed [W 14:54:24.815 NotebookApp] Kernel ad69df20-22a6-40b2-9778-5e1aa8781898 died, removing from map. [W 14:54:30.901 NotebookApp] Replacing stale connection: ad69df20-22a6-40b2-9778-5e1aa8781898:2eb96ae1751841d7801d200795a4bb30 [W 14:55:09.826 NotebookApp] Timeout waiting for kernel_info reply from ad69df20-22a6-40b2-9778-5e1aa8781898 [E 14:55:09.829 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: ad69df20-22a6-40b2-9778-5e1aa8781898) [W 14:55:09.832 NotebookApp] 404 GET /api/kernels/ad69df20-22a6-40b2-9778-5e1aa8781898/channels?session_id=2eb96ae1751841d7801d200795a4bb30 (127.0.0.1): Kernel does not exist: ad69df20-22a6-40b2-9778-5e1aa8781898 [W 14:55:09.848 NotebookApp] 404 GET /api/kernels/ad69df20-22a6-40b2-9778-5e1aa8781898/channels?session_id=2eb96ae1751841d7801d200795a4bb30 (127.0.0.1) 38952.030000ms referer=None ***EDIT 1***
- rolled back
pyenv
, jupyter
and jupyter-nbconvert
, one by one and in that order. For example:$ sudo pacman -U jupyter-nbconvert-6.1.0-1-any.pkg.tar.zst
- rebooted each time -> no change
- reinstalled Python virtual environment binaries for 3.7.0$ pyenv uninstall 3.7.0
$ pyenv install 3.7.0
- reinstalled Python 3.7.0 shims$ pyenv rehash
- set out to reinstall my 3GB of required packages in 3.7.0 virt- env, starting with ipykernel
. Result is Segmentation fault (core dumped)
.
$ cd /path/to/my_directory
$ pyenv local 3.7.0
$ python -m pip install ipykernel
Segmentation fault (core dumped)
$ python -m pip install -U pip
Segmentation fault (core dumped)
$ ... etc...
Still troubleshooting this. Any suggestion welcome.
Asked by Cbhihe
(2880 rep)
Oct 28, 2021, 01:44 PM
Last activity: Dec 14, 2021, 08:08 PM
Last activity: Dec 14, 2021, 08:08 PM