500 : Internal Server Error Redirect loop detected

Hi,

I need help trying to determine the issue causing “500 : Internal Server Error
Redirect loop detected”.

Installed Anaconda on an Ubuntu Server VM. I’m able to use Jupyter notebooks on the host running the VM using SSH tunneling:

ssh -N -f -L localhost:8888:localhost:8888 administrator@127.0.0.1 -p 999

I installed JupyterHub using the administrator user (same as Anaconda). i generated a config but made no changes. I start JupyterHub:

jupyterhub --no-ssl -f jupyterhub_config.py

and tunnel using:

ssh -N -f -L localhost:8081:localhost:8081 administrator@127.0.0.1 -p 999

I am able to sign on to JuyterHub using the Ubuntu user “administrator”. The server appears to be starting but then I get:

“500 : Internal Server Error Redirect loop detected”.

The console follows. Any suggestions appreciated!

[I 2022-07-19 15:06:10.367 JupyterHub users:744] Server administrator is ready
[I 2022-07-19 15:06:10.368 JupyterHub log:189] 200 GET /hub/api/users/administrator/server/progress (administrator@127.0.0.1) 3010.60ms
[I 2022-07-19 15:06:10.394 JupyterHub log:189] 302 GET /hub/spawn-pending/administrator → /user/administrator/ (administrator@127.0.0.1) 7.18ms
[I 2022-07-19 15:06:10.404 JupyterHub log:189] 302 GET /user/administrator/ → /hub/user/administrator/ (@127.0.0.1) 2.52ms
[I 2022-07-19 15:06:10.416 JupyterHub log:189] 302 GET /hub/user/administrator/ → /user/administrator/?redirects=1 (administrator@127.0.0.1) 2.11ms
[I 2022-07-19 15:06:10.426 JupyterHub log:189] 302 GET /user/administrator/?redirects=1 → /hub/user/administrator/?redirects=1 (@127.0.0.1) 2.62ms
[W 2022-07-19 15:06:10.431 JupyterHub base:1626] Redirect loop detected on /hub/user/administrator/?redirects=1
[I 2022-07-19 15:06:12.434 JupyterHub log:189] 302 GET /hub/user/administrator/?redirects=1 → /user/administrator/?redirects=2 (administrator@127.0.0.1) 2004.48ms
[I 2022-07-19 15:06:12.446 JupyterHub log:189] 302 GET /user/administrator/?redirects=2 → /hub/user/administrator/?redirects=2 (@127.0.0.1) 2.60ms
[W 2022-07-19 15:06:12.452 JupyterHub base:1626] Redirect loop detected on /hub/user/administrator/?redirects=2
[I 2022-07-19 15:06:16.455 JupyterHub log:189] 302 GET /hub/user/administrator/?redirects=2 → /user/administrator/?redirects=3 (administrator@127.0.0.1) 4004.12ms
[I 2022-07-19 15:06:16.460 JupyterHub log:189] 302 GET /user/administrator/?redirects=3 → /hub/user/administrator/?redirects=3 (@127.0.0.1) 0.58ms
[W 2022-07-19 15:06:16.464 JupyterHub base:1626] Redirect loop detected on /hub/user/administrator/?redirects=3
[I 2022-07-19 15:06:16.707 JupyterHub log:189] 302 GET /user/administrator/ → /hub/user/administrator/ (@127.0.0.1) 0.96ms
[I 2022-07-19 15:06:16.734 JupyterHub log:189] 302 GET /hub/user/administrator/ → /user/administrator/?redirects=1 (administrator@127.0.0.1) 18.68ms
[I 2022-07-19 15:06:16.740 JupyterHub log:189] 302 GET /user/administrator/?redirects=1 → /hub/user/administrator/?redirects=1 (@127.0.0.1) 2.22ms
[W 2022-07-19 15:06:16.751 JupyterHub base:1626] Redirect loop detected on /hub/user/administrator/?redirects=1
[I 2022-07-19 15:06:18.756 JupyterHub log:189] 302 GET /hub/user/administrator/?redirects=1 → /user/administrator/?redirects=2 (administrator@127.0.0.1) 2008.63ms
[I 2022-07-19 15:06:18.764 JupyterHub log:189] 302 GET /user/administrator/?redirects=2 → /hub/user/administrator/?redirects=2 (@127.0.0.1) 0.58ms
[W 2022-07-19 15:06:18.772 JupyterHub base:1626] Redirect loop detected on /hub/user/administrator/?redirects=2
[I 2022-07-19 15:06:22.790 JupyterHub log:189] 302 GET /hub/user/administrator/?redirects=2 → /user/administrator/?redirects=3 (administrator@127.0.0.1) 4023.67ms
[I 2022-07-19 15:06:22.803 JupyterHub log:189] 302 GET /user/administrator/?redirects=3 → /hub/user/administrator/?redirects=3 (@127.0.0.1) 2.66ms
[W 2022-07-19 15:06:22.814 JupyterHub base:1626] Redirect loop detected on /hub/user/administrator/?redirects=3
[I 2022-07-19 15:06:24.466 JupyterHub log:189] 302 GET /hub/user/administrator/?redirects=3 → /user/administrator/?redirects=4 (administrator@127.0.0.1) 8003.48ms
[I 2022-07-19 15:06:30.817 JupyterHub log:189] 302 GET /hub/user/administrator/?redirects=3 → /user/administrator/?redirects=4 (administrator@127.0.0.1) 8008.16ms
[I 2022-07-19 15:06:30.826 JupyterHub log:189] 302 GET /user/administrator/?redirects=4 → /hub/user/administrator/?redirects=4 (@127.0.0.1) 2.55ms
[W 2022-07-19 15:06:30.832 JupyterHub web:1787] 500 GET /hub/user/administrator/?redirects=4 (127.0.0.1): Redirect loop detected.

Hi, can anyone help me with what kinds of issues might cause this or what this message means or what things I could check? Maybe I can debug it?
Thanks!

Port 8081 is used for the internal JupyterHub API. Can you try connecting on port 8000 instead?

2 Likes

That’s it! Thanks so much for your help

1 Like