Dear all,
I have deployed jupyterhub with docker-compose setup described https://github.com/jupyterhub/jupyterhub-deploy-docker.
On two servers where I used PAM authentication, I have no problem. On a new server, I needed to use keycloak for authentication with GenericOAuthenticator. On this new server also authentication works fine, but after authentication I get 404 Error on spawning of the single-user image. I have tried multiple single images. In all cases, I get the following log for my single-user image.
[I 00:37:01.039 NotebookApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 00:37:01.041 NotebookApp] Serving notebooks from local directory: /home/pyiron
[I 00:37:01.042 NotebookApp] Jupyter Notebook 6.1.4 is running at:
[I 00:37:01.042 NotebookApp] http://5137103405f0:8888/?token=9c4321f5e60c9ebe56e54d4eee89351ad3d5c432a1abe9d1
[I 00:37:01.042 NotebookApp] or http://127.0.0.1:8888/?token=9c4321f5e60c9ebe56e54d4eee89351ad3d5c432a1abe9d1
[I 00:37:01.042 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 00:37:01.044 NotebookApp]
To access the notebook, open this file in a browser:
file:///home/pyiron/.local/share/jupyter/runtime/nbserver-6-open.html
Or copy and paste one of these URLs:
http://5137103405f0:8888/?token=9c4321f5e60c9ebe56e54d4eee89351ad3d5c432a1abe9d1
or http://127.0.0.1:8888/?token=9c4321f5e60c9ebe56e54d4eee89351ad3d5c432a1abe9d1
[I 00:37:01.046 NotebookApp] 302 GET /user/muhammad/ (172.17.0.5) 0.63ms
[I 00:37:01.366 NotebookApp] 302 GET /user/muhammad/ (172.17.0.5) 0.50ms
[W 00:37:01.587 NotebookApp] 404 GET /user/muhammad (172.17.0.5) 18.40ms
Has anyone any idea, what the reason for such an error could be?
Hey, @mhassani we ran into this too back in the day, try using 0.0.0.0 instead of 127.0.0.1 in your configs. Since the Notebook runs in a container the localhost address doesn’t resolve to the IPv4 address that corresponds to the docker container. Another trick for testing is to remove token auth with the NotebookApp.token='' setting. So if you test locally with docker run ... it would look something like docker run -d -p 8888:8888 jupyter/scipy-notebook:latest jupyter notebook --ip=.0.0.0.0 --port=8888 NotebookApp.token=''. With the JupyterHub it’s probably best to set up the configs using DockerSpawner instead of overriding the upstream default configs provided by the jupyter/docker-stacks images. I’m not as much of an expert or as experienced as the official maintaners, but it worked for us. Cheers.
Unfortunately, setting c.Jupyterhub.ip=‘0.0.0.0’ did not help. Is this what you meant?
I am actually using DockerSpawner with one of the images from jupyter/docker-stack. But still I am getting 404 error.
Here is a part of jupyterhub log:
Looks to me like your end-user container is starting up ok, the problem looks like a path issue with some customized react components. But that’s kind of a swag.
In jupyterhub_config.py, for authenticator class I changed from GenericOAuthenticator, which were set to get token from keycloak, to PAM authenticator as a test. With PAM single-user container were spawned. Therefore, I assume my configuration for keycloak oauth has not been correct. In below, you can find the details of the config:
There should be no requests to /static/anything, that means a misconfigured extension or base_url in the single-user server. I’m still trying to understand how this can happen.