I have a strange situation about accessing the Jupyterhub website. And i dont know how to solve this problem.
I open the 443 port and added ssl cert and key in the jupyterhub_config.py
After running jupyterhub, the website is accessable. The users will be redirected to the login Website. But after one moment, it is not accessable again. You have to wait for a while, until it is automatically accessable again. I also checked the process running on port 443, it indicates port 443 is still listening. Can some one help me please.
No, we will need JupyterHub logs. How did you deploy JupyterHub service?
If you have deployed JupyterHub as a systemd service, you can get the logs from journalctl -u <name_of_the_service>. If you have used docker/podman, you can get logs from docker/podman logs -f <name_of_container>.
There is nothing strange in the logs you posted. So, there are no logs between 14:18:05.320 and 14:22:18.237? If it is the case, I guess the issue is somewhere outside of JupyterHub, mostly on your edge. Maybe there is some firewall that is blocking the server?
i think the erro is from Traefik.
I used Certbot to generate SSL Certificat automatically in location /etc/letsencrypt/live/mydomain/fullchain.pem.
It works well for a while. And after one day, the Certificat is not available any more. See the logs of trafik:
Feb 28 17:56:01 gruppe-a systemd[1]: Stopping traefik.service…
Feb 28 17:56:01 gruppe-a traefik[63046]: time=“2024-02-28T17:56:01Z” level=info msg=“I have to go…”
Feb 28 17:56:01 gruppe-a traefik[63046]: time=“2024-02-28T17:56:01Z” level=info msg=“Stopping server gracefully”
Feb 28 17:56:01 gruppe-a traefik[63046]: time=“2024-02-28T17:56:01Z” level=error msg=“accept tcp [::]:443: use of closed network connection” entryPointName=https
Feb 28 17:56:01 gruppe-a traefik[63046]: time=“2024-02-28T17:56:01Z” level=error msg=“accept tcp 127.0.0.1:8099: use of closed network connection” entryPointName=auth_api
Feb 28 17:56:01 gruppe-a traefik[63046]: time=“2024-02-28T17:56:01Z” level=error msg=“accept tcp [::]:80: use of closed network connection” entryPointName=http
Feb 28 17:56:01 gruppe-a traefik[63046]: time=“2024-02-28T17:56:01Z” level=error msg=“Error while starting server: accept tcp [::]:80: use of closed network connection” entryPointName=http
Feb 28 17:56:01 gruppe-a traefik[63046]: time=“2024-02-28T17:56:01Z” level=error msg=“Error while starting server: accept tcp [::]:443: use of closed network connection” entryPointName=https
Feb 28 17:56:01 gruppe-a traefik[63046]: time=“2024-02-28T17:56:01Z” level=error msg=“close tcp 127.0.0.1:8099: use of closed network connection” entryPointName=auth_api
Feb 28 17:56:01 gruppe-a traefik[63046]: time=“2024-02-28T17:56:01Z” level=info msg=“Server stopped”
Feb 28 17:56:01 gruppe-a traefik[63046]: time=“2024-02-28T17:56:01Z” level=info msg=“Shutting down”
Feb 28 17:56:01 gruppe-a traefik[63046]: time=“2024-02-28T17:56:01Z” level=error msg="Error while creating certificate store: unable to find certificate for domains "xxxxx": falling back to t>
Feb 28 17:56:01 gruppe-a systemd[1]: traefik.service: Succeeded.
Feb 28 17:56:01 gruppe-a systemd[1]: Stopped traefik.service.
It sounds like the problem is with Traefik or Certbot and not JupyterHub. Some people on this forum may use Traefik, but if you don’t get an answer you may have more success if you ask on a Traefik forum instead.
Maybe it is still the problem of Jupyterhub?
Because if i use command curl -i to access my Domain, there is no problem. And i got the logs as follow. (there is nothing strange) It just redirects me to hub api.
I can´t figure out, where the problem happens, so I list the strange phenomenon I’ve run into and hopefully someone can find some trajectory.
Strange phenomenon:
open https url in browser is not possible. (but use curl -i is still no problem)
If you have already logged in, you can still loggout, loggin and start your single user server. You cann still create files in it. But you can´t connect to a kernel or open a Notebook.
If you have already logged in, you still can access to control panel, and start/stop user servers.
Can you open your browser console, and show us the full logs of a failed connection?
Are you able to connect directly to JupyterHub without using Traefik? If you can that implies the problem is with your Traefik configuration.
Also it sounds like you’re got two sets of letsencrypt certificates, one for JupyterHub and one for Traefik. That could be a problem, the letsencrypt certificates should be on the external proxy, so in this case Traefik.
It might be helpful if you shared your full JupyterHub and Traefik configurations.
Since I change to TLJH now, Traefik and Jupyterhub are not separated. And I can´t stop Traefik in this case. The problem still exists.
I don´t think, that I have two certs, because letsencrypt cert is generated by cerbot method. And I used tljh-cofig set command to enable the https url.
My config.yml of TLJH is like:
users:
admin:
admin
https:
enabled: true
letsencrypt:
email: my email
domains:
my domain name
And jupyterhub_config.py:
c = get_config() #noqa
c.JupyterHub.load_roles =
c.JupyterHub.load_groups = {
# collaborative accounts get added to this group
# so it’s easy to see which accounts are collaboration accounts
“collaborative”: ,
}
members = [‘student-a’,‘student-b’]
c.JupyterHub.load_groups[‘Collaborate-group’] = members
c.JupyterHub.load_roles.append(
{
“name”: “collab-access”,
“scopes”: [
“access:servers!user=shared-space”,
“admin:servers!user=shared-space”, ],
“groups”: [‘Collaborate-group’],
}
)
def pre_spawn_hook(spawner):
group_names = {group.name for group in spawner.user.groups}
if “collaborative” in group_names:
spawner.log.info(f"Enabling RTC for user {spawner.user.name}“)
spawner.args.append(”–LabApp.collaborative=True")
Is your browser configured to use a proxy, or is there a firewall somewhere? That browser error means there’s a DNS problem:
Are you sure you’ve removed all traces of your previous JupyterHub and Traefik installs? Is it possible something is still running, or there’s a configuration file left behind?