Dockerized JupyterHub runs, login works from console, but not in front end

How to get past login on a fresh install of Jupyterhub inside Docker container?

I created a fresh Docker container of jupyterhub image, run bash, added users, installed jupyterlab and launched it.

My admin user appears to log in but front end does not proceed.

Host Server:

$ lsb_release -a
Ubuntu 18.04.6 LTS

$ docker --version
 Docker version 23.0.1, build a5ee5b1

$ sudo docker run -it -p 8040:8040 --name jupyterhub jupyterhub/jupyterhub bash

Only change from default has been port to 8040

Inside container:

apt update
apt upgrade
apt install nano
 pip install jupyterlab
 useradd hubadmin
 passwd hubadmin
 jupyterhub --generate-config
 nano jupyterhub_config.py

Added users hubadmin and vs to c.Authenticator.admin_users = set([‘hubadmin’,‘vs’])
Saved jupyterhub_config.py

Started jupyterhub (still inside Docker container)

jupyterhub --port=8040

I can see standard jupyterhub login at mydomain.com:8040 - accessed from a Windows computer on the same network.

Unfortunately I stay at login page even after successful entry of username and password

Console shows that login was successful:

12:17:16.298 [ConfigProxy] info: 200 GET /api/routes
[I 2023-04-05 12:17:16.298 JupyterHub proxy:477] Adding route for Hub: / => http://127.0.0.1:8081
12:17:16.304 [ConfigProxy] info: Adding route / -> http://127.0.0.1:8081
12:17:16.307 [ConfigProxy] info: Route added / -> http://127.0.0.1:8081
12:17:16.309 [ConfigProxy] info: 201 POST /api/routes/
[I 2023-04-05 12:17:16.309 JupyterHub app:3197] JupyterHub is now running at http://:8040/
[I 2023-04-05 12:17:25.455 JupyterHub log:186] 302 GET / -> /hub/ (@::ffff:10.128.4.140) 1.93ms
[I 2023-04-05 12:17:25.479 JupyterHub log:186] 302 GET /hub/ -> /hub/login?next=%2Fhub%2F (@::ffff:10.128.4.140)
[I 2023-04-05 12:17:25.573 JupyterHub log:186] 200 GET /hub/login?next=%2Fhub%2F (@::ffff:10.128.4.140) 74.07ms
[I 2023-04-05 12:17:31.512 JupyterHub base:819] User logged in: hubadmin
[I 2023-04-05 12:17:31.513 JupyterHub log:186] 302 POST /hub/login?next=%2Fhub%2F -> /hub/ (hubadmin@::ffff:10.12
) 158.37ms
[I 2023-04-05 12:17:31.538 JupyterHub log:186] 302 GET /hub/ -> /hub/login?next=%2Fhub%2F (@::ffff:10.128.4.140)
[I 2023-04-05 12:17:31.558 JupyterHub log:186] 200 GET /hub/login?next=%2Fhub%2F (@::ffff:10.128.4.140) 3.81ms
[I 2023-04-05 12:17:38.400 JupyterHub base:819] User logged in: vs
[I 2023-04-05 12:17:38.402 JupyterHub log:186] 302 POST /hub/login?next=%2Fhub%2F -> /hub/ (vs@::ffff:10.128.4.14
30ms
[I 2023-04-05 12:17:38.437 JupyterHub log:186] 302 GET /hub/ -> /hub/login?next=%2Fhub%2F (@::ffff:10.128.4.140)
[I 2023-04-05 12:17:38.467 JupyterHub log:186] 200 GET /hub/login?next=%2Fhub%2F (@::ffff:10.128.4.140) 4.34ms

It appears the redirect is somehow failing .

What steps should I try?

PS Have been running TLJH for 3 years for my institution on this same server. At the time of my Dockerization attempt TLJH was still active on Host - accessible through regular 80,443 ports.
PSS Host Server is on the intranet - that is domain is only accessible within institution

Have you tried jupyterhub-deploy-docker/basic-example at main · jupyterhub/jupyterhub-deploy-docker · GitHub ?

1 Like

manics thanks for the tip!

Cloned the GitHub - jupyterhub/jupyterhub-deploy-docker: Reference deployment of JupyterHub with docker

Upgraded docker-compose to latest -
Docker Compose version v2.17.2

I started the basic example with
docker-compose up -d

Still the same issue, I can create new users, but no user is able to get past login.

If I supply bad password or user I get the appropriate message - Invalid username or password.

Problem is that if I supply correct username/password combo I do not see any message just the login screen again

This is again on intrnet for myorganization.lv:8000 over HTTP - nothing has been changed in the basic example

Update: The login worked on the same computer using latest version of Firefox: 112.0 (64-bit)

Using latest Chrome: Version 111.0.5563.147 (Official Build) (64-bit)
is the problem child - login appears correct in logs (from sudo docker logs jupyterhub) but you get forwarded to the same login screen.

Update2: The login also works in incognito mode of Chrome.

The normal mode of Chrome has been used extensively for JupyterHub on lab.myorganization.lv

Therefore the problem appears to be some sort of caching of login credentials.

Unfortunately emptying the cache and hard reload: clear cache for specific website in Google chrome - Google Chrome Community

did not solve the issue.

1 Like

I don’t recommend using port 8000 in your browser. I would use 443 and then proxy that to 8000. Capture the network activity in DevTools and make sure all the ports are being added correctly.

1 Like