Closed manics closed 3 months ago
very strange that there are two JupyterHub classes trying to be instantiated, but they are not the same. This makes me think something fishy is happening with sys.path. Especially given that the reported env shows jupyterhub 5.1.0, but the startup logs show 4.1.6.
I'll need to think about how to debug this, but https://github.com/ipython/traitlets/pull/909 might have helped. Further debugging cls.__file__
might help.
Ah, yeah. Learn something about Python every day:
In jupyterhub/app.py:
def main():
from jupyterhub import app
print(JupyterHub.__module__) # __main__
print(JupyterHub) __main__.JupyterHub
print(app.JupyterHub) jupyterhub.app.JupyterHub
print(JupyterHub is app.JupyterHub) # False!
So jupyterhub shouldn't really allow -m jupyterhub.app
at all, but it can technically be fixed.
The fix here should be to replace -m jupyterhub.app
with -m jupyterhub
.
Bug description
Originally reported in https://discourse.jupyter.org/t/error-while-enabling-auth-state-persistance-for-genericoauthenticator/27746
How to reproduce
/opt/tljh/config/jupyterhub_config.d
:echo 'c.Authenticator.enable_auth_state = True' > /opt/tljh/config/jupyterhub_config.d/authstate.py
tljh-config reload
, hub will fail to startsudo journalctl -u jupyterhub
This can also be reproduced by running the TLJH systemd start command https://github.com/jupyterhub/the-littlest-jupyterhub/blob/c49fada1c8c1701aeff9f000b01503c20ba6bb25/tljh/systemd-units/jupyterhub.service#L21 directly in a terminal:
/opt/tljh/hub/bin/python3 -m jupyterhub.app -f /opt/tljh/hub/lib/python3.8/site-packages/tljh/jupyterhub_config.py
Replacing
/opt/tljh/hub/bin/python3 -m jupyterhub.app
with/opt/tljh/hub/bin/python3 -m jupyterhub
or/opt/tljh/hub/bin/jupyterhub
both work Note you'll also need to setJUPYTERHUB_CRYPT_KEY
, but this is not the cause of this bugExpected behaviour
Actual behaviour
Your personal set up
Killercoda Ubuntu 20.04.5 LTS VM https://killercoda.com/manics/scenario/the-littlest-jupyterhub