Docker-stacks: base-notebook failed to spawn by jupyterhub

Created on 12 Mar 2020  路  4Comments  路  Source: jupyter/docker-stacks

The lastest base-notebook image failed to spawn by hub since the lastest image upgrade jupyterlab from 1.2.1 to 2.0.1

What docker image you are using?
jupyter/base-notebook:lastest(8882c505faa8)

What complete docker command do you run to launch the container (omitting sensitive values)?

-

What steps do you take once the container is running to reproduce the issue?

launch by jupyterhub

What do you expect to happen?

just work.

What actually happens?

/usr/local/bin/start-singleuser.sh: running hooks in /usr/local/bin/start-notebook.d
/usr/local/bin/start-singleuser.sh: running /usr/local/bin/start-notebook.d/chown_extra.sh
/usr/local/bin/start-singleuser.sh: running /usr/local/bin/start-notebook.d/config.sh
/usr/local/bin/start-singleuser.sh: running /usr/local/bin/start-notebook.d/extension_config.sh
/usr/local/bin/start-singleuser.sh: ignoring /usr/local/bin/start-notebook.d/extra_notebook_config.py
/usr/local/bin/start-singleuser.sh: running /usr/local/bin/start-notebook.d/ldconfig.sh
/usr/local/bin/start-singleuser.sh: running /usr/local/bin/start-notebook.d/oom_score_adj.sh
/usr/local/bin/start-singleuser.sh: running /usr/local/bin/start-notebook.d/remove_dangling_symlink.sh
/usr/local/bin/start-singleuser.sh: ignoring /usr/local/bin/start-notebook.d/tensorboard-nbextension-tree.json
/usr/local/bin/start-singleuser.sh: ignoring /usr/local/bin/start-notebook.d/tensorboard-serverextension.json
/usr/local/bin/start-singleuser.sh: running /usr/local/bin/start-notebook.d/ulimit.sh
/usr/local/bin/start-singleuser.sh: done running hooks in /usr/local/bin/start-notebook.d
Set username to: jovyan
usermod: no changes
Changing ownership of /datasets/tensorboard-demo to 1000:100 with options ''
Changing ownership of /datasets/test-mount to 1000:100 with options ''
Changing ownership of /project/infuseai to 1000:100 with options ''
Changing ownership of /home/jovyan to 1000:100 with options ''
Executing the command: jupyter labhub --ip=0.0.0.0
Traceback (most recent call last):
  File "/opt/conda/bin/jupyter-labhub", line 6, in <module>
    from jupyterlab.labhubapp import main
ModuleNotFoundError: No module named 'jupyterlab.labhubapp'
Bug

Most helpful comment

Till the mentioned PR by @twalcari is merged and the image is updated, here is a fix that works for me:

if you have been following the zero-to-jupyterhub tutorial like me, you would have used this in the config.yaml file:

hub:
  extraConfig:
    jupyterlab: |
      c.Spawner.cmd = ['jupyter-labhub']

Fix is to replace it by following (as mentioned in #1042):

hub:
  extraConfig:
    jupyterlab: |
      c.Spawner.default_url = "/lab"

All 4 comments

Hello,

Thanks to have reported this bug that has been introduced by the PR #1039.

Here is the cause of the problem

JupyterHub users should use the c.Spawner.default_url = '/lab' setting instead of the deprecated and now removed labhubapp (#7724)
-- https://jupyterlab.readthedocs.io/en/stable/getting_started/changelog.html

I'm guessing, but we have to check that we could fix the bug by changing the start-singleuser.sh launcher.

if [ ! -z "$JUPYTER_ENABLE_LAB" ]; then
-  NOTEBOOK_BIN="jupyter labhub"
+ NOTEBOOK_BIN="jupyter lab"

Here is what is called and we can see the the labhub command is trying to load jupyterlab.labhubapp that does not exist anymore while the command lab is calling jupyterlab.labapp.

$ cat /opt/conda/bin/jupyter-labhub
#!/opt/conda/bin/python3.7
# -*- coding: utf-8 -*-
import re
import sys

from jupyterlab.labhubapp import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

## ---

$ cat /opt/conda/bin/jupyter-lab
#!/opt/conda/bin/python3.7
# -*- coding: utf-8 -*-
import re
import sys

from jupyterlab.labapp import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

If you or someone else could submit a PR to fix it. In the meantime you can use the previous version by specifying the build tag.

I've determined that it suffices to remove the check for JUPYTER_ENABLE_LAB from start-singleuser.sh completely. My PR is now ready to be merged.

@twalcari Great thanks a lot I will have a look to the PR.

Till the mentioned PR by @twalcari is merged and the image is updated, here is a fix that works for me:

if you have been following the zero-to-jupyterhub tutorial like me, you would have used this in the config.yaml file:

hub:
  extraConfig:
    jupyterlab: |
      c.Spawner.cmd = ['jupyter-labhub']

Fix is to replace it by following (as mentioned in #1042):

hub:
  extraConfig:
    jupyterlab: |
      c.Spawner.default_url = "/lab"
Was this page helpful?
0 / 5 - 0 ratings