jupyterhub-docker icon indicating copy to clipboard operation
jupyterhub-docker copied to clipboard

404 page not found

Open Hanuth opened this issue 5 years ago • 4 comments

I have tried to implement this setup. But when I start the environment, I always get "404 page not found" when I try to reach jupyterhub. Both containers, trafik and jupyterhub are running though. It seems like traefik is not recognizing the jupyterhub container.

Do you have any suggestions?

Hanuth avatar Jul 15 '19 12:07 Hanuth

Did you mount the docker socket properly, here: https://github.com/defeo/jupyterhub-docker/blob/5bf2ab2c2184d73399edecf935ab300f431e1d2b/docker-compose.yml#L38

The path may be dependent on your local docker installation.

defeo avatar Jul 15 '19 14:07 defeo

If you go to the traefik dashboard, you want to see something like this in the "Backends":

Screenshot_2019-07-15 Traefik

which shows that Traefik has detected the Jupyterhub container. If the lables are set properly, something like this should show up in the "Frontends":

Screenshot_2019-07-15 Traefik(1)

defeo avatar Jul 15 '19 14:07 defeo

I was able to solve this issue on my localhost by setting HOST (in .env) to 127.0.0.1, and then navigating in my browser to http://127.0.0.1. When visiting http://localhost, I see this 404 message again, but it works fine if I visit http://127.0.0.1.

Unfortunately, however, when I deployed this up to an EC2 instance, I'm now encountering this issue again, and I cannot seem to find anyway around it. I've set HOST to my domain name, and also tried setting it to the IP of the server, to localhost, to 127.0.0.1 -- nothing seems to work.

I also can't, for the life of me, access the traefik dashboard on the EC2 instance. On my localhost, I just visit http://127.0.0.1:8080 in a browser. However, on the EC2 instance -- by which I mean, even if I ssh into the server and run wget 127.0.0.1:8080 -- I just get a read error / connection reset by peer. I even tried tunneling that port onto my localhost just to be sure, and same issue.

Any thoughts on possible debugging steps?

dccannon avatar Aug 16 '19 02:08 dccannon

I got to the bottom of it! When running docker-compose on a remote host (with docker-compose -H "user@host"), it was unable to find the traefik config. Solved by copying the config onto the remote host at /etc/traefik and then updating docker-compose.yml:

-      - ./reverse-proxy/traefik.toml:/etc/traefik/traefik.toml
+      - /etc/traefik/traefik.toml:/etc/traefik/traefik.toml

dccannon avatar Aug 16 '19 02:08 dccannon