I’m encountering an issue while configuring JupyterHub with Nginx as a reverse proxy. I am receiving the following error:
[W 2024-09-04 15:28:50.914 JupyterHub proxy:944] api_request to the proxy failed with status code 599, retrying...
[E 2024-09-04 15:28:50.914 JupyterHub app:3873]
Traceback (most recent call last):
File "D:\Simsight\envs\labenv\lib\site-packages\jupyterhub\app.py", line 3871, in launch_instance_async
await self.start()
File "D:\Simsight\envs\labenv\lib\site-packages\jupyterhub\app.py", line 3658, in start
await self.proxy.get_all_routes()
File "D:\Simsight\envs\labenv\lib\site-packages\jupyterhub\proxy.py", line 989, in get_all_routes
resp = await self.api_request('', client=client)
File "D:\Simsight\envs\labenv\lib\site-packages\jupyterhub\proxy.py", line 953, in api_request
result = await exponential_backoff(
File "D:\Simsight\envs\labenv\lib\site-packages\jupyterhub\utils.py", line 265, in exponential_backoff
raise asyncio.TimeoutError(fail_message)
asyncio.exceptions.TimeoutError: Repeated api_request to proxy path "" failed.
Here is the JupyterHub configuration I have modified:
Hi Minrk,
I have tried the same configuration on a CentOS 7 machine but encountered the following error:
W 2024-09-05 15:00:30.051 JupyterHub proxy:944] api_request to the proxy failed with status code 599, retrying...
[E 2024-09-05 15:00:30.052 JupyterHub app:3873]
Traceback (most recent call last):
File "/root/mambaenvs/hubenv/lib/python3.9/site-packages/jupyterhub/app.py", line 3871, in launch_instance_async
await self.start()
File "/root/mambaenvs/hubenv/lib/python3.9/site-packages/jupyterhub/app.py", line 3658, in start
await self.proxy.get_all_routes()
File "/root/mambaenvs/hubenv/lib/python3.9/site-packages/jupyterhub/proxy.py", line 989, in get_all_routes
resp = await self.api_request('', client=client)
File "/root/mambaenvs/hubenv/lib/python3.9/site-packages/jupyterhub/proxy.py", line 953, in api_request
result = await exponential_backoff(
File "/root/mambaenvs/hubenv/lib/python3.9/site-packages/jupyterhub/utils.py", line 265, in exponential_backoff
raise asyncio.TimeoutError(fail_message)
asyncio.exceptions.TimeoutError: Repeated api_request to proxy path "" failed.
Here are the changes I made to the JupyterHub configuration:
I have tried leaving c.ConfigurableHTTPProxy.api_url empty (c.ConfigurableHTTPProxy.api_url = '') and also commented out the configuration (#c.ConfigurableHTTPProxy.api_url), but I am still encountering the same error.
I mean configurable-http-proxy. How are you starting it? You’ve set c.ConfigurableHTTPProxy.should_start = False, which means you are running CHP yourself somewhere else instead of letting JupyterHub start it. How are you launching configurable-http-proxy?
CHP is not any generic reverse proxy. It is a specific component of JupyterHub that keeps track of routing table of the JupyterHub. So, you cannot swap CHP with nginx.
If you have issues with CHP, there is an alternative traefik proxy which you can use.