jupyterhub / the-littlest-jupyterhub

Simple JupyterHub distribution for 1-100 users on a single server
https://tljh.jupyter.org
BSD 3-Clause "New" or "Revised" License
1.03k stars 340 forks source link

TLJH does not work after use a domain name nor enabling HTTPS #972

Closed AlbertoHerrera1 closed 6 months ago

AlbertoHerrera1 commented 6 months ago

Bug description

I’m trying to use TLJH on Compute engine VM from Google Cloud, everything is fine with (https://tljh.jupyter.org/en/latest/install/google.html) but, when I try to add HTTPS to my server, as said here (https://tljh.jupyter.org/en/latest/howto/admin/https.html), it get into a ERR_TOO_MANY_REDIRECTS error.

How to reproduce

Expected behaviour

When click in the link created with nbgitpuller i want to get redirected to the corresponding notebook.

Actual behaviour

Not getting redirected or just get stuck in login page.

Your personal set up

Some days ago I had a server running with this, also in Google Cloud, but suddenly it stopped worked, so i’m using a server with Ubutu 18.04.2 that i use for recovery porpuses, but i’ve tried with Ubuntu 20.04 LTS, Ubuntu 22.04 LTS and Ubuntu 23.10 but i can’t make them work with HTTPS enabled.

My domain provider was Google domains.

My firewall allows http and http in port tcp:80 and tcp:443

Full environment ``` # paste output of `pip freeze` or `conda list` here No other installations ```
Configuration ```python # jupyterhub_config.py No special configuration, just followed the instructions from instalation and enable https tutorials. ```
Logs Logs from traefik after enabling https. Mar 29 23:36:38 instance-20240329-202642 traefik[4190]: {"ClientAddr":"127.0.0.1:46152","ClientHost":"127.0.0.1","ClientPort":"46152","ClientUsername":"-","DownstreamContentSize":11,"Downstre> Mar 29 23:36:39 instance-20240329-202642 traefik[4190]: {"ClientAddr":"127.0.0.1:46156","ClientHost":"127.0.0.1","ClientPort":"46156","ClientUsername":"-","DownstreamContentSize":11,"Downstre> Mar 29 23:37:33 instance-20240329-202642 systemd[1]: Stopping traefik.service... Mar 29 23:37:33 instance-20240329-202642 traefik[4190]: time="2024-03-29T23:37:33Z" level=info msg="I have to go..." Mar 29 23:37:33 instance-20240329-202642 traefik[4190]: time="2024-03-29T23:37:33Z" level=info msg="Stopping server gracefully" Mar 29 23:37:33 instance-20240329-202642 traefik[4190]: time="2024-03-29T23:37:33Z" level=error msg="accept tcp [::]:443: use of closed network connection" entryPointName=https Mar 29 23:37:33 instance-20240329-202642 traefik[4190]: time="2024-03-29T23:37:33Z" level=error msg="Error while starting server: accept tcp [::]:443: use of closed network connection" entryP> Mar 29 23:37:33 instance-20240329-202642 traefik[4190]: time="2024-03-29T23:37:33Z" level=error msg="accept tcp 127.0.0.1:8099: use of closed network connection" entryPointName=auth_api Mar 29 23:37:33 instance-20240329-202642 traefik[4190]: time="2024-03-29T23:37:33Z" level=error msg="Error while starting server: accept tcp 127.0.0.1:8099: use of closed network connection" > Mar 29 23:37:33 instance-20240329-202642 traefik[4190]: time="2024-03-29T23:37:33Z" level=error msg="accept tcp [::]:80: use of closed network connection" entryPointName=http Mar 29 23:37:33 instance-20240329-202642 traefik[4190]: time="2024-03-29T23:37:33Z" level=error msg="Error while starting server: accept tcp [::]:80: use of closed network connection" entryPo> Mar 29 23:37:33 instance-20240329-202642 traefik[4190]: time="2024-03-29T23:37:33Z" level=warning msg="No domain found in rule PathPrefix(`/`), the TLS options applied for this router will de> Mar 29 23:37:33 instance-20240329-202642 traefik[4190]: time="2024-03-29T23:37:33Z" level=info msg="Server stopped" Mar 29 23:37:33 instance-20240329-202642 traefik[4190]: time="2024-03-29T23:37:33Z" level=info msg="Shutting down" Mar 29 23:37:33 instance-20240329-202642 systemd[1]: traefik.service: Deactivated successfully. Mar 29 23:37:33 instance-20240329-202642 systemd[1]: Stopped traefik.service. Mar 29 23:37:33 instance-20240329-202642 systemd[1]: traefik.service: Consumed 26.174s CPU time. Mar 29 23:37:33 instance-20240329-202642 systemd[1]: Started traefik.service. Mar 29 23:37:34 instance-20240329-202642 traefik[5125]: time="2024-03-29T23:37:34Z" level=info msg="Configuration loaded from file: /opt/tljh/state/traefik.toml" Mar 29 23:37:34 instance-20240329-202642 traefik[5125]: time="2024-03-29T23:37:34Z" level=info msg="Traefik version 2.10.1 built on 2023-04-27T14:52:35Z" Mar 29 23:37:34 instance-20240329-202642 traefik[5125]: time="2024-03-29T23:37:34Z" level=info msg="\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMor> Mar 29 23:37:34 instance-20240329-202642 traefik[5125]: time="2024-03-29T23:37:34Z" level=info msg="Starting provider aggregator aggregator.ProviderAggregator" Mar 29 23:37:34 instance-20240329-202642 traefik[5125]: time="2024-03-29T23:37:34Z" level=info msg="Starting provider *file.Provider" Mar 29 23:37:34 instance-20240329-202642 traefik[5125]: time="2024-03-29T23:37:34Z" level=info msg="Starting provider *traefik.Provider" Mar 29 23:37:34 instance-20240329-202642 traefik[5125]: time="2024-03-29T23:37:34Z" level=info msg="Starting provider *acme.Provider" Mar 29 23:37:34 instance-20240329-202642 traefik[5125]: time="2024-03-29T23:37:34Z" level=info msg="Testing certificate renew..." providerName=letsencrypt.acme ACME CA="https://acme-v02.api.l> Mar 29 23:37:34 instance-20240329-202642 traefik[5125]: time="2024-03-29T23:37:34Z" level=info msg="Starting provider *acme.ChallengeTLSALPN" Mar 29 23:37:35 instance-20240329-202642 traefik[5125]: time="2024-03-29T23:37:35Z" level=warning msg="No domain found in rule PathPrefix(`/`), the TLS options applied for this router will de> Mar 29 23:38:19 instance-20240329-202642 traefik[5125]: time="2024-03-29T23:38:19Z" level=warning msg="No domain found in rule ( PathPrefix(`/user/delfos/`) || Path(`/user/delfos`) ), the TLS> Mar 29 23:38:19 instance-20240329-202642 traefik[5125]: time="2024-03-29T23:38:19Z" level=warning msg="No domain found in rule PathPrefix(`/`), the TLS options applied for this router will de> Mar 29 23:39:32 instance-20240329-202642 traefik[5125]: {"ClientAddr":"177.240.141.239:3065","ClientHost":"177.240.141.239","ClientPort":"3065","ClientUsername":"-","DownstreamContentSize":11> Mar 29 23:39:32 instance-20240329-202642 traefik[5125]: {"ClientAddr":"127.0.0.1:59202","ClientHost":"127.0.0.1","ClientPort":"59202","ClientUsername":"-","DownstreamContentSize":11,"Downstre> Mar 29 23:39:33 instance-20240329-202642 traefik[5125]: {"ClientAddr":"127.0.0.1:59212","ClientHost":"127.0.0.1","ClientPort":"59212","ClientUsername":"-","DownstreamContentSize":11,"Downstre> Mar 29 23:47:35 instance-20240329-202642 traefik[5125]: time="2024-03-29T23:47:35Z" level=warning msg="A new release has been found: 2.11.0. Please consider updating." Mar 29 23:48:33 instance-20240329-202642 traefik[5125]: time="2024-03-29T23:48:33Z" level=warning msg="No domain found in rule PathPrefix(`/`), the TLS options applied for this router will de>
welcome[bot] commented 6 months ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

jrdnbradford commented 6 months ago

@AlbertoHerrera1 it's possible that this is fixed in version 1.2.1 of nbgitpuller: https://github.com/jupyterhub/nbgitpuller/releases/tag/1.2.1. You may also need to update JupyterHub to the latest, 4.1.4: https://github.com/jupyterhub/jupyterhub/releases/tag/4.1.4

AlbertoHerrera1 commented 6 months ago

Thanks @jrdnbradford for your response, i've done pip install --upgrade nbgitpuller and pip install --upgrade jupyterhub inside jupyterlab environment with an admin user so now i haver nbgitpuller==1.2.1 and jupyterhub==4.1.4, also i've restarted the serve but there's no change. maybe i have to upgrade the dependencies in other place?

jrdnbradford commented 6 months ago

@AlbertoHerrera1 might also require clearing your browser cache, that got me a few times!

AlbertoHerrera1 commented 6 months ago

Here's what has happened: Finally it works!!

By the time when I upgraded nbgitpuller and jupyterhub i had reboot the VM, but nothing changed, what did the trick was actually clearing the cache, then I tried again with a new VM and i realised it had the dependencies with the last version, also something that could help is that i reboot the new VM with the google cloud console, not with sudo reboot.

Thanks @jrdnbradford !!