Closed
Description
Hello,
I'm running a Jupyter Notebook remotely with django-shell-plus and open it locally in my browser, but I'm regularly facing a problem : HTTP 404: Not Found - Kernel does not exist. I followed the recommendation from [this issue] but unfortunatly it doesn't solve my problem.(#4909)
Output
(env) user@ubuntu-2cpu-4gb-de-fra1:/var/www/app$ python manage.py shell_plus --notebook --no-browser
[I 07:28:45.347 NotebookApp] Serving notebooks from local directory: /var/www/app
[I 07:28:45.347 NotebookApp] The Jupyter Notebook is running at:
[I 07:28:45.347 NotebookApp] http://localhost:8888/?token=ac388ddf14c9878471c47244a4111d12ed4048e838368050
[I 07:28:45.347 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 07:28:45.350 NotebookApp]
To access the notebook, open this file in a browser:
file:///home/user/.local/share/jupyter/runtime/nbserver-19823-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=ac388ddf14c9878471c47244a4111d12ed4048e838368050
[E 07:28:54.285 NotebookApp] Exception restarting kernel
Traceback (most recent call last):
File "/home/user/.local/lib/python3.7/site-packages/notebook/services/kernels/handlers.py", line 85, in post
yield gen.maybe_future(km.restart_kernel(kernel_id))
File "/home/user/.local/lib/python3.7/site-packages/notebook/services/kernels/kernelmanager.py", line 285, in restart_kernel
self._check_kernel_id(kernel_id)
File "/home/user/.local/lib/python3.7/site-packages/notebook/services/kernels/kernelmanager.py", line 364, in _check_kernel_id
raise web.HTTPError(404, u'Kernel does not exist: %s' % kernel_id)
tornado.web.HTTPError: HTTP 404: Not Found (Kernel does not exist: ac442b4a-daa5-4b42-925a-caad7f9718a9)
[E 07:28:54.288 NotebookApp] {
"Host": "localhost:8888",
"Connection": "keep-alive",
"Content-Length": "0",
"Accept": "application/json, text/javascript, */*; q=0.01",
"Dnt": "1",
"X-Requested-With": "XMLHttpRequest",
"X-Xsrftoken": "2|8bbbbb7d|0518917637b894ceb93c9b1c3e362acc|1632481357",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"Sec-Gpc": "1",
"Origin": "http://localhost:8888",
"Sec-Fetch-Site": "same-origin",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Dest": "empty",
"Referer": "http://localhost:8888/notebooks/Untitled.ipynb",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8",
"Cookie": "_xsrf=2|8bbbbb7d|0518917637b894ceb93c9b1c3e362acc|1632481357; username-localhost-8888=\"2|1:0|10:1634463998|23:username-localhost-8888|44:ZTc3NjU3OTI4YjkzNGIzZjlkMTQ5NjE5OWY5NjZkNmY=|69d0615da498719b09ac771e107ed6dec7fe215807445c1786d36020db3b2598\""
}
[E 07:28:54.288 NotebookApp] 500 POST /api/kernels/ac442b4a-daa5-4b42-925a-caad7f9718a9/restart (127.0.0.1) 3.44ms referer=http://localhost:8888/notebooks/Untitled.ipynb
[W 07:28:54.348 NotebookApp] 404 DELETE /api/sessions/f997b2ad-0c49-4ff8-a42c-84b02034120c (127.0.0.1): Session not found: session_id='f997b2ad-0c49-4ff8-a42c-84b02034120c'
[W 07:28:54.349 NotebookApp] Session not found: session_id='f997b2ad-0c49-4ff8-a42c-84b02034120c'
[W 07:28:54.349 NotebookApp] 404 DELETE /api/sessions/f997b2ad-0c49-4ff8-a42c-84b02034120c (127.0.0.1) 1.99ms referer=http://localhost:8888/notebooks/Untitled.ipynb
[I 07:29:54.904 NotebookApp] Kernel started: af1323c0-d216-4d3a-a149-5ca2d4920ec0
/usr/lib/python3.7/json/encoder.py:257: UserWarning: date_default is deprecated since jupyter_client 7.0.0. Use jupyter_client.jsonutil.json_default.
return _iterencode(o, 0)
Package version
tornado==5.1.1
jupyter==1.0.0
jupyter-client==7.0.6
jupyter-console==6.4.0
jupyter-core==4.8.1
jupyterlab-pygments==0.1.2
jupyterlab-widgets==1.0.2
Help would be appreciated,
Best,