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

jupyter notebook package is broken and service does not work #355046

Closed
JohnRTitor opened this issue Nov 10, 2024 · 7 comments · Fixed by #367106
Closed

jupyter notebook package is broken and service does not work #355046

JohnRTitor opened this issue Nov 10, 2024 · 7 comments · Fixed by #367106
Labels
0.kind: bug Something is broken 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab 6.topic: python

Comments

@JohnRTitor
Copy link
Contributor

Describe the bug

I believe Jupyter notebook package has some stuff missing due to a packaging oversight, this makes the package unusable.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Enable the service and open localhost:8888 or whatever you configured
  2. Login and see an empty screen without anything to do

Expected behavior

Jupyter notebook works properly.

Screenshots

image

Additional context

Log from systemctl status jupyter.service:

Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:       File "/nix/store/gnvanwhk2v293gcp4a75sf294giym0ms-python3.12-jupyterlab-server-2.27.3/lib/python3.12/site-packages/jupyterlab_server/settings_handler.py", line 58, in get
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:         result, warnings = get_settings(
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:                            ^^^^^^^^^^^^^
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:       File "/nix/store/gnvanwhk2v293gcp4a75sf294giym0ms-python3.12-jupyterlab-server-2.27.3/lib/python3.12/site-packages/jupyterlab_server/settings_utils.py", line 385, in get_settings
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:         schema, version = _get_schema(schemas_dir, schema_name, overrides, labextensions_path)
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:       File "/nix/store/gnvanwhk2v293gcp4a75sf294giym0ms-python3.12-jupyterlab-server-2.27.3/lib/python3.12/site-packages/jupyterlab_server/settings_utils.py", line 61, in _get_schema
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:         raise web.HTTPError(404, notfound_error % path)
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:     tornado.web.HTTPError: HTTP 404: Not Found (Schema not found: /nix/store/901c80rlps5q05bnjk1sj4zaz5k736nc-python3-3.12.7/share/jupyter/lab/schemas/@jupyterlab/notebook-extension/panel.json)
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]: [W 2024-11-11 00:32:24.080 JupyterNotebookApp] 404 GET /lab/api/settings/@jupyterlab/notebook-extension:panel?1731265344066 (926d58aeacc84c59b2ee947204997e6d@::1) 2.49ms referer=http://localhost:8888/tree

It also fails when launching from the terminal.

Notify maintainers

@GaetanLepage @natsukium @thomasjm

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.11.6-cachyos, NixOS, 24.11 (Vicuna), 24.11.20241109.76612b1`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Lix, like Nix) 2.91.1
System type: x86_64-linux
Additional system types: aarch64-linux, i686-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/masum/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/masum/.local/share/flatpak/exports/etc/xdg/nix/nix.conf:/var/lib/flatpak/exports/etc/xdg/nix/nix.conf:/home/masum/.nix-profile/etc/xdg/nix/nix.conf:/home/masum/.local/state/nix/profile/etc/xdg/nix/nix.conf:/home/masum/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/masum/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/k1iys4jifr01ql4bzafl6ny71qzw32wz-lix-2.91.1/share`
 - nixpkgs: `/nix/store/0sxsfzswhjck7f4sbsvznz285s4i7y64-source`

Add a 👍 reaction to issues you find important.

@JohnRTitor JohnRTitor added 0.kind: bug Something is broken 6.topic: python 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab labels Nov 10, 2024
@JohnRTitor
Copy link
Contributor Author

I would try to fix this myself but I have no idea about python packaging :(

Pinging @dotlambda @fabaff for their inputs as well.

@natsukium
Copy link
Member

Is this the case when enabled via nixos modules?
It works fine with nix-shell on master branch in my environment, but do you get the same error?

nix-shell -p 'python3.withPackages (ps: with ps; [jupyter])' --run 'jupyter notebook'

@JohnRTitor
Copy link
Contributor Author

Thanks for the prompt response, the above nix-shell command works.

Is this the case when enabled via nixos modules?

Yes. I am using the following as my starter setup. Will configure it more if this issue is fixed.

{pkgs, ...}:
{
  services.jupyter.enable = true;
  services.jupyter.password = "'sha1:1b961dc713fb:88483270a63e57d18d43cf337e629539de1436ba'"; # test
  #services.jupyter.notebookDir = "Notebooks";
}

image

Left: Nix-shell
Right: Service

@JohnRTitor
Copy link
Contributor Author

@natsukium any update on this?

@b-m-f
Copy link
Contributor

b-m-f commented Dec 11, 2024

Same issue here. Also using the provided service

Edit:

@JohnRTitor I have been able to get it running with the following config:

    package = pkgs.python3.withPackages (
      ps: with ps; [
        jupyter
      ]
    );
    command = "jupyter notebook";

@b-m-f
Copy link
Contributor

b-m-f commented Dec 11, 2024

Going to leave my other findings here.

In order to use the password set the command to

    command = "jupyter notebook --NotebookApp.password='pasword'";

Password can be generated with

>>> from jupyter_server.auth import passwd;
>>> print(passwd("test"))

@b-m-f
Copy link
Contributor

b-m-f commented Dec 21, 2024

I have created #367106

It fixes existing problems faced in this issue and adds extra configuration options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab 6.topic: python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants