Hello, I manage our laboratory server where we have JupyterHub working with traditional notebooks under Apache proxy server under the “Jupyter” folder on a Ubuntu 20.04 server.
It works great.
I am now trying to add JupyterLab instead (or en plus) of “classic” notebooks.
I have added it using pip (as for the rest of the system) and restarted jupyterhub service (sudo systemctl restart jupyterhub) but when I go (manually or by setting c.Spawner.default_url = "/lab" in jupyterhub_config.py) to https://[server]/jupyter/user/[my user]/lab I get a 403 not found error.
In a forum I got to try “# jupyter lab build”, but when I try Iget an error that it requires nodejs >=12.0.0 while my apt-get says “nodejs is already the newest version (10.19.0~dfsg-3ubuntu1)”.
Ok, I have added the repos and installed node 19, “jupyter lab build” now works, but still 403 error on “/lab” :-/
and it runs under an apache proxy server, but not under the root directory, instead it runs under c.JupyterHub.base_url = '/jupyter/'.
If I add c.Spawner.default_url = '/lab' to /etc/jupyterhub_config.py I am correctly redirected to [...]/lab but then I have the 403 error (from Jupyter, not from Apache, I can still see the Jupyter headers).
By running the jupyterhub by command line I got the stderror where I got this:
[W 2023-01-26 09:56:44.808 SingleUserNotebookApp serverextension:13] Loading JupyterLab as a classic notebook (v6) extension.
[C 2023-01-26 09:56:44.809 SingleUserNotebookApp serverextension:18] You must use Jupyter Server v1 to load JupyterLab as notebook extension. You have v2.1.0 installed.
You can fix this by executing:
pip install -U "jupyter-server<2.0.0"
[I 2023-01-26 09:56:44.809 SingleUserNotebookApp singleuser:561] Starting jupyterhub-singleuser server version 1.1.0
By indeed running that command it is now working but… what do I loose by running jupyter-server-1.23.5 instead of jupyter-server-2.1.0 ?
sic… I have updated Jupyterhub, and after a few other updates (including the database) I got it working, but only when I run it directly (i.e. # /usr/local/bin/jupyterhub -f /etc/jupyterhub/jupyterhub_config.py) … when I run it under sytemctl I get the following error:
root@lef-nancy ~ # sudo systemctl start jupyterhub
root@lef-nancy ~ # sudo systemctl status jupyterhub
● jupyterhub.service - Jupyterhub
Loaded: loaded (/etc/systemd/system/jupyterhub.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2023-01-26 16:01:55 CET; 5s ago
Process: 10405 ExecStart=/usr/local/bin/jupyterhub -f /etc/jupyterhub/jupyterhub_config.py (code=exited, status=1/FAILURE)
Main PID: 10405 (code=exited, status=1/FAILURE)
janv. 26 16:01:55 lef-nancy systemd: Started Jupyterhub.
janv. 26 16:01:55 lef-nancy jupyterhub: [I 2023-01-26 16:01:55.498 JupyterHub app:2810] Running JupyterHub version 3.1.0
janv. 26 16:01:55 lef-nancy jupyterhub: [I 2023-01-26 16:01:55.498 JupyterHub app:2840] Using Authenticator: jupyterhub.auth.PAMAuthenticator-3.1.0
janv. 26 16:01:55 lef-nancy jupyterhub: [I 2023-01-26 16:01:55.498 JupyterHub app:2840] Using Spawner: jupyterhub.spawner.LocalProcessSpawner-3.1.0
janv. 26 16:01:55 lef-nancy jupyterhub: [I 2023-01-26 16:01:55.498 JupyterHub app:2840] Using Proxy: jupyterhub.proxy.ConfigurableHTTPProxy-3.1.0
janv. 26 16:01:55 lef-nancy jupyterhub: [I 2023-01-26 16:01:55.499 JupyterHub app:1649] Loading cookie_secret from /jupyterhub_cookie_secret
janv. 26 16:01:55 lef-nancy jupyterhub: Found database schema version 4dc2d5a8c53c != 651f5419b74d. Backup your database and run `jupyterhub upgrade-db` to upgrade to the latest schema.
janv. 26 16:01:55 lef-nancy systemd: jupyterhub.service: Main process exited, code=exited, status=1/FAILURE
janv. 26 16:01:55 lef-nancy systemd: jupyterhub.service: Failed with result 'exit-code'.
The “strange” thing is that I did already updated the db with # jupyterhub upgrade-db…
My system service is on both nano /lib/systemd/system/jupyterhub.service and /etc/systemd/system/jupyterhub.service: