jupyterhub and dockerspawner redirect loop

455 views
Skip to first unread message

Eric Dennison

unread,
May 6, 2017, 1:53:59 PM5/6/17
to Project Jupyter
I am experimenting with jupyterhub and dockerspawner with Google oauth for login, all behind an Nginx proxy for ssh.

Without dockerspawner, and using PAM authentication, everything works beautifully. Google Oauth appears to be working nicely, too, but with dockerspawner enabled I press the green "Start My Server" button and quickly see: ERR_TOO_MANY_REDIRECTS in the browser. On the jupyterhub console I am seeing the following, repeated over and over:

[W 2017-05-06 17:38:56.637 JupyterHub pages:42] Redirecting /hub/?next=%2Fuser%2Feric.dennison%2Ftree%3F to /hub/user/eric.dennison/tree?. For sharing public links, use /user-redirect/
[I 2017-05-06 17:38:56.643 JupyterHub log:100] 302 GET /hub/?next=%2Fuser%2Feric.dennison%2Ftree%3F (eric.dennison@162.246.193.162) 1.84ms
[I 2017-05-06 17:38:56.723 JupyterHub log:100] 302 GET /hub/user/eric.dennison/tree? (eric.dennison@162.246.193.162) 17.55ms

There is a docker container running, as I can see with:

6d1e4fb10fc1        jupyterhub/singleuser   "tini -- sh /usr/l..."   About an hour ago   Up 10 minutes       127.0.0.1:32790->8888/tcp   jupyter-eric_2Edennison


Unfortunately, I have no experience with docker and am unsure about what else I ought to be looking at.

The jupyterhub config:

## Configuration for dockerspawner
c
.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
c
.DockerSpawner.container_image = "jupyter/singleuser"
from jupyter_client.localinterfaces import public_ips
c
.JupyterHub.hub_ip = public_ips()[0]


## Configuration for Google oauth
import os
c
.GoogleOAuthenticator.client_id = os.environ['OAUTH_CLIENT_ID']
c
.GoogleOAuthenticator.client_secret = os.environ['OAUTH_CLIENT_SECRET']
c
.GoogleOAuthenticator.oauth_callback_url = os.environ['OAUTH_CALLBACK_URL']


c
.JupyterHub.authenticator_class = 'oauthenticator.GoogleOAuthenticator'
c
.GoogleOAuthenticator.hosted_domain = '<my hosted domain.org>'
c
.GoogleOAuthenticator.login_service = '<my organization>'

I'm very fuzzy about docker. What do I have to do if I want to customize the configuration of the notebook server that lives in the container?

Thanks for any tips!

-Eric

Adam Thornton

unread,
May 7, 2017, 1:27:31 AM5/7/17
to Project Jupyter
When I get the too many redirects with Kubespawner it means that the back end is running but doesn't have the token the front end is expecting. Make sure you are passing the right API token to the spawned container. I haven't used Dockerspawner though, so this guess could be completely wrong.
Message has been deleted
Message has been deleted

Eric Dennison

unread,
May 7, 2017, 12:15:20 PM5/7/17
to Project Jupyter
I should note that I mis-copied one of the config lines. It should be:

c.DockerSpawner.container_image = "jupyterhub/singleuser"
Reply all
Reply to author
Forward
0 new messages