Open abashkinas opened 4 years 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.
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:
Please encapsulate your code into backticks (`) so that they are formatted appropriately. You can just edit your old entry.
As we can see in the logs, the error message stems from Jinja and it seems pretty awkward to me. I am not deeply rooted in the projects though. Have you tried running a debugger as described in https://code.visualstudio.com/docs/python/debugging to see what the template engine tries to do before it dies and creates problems for you?
This doesn't so much seem to be a problem with JupyterHub or the dockerspawner, but more with your nginx configuration. I would suggest that you direct these questions to https://discourse.jupyter.org which is a most welcoming forum.
As for your issue: JupyterHub will do a redirect to /hub
if you hit it at the base path /
, as indicated by the logs:
jupyter_hub.1.vkcroo6bu1zt@swarm_manager | [I 2020-08-18 12:25:55.101 JupyterHub log:181] 302 GET / -> /hub/ (@172.18.207.29) 0.97ms
jupyter_hub.1.vkcroo6bu1zt@swarm_manager | [I 2020-08-18 12:25:55.106 JupyterHub log:181] 302 GET /hub/ -> /hub/login (@172.18.207.29) 0.66ms
And the recursion limit being reached:
jupyter_hub.1.ry6cazaavyrc@swarm_manager | RecursionError: maximum recursion depth exceeded
Maybe try to stop nginx from also trying to do the redirection by adding to your location configuration:
location / {
[... the other configuration ...]
proxy_redirect off;
[... the other configuration ...]
}
I've managed to run several JupyterHubs inside Docker container. I've set my nginx as followed:
location / {
proxy_pass https://127.0.0.1:8000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-NginX-Proxy true;
# websocket headers
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Scheme $scheme;
proxy_buffering off;
}
location ~* /(user/[^/]*)/(api/kernels/[^/]+/channels|terminals/websocket)/? {
proxy_pass https://127.0.0.1:8000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-NginX-Proxy true;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade "websocket";
#proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
proxy_set_header X-Scheme $scheme;
proxy_buffering off;
}
Bug description
Hello, I have started jupyterhub as a service in dockerswarm. Without nginx reverse proxy it works without problems. When I configure nginx reverse proxy with the following configuration:
The following messages begin to appear in the jupyterhub logs:
After a few hours jupyterhub stops working and has the following error in its logs:
Please help me solve the problem.
Dockerfile jupyterhub:
jupyterhub_config.py:
config docker swarm service:
Expected behaviour
Correct work with nginx reverse proxy
Actual behaviour
Jupyterhub stops working
How to reproduce
Your personal set up