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

[Bug]: "needs to build JupyterLab" loop #421

Closed
matejc opened this issue Feb 2, 2023 · 2 comments · Fixed by #460
Closed

[Bug]: "needs to build JupyterLab" loop #421

matejc opened this issue Feb 2, 2023 · 2 comments · Fixed by #460
Assignees
Labels
bug Something isn't working

Comments

@matejc
Copy link

matejc commented Feb 2, 2023

Current Behavior

Adding to system packages in NixOS, and running any jupyter* command ends with an endless loop.

❯  jupyter-notebook
[2023-02-02 18:28:23 jupyenv] needs to build JupyterLab.
.
.
.
[2023-02-02 18:28:43 jupyenv] needs to build JupyterLab.
[2023-02-02 18:28:45 jupyenv] needs to build JupyterLab.
[2023-02-02 18:28:45 jupyenv] needs to build JupyterLab.
^CTraceback (most recent call last):
  File "/nix/store/q36gakk9j5m01dynl172l7l2lliprr8l-jupyterlab-checker", line 1, in <module>
.
.
.

Expected Behavior

To not loop endlessly and starts listening on 8888 port

Steps To Reproduce

  1. Add to flake as input:
jupyenv = {
      url = "github:tweag/jupyenv/main";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  1. In the nixosConfigurations for nixpkgs.lib.nixosSystem add under modules:
          {
            environment.systemPackages = [ (inputs.jupyenv.lib."x86_64-linux".mkJupyterlabNew {
              kernel.python.example = {
                enable = true;
              };
            }) ];
          }
  1. rebuild switch the NixOS

OS

- system: `"x86_64-linux"`
 - host os: `Linux 6.1.3, NixOS, 23.05 (Stoat)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.12.0`
 - nixpkgs: `/home/matejc/workarea/nixpkgs`

Version

37c9075 (jupyenv/main)

Additional Context

I investigated a bit:

❯  cat /run/current-system/sw/bin/jupyter-notebook
...
❯  cat /nix/store/yrgikb6dd15mhc42rbs2plkm76hf4h3m-wrapper-chmod-python3-3.10.9-env/bin/.jupyter-notebook-wrapped
...
❯  cat /nix/store/f1br1w9s07rx7m47p29mz2svzbc60j4d-jupyterlab-cond-build
...
❯  /nix/store/73i016js78zicy28viiwx2284nrlx5f6-python3-3.10.9-env/bin/jupyter lab build

And come to conclusion that the last command here is the culprit.

Dig a bit further and found out it works if I isolate the environment:

❯  env --ignore-environment /run/current-system/sw/bin/jupyter-notebook

This now starts listening to the 8888 port and I can start python kernel.

Relevant log output

No response

@matejc matejc added the bug Something isn't working label Feb 2, 2023
@katanallama
Copy link

I experienced the same issue, a quick nix flake update in the directory where the flake is appears to resolve it.

@jhhuh
Copy link
Contributor

jhhuh commented Mar 16, 2023

I encountered the exact same symptom. In my case, jupyter-lab was in nix develop environment.

It turns out that jupyterlab-cond-build (https://github.com/tweag/jupyenv/blob/main/lib/jupyter.nix#L55) causes an infinite recursive calls to jupyter-lab. Here, the jupyter command dispatches its subcommand from the PATH, and, in our case it is jupyter-lab we installed that starts another jupyterlab-cond-build and so on.

PR #460 fixes this bug, hopefully.

garbas pushed a commit that referenced this issue Mar 16, 2023
prefix jupyterlabEnvBase to PATH before executing 'jupyter lab build'; fixes #421
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

Successfully merging a pull request may close this issue.

4 participants