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

Tornado error: uncaght exception, kernel does not exist, stream is closed #5947

Closed
jwhendy opened this issue Jan 15, 2021 · 4 comments
Closed

Comments

@jwhendy
Copy link

jwhendy commented Jan 15, 2021

Potentially related: #2651 (old/seems fixed?), #2448 (related to jupyterhub which I'm not using), #2834 (seems resolved), #401 (suggests downgrading tornado or upgrading jupyter), #4549 (references #2670 which seems to indicate this was fixed).

I was just using jupyter lab yesterday for the first time in a while and had some packages to update due to my arch linux system having recently gone from python 3.8 to 3.9. I state this as it was functioning fine, however after closing my session and trying to open a new one, I'm now getting this error:

$ jupyter lab
[I 2021-01-15 12:09:21.142 ServerApp] jupyterlab | extension was successfully linked.
[I 2021-01-15 12:09:21.166 LabApp] JupyterLab extension loaded from /home/jwhendy/.local/lib/python3.9/site-packages/jupyterlab
[I 2021-01-15 12:09:21.166 LabApp] JupyterLab application directory is /home/jwhendy/.local/share/jupyter/lab
[I 2021-01-15 12:09:21.169 ServerApp] jupyterlab | extension was successfully loaded.
[I 2021-01-15 12:09:21.172 ServerApp] Serving notebooks from local directory: /mnt/vault/projects/robots/paint-lines
[I 2021-01-15 12:09:21.173 ServerApp] Jupyter Server 1.2.1 is running at:
[I 2021-01-15 12:09:21.173 ServerApp] http://localhost:8888/lab?token=58a1e220042991e8e56d40958b5b2aae9c0c7d6125f14ffe
[I 2021-01-15 12:09:21.173 ServerApp]  or http://127.0.0.1:8888/lab?token=58a1e220042991e8e56d40958b5b2aae9c0c7d6125f14ffe
[I 2021-01-15 12:09:21.173 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2021-01-15 12:09:21.445 ServerApp] 
    
    To access the server, open this file in a browser:
        file:///home/jwhendy/.local/share/jupyter/runtime/jpserver-2105-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/lab?token=58a1e220042991e8e56d40958b5b2aae9c0c7d6125f14ffe
     or http://127.0.0.1:8888/lab?token=58a1e220042991e8e56d40958b5b2aae9c0c7d6125f14ffe
[E 2021-01-15 12:09:23.486 ServerApp] Uncaught exception GET /lab/api/settings?1610734163295 (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/lab/api/settings?1610734163295', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/home/jwhendy/.local/lib/python3.9/site-packages/tornado/web.py", line 1704, in _execute
        result = await result
    tornado.iostream.StreamClosedError: Stream is closed
[W 2021-01-15 12:09:24.838 ServerApp] 404 GET /api/kernels/5e49fe42-ee0d-48c7-82e3-547ed91f14cd/channels?session_id=8d2894df-6a26-4d66-b200-6573d1311ae1 (127.0.0.1): Kernel does not exist: 5e49fe42-ee0d-48c7-82e3-547ed91f14cd
[W 2021-01-15 12:09:24.865 ServerApp] 404 GET /api/kernels/5e49fe42-ee0d-48c7-82e3-547ed91f14cd/channels?session_id=8d2894df-6a26-4d66-b200-6573d1311ae1 (127.0.0.1) 30.92ms referer=None
[I 2021-01-15 12:09:26.257 LabApp] Build is up to date
[W 2021-01-15 12:09:30.620 ServerApp] 404 GET /api/kernels/5e49fe42-ee0d-48c7-82e3-547ed91f14cd/channels?session_id=7cb96be5-d3ee-420a-9a50-8c3abb71adca (127.0.0.1): Kernel does not exist: 5e49fe42-ee0d-48c7-82e3-547ed91f14cd
[W 2021-01-15 12:09:30.622 ServerApp] 404 GET /api/kernels/5e49fe42-ee0d-48c7-82e3-547ed91f14cd/channels?session_id=7cb96be5-d3ee-420a-9a50-8c3abb71adca (127.0.0.1) 6.22ms referer=None
[I 2021-01-15 12:09:32.460 ServerApp] Kernel started: 04e05056-81a8-4835-a2f2-d5a8f0552b20
[W 2021-01-15 12:09:39.248 ServerApp] Replacing stale connection: 5e49fe42-ee0d-48c7-82e3-547ed91f14cd:8d2894df-6a26-4d66-b200-6573d1311ae1
[I 2021-01-15 12:09:51.344 ServerApp] Creating new notebook in 
[I 2021-01-15 12:09:51.650 ServerApp] Kernel started: f312ace4-188c-4bdd-94ad-8ba3fe3d0462
[W 2021-01-15 12:09:59.000 ServerApp] 404 GET /api/contents/Untitled4.ipynb?content=0&1610734198997 (127.0.0.1): No such file or directory: Untitled4.ipynb
[W 2021-01-15 12:09:59.000 ServerApp] No such file or directory: Untitled4.ipynb
[W 2021-01-15 12:09:59.000 ServerApp] 404 GET /api/contents/Untitled4.ipynb?content=0&1610734198997 (127.0.0.1) 1.11ms referer=http://localhost:8888/lab/tree/Untitled4.ipynb
[I 2021-01-15 12:09:59.005 ServerApp] Uploading file to /Untitled4.ipynb
g[W 2021-01-15 12:10:12.192 ServerApp] Replacing stale connection: 5e49fe42-ee0d-48c7-82e3-547ed91f14cd:7cb96be5-d3ee-420a-9a50-8c3abb71adca
[W 2021-01-15 12:10:15.203 ServerApp] Got events for closed stream None
[W 2021-01-15 12:10:32.611 ServerApp] Replacing stale connection: 5e49fe42-ee0d-48c7-82e3-547ed91f14cd:8d2894df-6a26-4d66-b200-6573d1311ae1
[W 2021-01-15 12:10:53.014 ServerApp] Replacing stale connection: 5e49fe42-ee0d-48c7-82e3-547ed91f14cd:7cb96be5-d3ee-420a-9a50-8c3abb71adca
[W 2021-01-15 12:11:22.858 ServerApp] Replacing stale connection: 5e49fe42-ee0d-48c7-82e3-547ed91f14cd:7cb96be5-d3ee-420a-9a50-8c3abb71adca
[I 2021-01-15 12:11:32.523 ServerApp] Saving file at /paint-lines.ipynb
[W 2021-01-15 12:11:43.726 ServerApp] Replacing stale connection: 5e49fe42-ee0d-48c7-82e3-547ed91f14cd:8d2894df-6a26-4d66-b200-6573d1311ae1
[I 2021-01-15 12:11:52.517 ServerApp] Saving file at /Untitled2.ipynb

Code blocks never finish running and syntax highlighting doesn't work either.

$ pip freeze ## kindly let me know if other packages are relevant
jupyter==1.0.0
jupyter-client==6.1.11
jupyter-console==6.2.0
jupyter-core==4.7.0
jupyter-server==1.2.1
jupyterlab==3.0.5
jupyterlab-pygments==0.1.2
jupyterlab-server==2.1.1
jupyterlab-widgets==1.0.0
ipykernel==5.4.3
ipython==7.19.0
ipython-genutils==0.2.0
tornado==6.1

$ python --version
Python 3.9.1

Things I've tried:

  • update all pip packages
  • jupyter lab clean and jupyter lab build
  • the above, after deleting ~/.local/share/jupyter completely
  • uninstalling all local pip packages and reinstalling jupyterlab
  • tried to piece together versions that can work with tornado 5.1.1 as downgrading was widely suggested as the workaround circa 2019

With the last one, I'm still stuck. Nothing runs and I get:

[W 12:38:39.292 LabApp] 404 GET /api/kernels/04e05056-81a8-4835-a2f2-d5a8f0552b20/channels?session_id=1fca15ef-7555-4157-a2e4-3ccbaf884c70 (127.0.0.1): Kernel does not exist: 04e05056-81a8-4835-a2f2-d5a8f0552b20

Any insights into how I can get out of this mess?

@Zsailer
Copy link
Member

Zsailer commented Jan 15, 2021

What version of PyZMQ are you running?

pip freeze | grep pyzmq

I think pyzmq==21.0.0 appears to be causing issues.

Try downgrading to pyzmq==20.0.0. Does that help?

@Zsailer
Copy link
Member

Zsailer commented Jan 15, 2021

Yikes, nevermind. I'm still seeing the error after downgrading.

@Zsailer
Copy link
Member

Zsailer commented Jan 15, 2021

@jwhendy would you mind closing this issue here and re-opening in jupyterlab/jupyterlab? This doesn't seem to be related to jupyter notebook, but rather, jupyterlab. We might be able to get more help there.

@jwhendy
Copy link
Author

jwhendy commented Jan 15, 2021

@Zsailer oops! No problem at all. You know, I completely missed that and clicked "new issue" from this repo when I found a similar bug. Sorry about that and will do.

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

No branches or pull requests

2 participants