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

Trying to run Jupyter Book with Jupyter Lab saying : Kernel don't exist on clean installation #1875

Closed
reyman opened this issue Feb 26, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@reyman
Copy link

reyman commented Feb 26, 2025

Description

I'm trying to run jupyter lab then jupyter book ... but i have errors starting the first step.

Step to reproduce

1 - I first edit the myst.yaml setting a Token :

version: 1

project:
  id: c5c40e2e-d996-4496-bc13-ad759f40986a
  jupyter:
    server:
      url: http://127.0.0.1:8888/
      token: 512ac78f14e1141db1fac17e8b4099c1e5bc7d589518b38c
site:
  template: book-theme

2 - I run Jupyter Lab with token :

jupyter-lab --IdentityProvider.token=512ac78f14e1141db1fac17e8b4099c1e5bc7d589518b38c --NotebookApp.allow_origin='http://localhost:3000' &

Server run but return these Warning/Errors constantly :

[I 2025-02-26 08:25:09.665 ServerApp] jupyter_server_terminals | extension was successfully linked.
[W 2025-02-26 08:25:09.666 LabApp] 'allow_origin' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[I 2025-02-26 08:25:09.670 ServerApp] jupyterlab | extension was successfully linked.
[I 2025-02-26 08:25:09.670 ServerApp] jupyterlab_myst | extension was successfully linked.
[I 2025-02-26 08:25:09.888 ServerApp] notebook_shim | extension was successfully linked.
[I 2025-02-26 08:25:09.907 ServerApp] notebook_shim | extension was successfully loaded.
[I 2025-02-26 08:25:09.909 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2025-02-26 08:25:09.910 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2025-02-26 08:25:09.911 LabApp] JupyterLab extension loaded from /home/reyman/.local/lib/python3.10/site-packages/jupyterlab
[I 2025-02-26 08:25:09.911 LabApp] JupyterLab application directory is /home/reyman/.local/share/jupyter/lab
[I 2025-02-26 08:25:09.912 LabApp] Extension Manager is 'pypi'.
[I 2025-02-26 08:25:09.975 ServerApp] jupyterlab | extension was successfully loaded.
[I 2025-02-26 08:25:09.977 ServerApp] jupyterlab_myst | extension was successfully loaded.
[I 2025-02-26 08:25:09.977 ServerApp] Serving notebooks from local directory: /home/reyman
[I 2025-02-26 08:25:09.977 ServerApp] Jupyter Server 2.15.0 is running at:
[I 2025-02-26 08:25:09.977 ServerApp] http://localhost:8888/lab?token=...
[I 2025-02-26 08:25:09.978 ServerApp]     http://127.0.0.1:8888/lab?token=...
[I 2025-02-26 08:25:09.978 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 2025-02-26 08:25:09.981 ServerApp] No web browser found: Error('could not locate runnable browser').
[I 2025-02-26 08:25:10.106 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
[W 2025-02-26 08:25:12.045 ServerApp] 404 GET /api/kernels/5f7ad16c-5f14-4c1c-a8ce-5859be515b62?1740558312042 (127.0.0.1): Kernel does not exist: 5f7ad16c-5f14-4c1c-a8ce-5859be515b62
[W 2025-02-26 08:25:12.045 ServerApp] wrote error: 'Kernel does not exist: 5f7ad16c-5f14-4c1c-a8ce-5859be515b62'
    Traceback (most recent call last):
      File "/home/reyman/.local/lib/python3.10/site-packages/tornado/web.py", line 1790, in _execute
        result = await result
      File "/home/reyman/.local/lib/python3.10/site-packages/jupyter_server/auth/decorator.py", line 73, in inner
        return await out
      File "/home/reyman/.local/lib/python3.10/site-packages/jupyter_server/services/kernels/handlers.py", line 75, in get
        model = await ensure_async(km.kernel_model(kernel_id))
      File "/home/reyman/.local/lib/python3.10/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 508, in kernel_model
        self._check_kernel_id(kernel_id)
      File "/home/reyman/.local/lib/python3.10/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 539, in _check_kernel_id
        raise web.HTTPError(404, "Kernel does not exist: %s" % kernel_id)
    tornado.web.HTTPError: HTTP 404: Not Found (Kernel does not exist: 5f7ad16c-5f14-4c1c-a8ce-5859be515b62)
[W 2025-02-26 08:25:12.047 ServerApp] 404 GET /api/kernels/5f7ad16c-5f14-4c1c-a8ce-5859be515b62?1740558312042 ([email protected]) 2.14ms referer=http://localhost:3000/
[W 2025-02-26 08:25:12.690 ServerApp] wrote error: 'Forbidden'
    Traceback (most recent call last):
      File "/home/reyman/.local/lib/python3.10/site-packages/tornado/web.py", line 1788, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/home/reyman/.local/lib/python3.10/site-packages/tornado/web.py", line 3289, in wrapper
        url = self.get_login_url()
      File "/home/reyman/.local/lib/python3.10/site-packages/jupyter_server/base/handlers.py", line 784, in get_login_url
        raise web.HTTPError(403)
    tornado.web.HTTPError: HTTP 403: Forbidden
[W 2025-02-26 08:25:12.690 ServerApp] 403 GET /api/kernels/bafa463b-6fc0-4ce1-b012-d657c83fa485?1740558312687 (@127.0.0.1) 0.91ms referer=http://127.0.0.1:3000/
[W 2025-02-26 08:25:18.016 ServerApp] wrote error: 'Forbidden'
    Traceback (most recent call last):
      File "/home/reyman/.local/lib/python3.10/site-packages/tornado/web.py", line 1788, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/home/reyman/.local/lib/python3.10/site-packages/tornado/web.py", line 3289, in wrapper
        url = self.get_login_url()
      File "/home/reyman/.local/lib/python3.10/site-packages/jupyter_server/base/handlers.py", line 784, in get_login_url
        raise web.HTTPError(403)
    tornado.web.HTTPError: HTTP 403: Forbidden
[W 2025-02-26 08:25:18.016 ServerApp] 403 GET /api/kernels/9ff45ff5-6f3e-421b-8193-edabee291ead?1740558318014 (@127.0.0.1) 0.84ms referer=http://127.0.0.1:3000/
[W 2025-02-26 08:25:31.688 ServerApp] wrote error: 'Forbidden'
    Traceback (most recent call last):
      File "/home/reyman/.local/lib/python3.10/site-packages/tornado/web.py", line 1788, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/home/reyman/.local/lib/python3.10/site-packages/tornado/web.py", line 3289, in wrapper
        url = self.get_login_url()
      File "/home/reyman/.local/lib/python3.10/site-packages/jupyter_server/base/handlers.py", line 784, in get_login_url
        raise web.HTTPError(403)
    tornado.web.HTTPError: HTTP 403: Forbidden
[W 2025-02-26 08:25:31.689 ServerApp] 403 GET /api/kernels/bafa463b-6fc0-4ce1-b012-d657c83fa485?1740558331686 (@127.0.0.1) 0.74ms referer=http://127.0.0.1:3000/
[W 2025-02-26 08:25:32.503 ServerApp] Blocking Cross Origin API request for /api/kernels/87631ef8-88ce-4fba-a976-b218907654a6.  Origin: http://localhost:3000, Host: 127.0.0.1:8888
[W 2025-02-26 08:25:32.503 ServerApp] wrote error: 'Not Found'
    Traceback (most recent call last):
      File "/home/reyman/.local/lib/python3.10/site-packages/tornado/web.py", line 1769, in _execute
        result = await result  # type: ignore
      File "/home/reyman/.local/lib/python3.10/site-packages/jupyter_server/base/handlers.py", line 754, in prepare
        raise web.HTTPError(404)
    tornado.web.HTTPError: HTTP 404: Not Found
[W 2025-02-26 08:25:32.504 ServerApp] 404 GET /api/kernels/87631ef8-88ce-4fba-a976-b218907654a6?1740558332500 (@127.0.0.1) 0.78ms referer=http://localhost:3000/
[W 2025-02-26 08:25:34.051 ServerApp] 404 GET /api/kernels/5f7ad16c-5f14-4c1c-a8ce-5859be515b62?1740558334047 (127.0.0.1): Kernel does not exist: 5f7ad16c-5f14-4c1c-a8ce-5859be515b62
[W 2025-02-26 08:25:34.051 ServerApp] wrote error: 'Kernel does not exist: 5f7ad16c-5f14-4c1c-a8ce-5859be515b62'
    Traceback (most recent call last):
      File "/home/reyman/.local/lib/python3.10/site-packages/tornado/web.py", line 1790, in _execute
        result = await result
      File "/home/reyman/.local/lib/python3.10/site-packages/jupyter_server/auth/decorator.py", line 73, in inner
        return await out
      File "/home/reyman/.local/lib/python3.10/site-packages/jupyter_server/services/kernels/handlers.py", line 75, in get
        model = await ensure_async(km.kernel_model(kernel_id))
      File "/home/reyman/.local/lib/python3.10/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 508, in kernel_model
        self._check_kernel_id(kernel_id)
      File "/home/reyman/.local/lib/python3.10/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 539, in _check_kernel_id
        raise web.HTTPError(404, "Kernel does not exist: %s" % kernel_id)
    tornado.web.HTTPError: HTTP 404: Not Found (Kernel does not exist: 5f7ad16c-5f14-4c1c-a8ce-5859be515b62)
[W 2025-02-26 08:25:34.052 ServerApp] 404 GET /api/kernels/5f7ad16c-5f14-4c1c-a8ce-5859be515b62?1740558334047 ([email protected]) 2.56ms referer=http://localhost:3000/

3 - Jupyter Book

Next step is running ```jupyter-book start --debug &`

4- Connecting localhost:3000

It works only with jupyter server alone on localhost:8888, but not whith jupyter lab.

THe pip list :

Package                       Version
----------------------------- --------------
accessible-pygments           0.0.5
alabaster                     0.7.16
anyio                         4.8.0
argon2-cffi                   23.1.0
argon2-cffi-bindings          21.2.0
arrow                         1.3.0
asttokens                     3.0.0
async-lru                     2.0.4
attrs                         25.1.0
babel                         2.17.0
beautifulsoup4                4.13.3
bleach                        6.2.0
certifi                       2025.1.31
cffi                          1.17.1
charset-normalizer            3.4.1
click                         8.1.8
comm                          0.2.2
debugpy                       1.8.12
decorator                     5.2.1
defusedxml                    0.7.1
docutils                      0.21.2
exceptiongroup                1.2.2
executing                     2.2.0
fastjsonschema                2.21.1
fqdn                          1.5.1
GDAL                          3.6.1
greenlet                      3.1.1
h11                           0.14.0
httpcore                      1.0.7
httpx                         0.28.1
idna                          3.10
imagesize                     1.4.1
importlib_metadata            8.6.1
ipykernel                     6.29.5
ipython                       8.32.0
isoduration                   20.11.0
jedi                          0.19.2
Jinja2                        3.1.5
json5                         0.10.0
jsonpointer                   3.0.0
jsonschema                    4.23.0
jsonschema-specifications     2024.10.1
jupyter-book                  2.0.0a2
jupyter-cache                 1.0.1
jupyter_client                8.6.3
jupyter_core                  5.7.2
jupyter-events                0.12.0
jupyter-lsp                   2.2.5
jupyter_server                2.15.0
jupyter_server_terminals      0.5.3
jupyterlab                    4.3.5
jupyterlab_pygments           0.3.0
jupyterlab_server             2.27.3
latexcodec                    3.0.0
linkify-it-py                 2.0.3
markdown-it-py                3.0.0
MarkupSafe                    3.0.2
matplotlib-inline             0.1.7
mdit-py-plugins               0.4.2
mdurl                         0.1.2
mistune                       3.1.2
myst-nb                       1.2.0
myst-parser                   3.0.1
mystmd                        1.3.23
nbclient                      0.10.2
nbconvert                     7.16.6
nbformat                      5.10.4
nest-asyncio                  1.6.0
nodeenv                       1.9.1
notebook_shim                 0.2.4
numpy                         1.24.4
overrides                     7.7.0
packaging                     24.2
pandocfilters                 1.5.1
parso                         0.8.4
pexpect                       4.9.0
pip                           23.1
platformdirs                  4.2.2
prometheus_client             0.21.1
prompt_toolkit                3.0.50
psutil                        7.0.0
ptyprocess                    0.7.0
pure_eval                     0.2.3
pybtex                        0.24.0
pybtex-docutils               1.0.3
pycparser                     2.22
pydata-sphinx-theme           0.15.4
Pygments                      2.19.1
python-dateutil               2.9.0.post0
python-json-logger            3.2.1
PyYAML                        6.0.2
pyzmq                         26.2.1
referencing                   0.36.2
requests                      2.32.3
rfc3339-validator             0.1.4
rfc3986-validator             0.1.1
rpds-py                       0.23.1
Send2Trash                    1.8.3
setuptools                    63.2.0
six                           1.17.0
sniffio                       1.3.1
snowballstemmer               2.2.0
soupsieve                     2.6
Sphinx                        7.4.7
sphinx-book-theme             1.1.4
sphinx-comments               0.0.3
sphinx-copybutton             0.5.2
sphinx_design                 0.6.1
sphinx_external_toc           1.0.1
sphinx-jupyterbook-latex      1.0.0
sphinx-multitoc-numbering     0.1.3
sphinx-thebe                  0.3.1
sphinx-togglebutton           0.3.2
sphinxcontrib-applehelp       2.0.0
sphinxcontrib-bibtex          2.6.3
sphinxcontrib-devhelp         2.0.0
sphinxcontrib-htmlhelp        2.1.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          2.0.0
sphinxcontrib-serializinghtml 2.0.0
SQLAlchemy                    2.0.38
stack-data                    0.6.3
tabulate                      0.9.0
terminado                     0.18.1
tinycss2                      1.4.0
tomli                         2.2.1
tornado                       6.4.2
traitlets                     5.14.3
types-python-dateutil         2.9.0.20241206
typing_extensions             4.12.2
uc-micro-py                   1.0.3
uri-template                  1.3.0
urllib3                       2.3.0
wcwidth                       0.2.13
webcolors                     24.11.1
webencodings                  0.5.1
websocket-client              1.8.0
wheel                         0.45.1
zipp                          3.21.0

I don't understand the error, seems there is old kernel, cache or something .... but my install is clean starting from a local containerized env ...

Proposed solution

No solution actually.

Additional notes

@reyman reyman added the bug Something isn't working label Feb 26, 2025
@reyman reyman changed the title Jupyter Lab say : Kernel don't exist on clean installation Trying to run Jupyter Book with Jupyter Lab saying : Kernel don't exist on clean installation Feb 26, 2025
@agoose77
Copy link
Contributor

agoose77 commented Feb 26, 2025

Try

jupyter-server --IdentityProvider.token=512ac78f14e1141db1fac17e8b4099c1e5bc7d589518b38c --ServerApp.allow_origin='http://localhost:3000'

The option you need to set for contemporary servers is ServerApp.allow_origin, and without this set I'd expect to see the kinds of cross-origin errors you're getting in the terminal output.

@reyman
Copy link
Author

reyman commented Feb 26, 2025

Yep, i try with ServerApp :

 jupyter-lab --IdentityProvider.token='512ac78f14e1141db1fac17e8b4099c1e5bc7d589518b38c' --ServerApp.allow_origin='http:localhost:3000' &

[I 2025-02-26 16:48:28.708 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2025-02-26 16:48:28.712 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2025-02-26 16:48:28.717 ServerApp] jupyterlab | extension was successfully linked.
[I 2025-02-26 16:48:28.935 ServerApp] notebook_shim | extension was successfully linked.
[I 2025-02-26 16:48:28.954 ServerApp] notebook_shim | extension was successfully loaded.
[I 2025-02-26 16:48:28.957 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2025-02-26 16:48:28.958 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2025-02-26 16:48:28.959 LabApp] JupyterLab extension loaded from /home/reyman/.local/lib/python3.10/site-packages/jupyterlab
[I 2025-02-26 16:48:28.960 LabApp] JupyterLab application directory is /home/reyman/.local/share/jupyter/lab
[I 2025-02-26 16:48:28.960 LabApp] Extension Manager is 'pypi'.
[I 2025-02-26 16:48:29.019 ServerApp] jupyterlab | extension was successfully loaded.
[I 2025-02-26 16:48:29.020 ServerApp] Serving notebooks from local directory: /home/reyman/postraitement-notebook
[I 2025-02-26 16:48:29.020 ServerApp] Jupyter Server 2.15.0 is running at:
[I 2025-02-26 16:48:29.020 ServerApp] http://localhost:8888/lab?token=...
[I 2025-02-26 16:48:29.020 ServerApp]     http://127.0.0.1:8888/lab?token=...
[I 2025-02-26 16:48:29.020 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 2025-02-26 16:48:29.023 ServerApp] No web browser found: Error('could not locate runnable browser').
[I 2025-02-26 16:48:29.149 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
[W 2025-02-26 16:48:32.413 ServerApp] Blocking Cross Origin API request for /api/kernels/87631ef8-88ce-4fba-a976-b218907654a6.  Origin: http://localhost:3000, Host: 127.0.0.1:8888
[W 2025-02-26 16:48:32.413 ServerApp] wrote error: 'Not Found'
    Traceback (most recent call last):
      File "/home/reyman/.local/lib/python3.10/site-packages/tornado/web.py", line 1769, in _execute
        result = await result  # type: ignore
      File "/home/reyman/.local/lib/python3.10/site-packages/jupyter_server/base/handlers.py", line 754, in prepare
        raise web.HTTPError(404)
    tornado.web.HTTPError: HTTP 404: Not Found
[W 2025-02-26 16:48:32.415 ServerApp] 404 GET /api/kernels/87631ef8-88ce-4fba-a976-b218907654a6?1740588512400 (@127.0.0.1) 2.68ms referer=http://localhost:3000/
[W 2025-02-26 16:48:36.724 ServerApp] 404 GET /api/kernels/5f7ad16c-5f14-4c1c-a8ce-5859be515b62?1740588516720 (127.0.0.1): Kernel does not exist: 5f7ad16c-5f14-4c1c-a8ce-5859be515b62

Same error with jupyter-lab (and not jupyter-server)

With jupyter-server, to remove the CORS problems i generate a config file jupyter-server --generate-config and set policy to "*"

That resolve the problem of CORS, but that doesn't solve the others errors, on kernel not existing...

I have the same error with both jupyter lab and jupyter server.

@agoose77
Copy link
Contributor

You have a typo. It should be this:

jupyter-lab --IdentityProvider.token='512ac78f14e1141db1fac17e8b4099c1e5bc7d589518b38c' --ServerApp.allow_origin='http://localhost:3000' &

@reyman
Copy link
Author

reyman commented Feb 26, 2025

You have a typo. It should be this:

jupyter-lab --IdentityProvider.token='512ac78f14e1141db1fac17e8b4099c1e5bc7d589518b38c' --ServerApp.allow_origin='http://localhost:3000' &

Omg ... so much time lost due to this typo ...
I reread ten times the line without seein it.
Thanks for your eagle eye ! Much Much better.

But the step 4, opening the jupyter lab from localhost:3000 to localhost:8888, i have no "visual" display of mystmd, only raw text, and no running option.

Image

Image

Package mystmd is installed correctly it seems :

 [I 2025-02-26 20:30:30.172 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2025-02-26 20:30:30.177 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2025-02-26 20:30:30.182 ServerApp] jupyterlab | extension was successfully linked.
[I 2025-02-26 20:30:30.182 ServerApp] jupyterlab_myst | extension was successfully linked.
[I 2025-02-26 20:30:30.395 ServerApp] notebook_shim | extension was successfully linked.
[I 2025-02-26 20:30:30.412 ServerApp] notebook_shim | extension was successfully loaded.
[I 2025-02-26 20:30:30.414 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2025-02-26 20:30:30.415 ServerApp] jupyter_server_terminals | extension was successfully loaded.

Image

I have this error/warning :


[I 2025-02-26 20:30:54.991 LabApp] `sys_prefix` level settings are read-only, using `user` level for migration to `lockedExtensions`
[I 2025-02-26 20:30:54.995 LabApp] Build is up to date
[I 2025-02-26 20:30:55.561 LabApp] `sys_prefix` level settings are read-only, using `user` level for migration to `lockedExtensions`
[I 2025-02-26 20:30:55.566 LabApp] `sys_prefix` level settings are read-only, using `user` level for migration to `lockedExtensions`
[I 2025-02-26 20:30:55.578 LabApp] `sys_prefix` level settings are read-only, using `user` level for migration to `lockedExtensions`

@rowanc1
Copy link
Member

rowanc1 commented Feb 26, 2025

You can install jupytext on the server to have an "open-with notebook". juputerlab-myst doesn't do that part of the workflow at the moment!

@reyman
Copy link
Author

reyman commented Feb 26, 2025

Works great, thanks, waiting the next iteration for jupyterlab-myst ! :)
Thanks again for your help.

@reyman reyman closed this as completed Feb 26, 2025
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

3 participants