-
Notifications
You must be signed in to change notification settings - Fork 357
Description
Description
base_url
is not respected in gateway clients specifically for kernels and kernelspecs. Furthermore, an old bug fix for logo requests (#1111 ) also appears to have been undone. I suspect that this bug may be related to #1219 as well but would need someone more experienced than myself to confirm or deny. Logs can be found in the Context section below.
To my knowledge, the only workaround today is to use two env vars, JUPYTER_GATEWAY_KERNELSPECS_ENDPOINT
and JUPYTER_GATEWAY_KERNELS_ENDPOINT
. This will not fix the logo requests bug, though the system is still functional.
I am happy to contribute to a fix and will have a PR forthcoming shortly.
Reproduce
- Download the two files at the end of this section.
- Start the base server first:
jupyter lab --config=jupyter_config-base.py
- Then start the second server:
jupyter lab --config=jupyter_config-gateway.py
- Track the errors from the the second server. Specifically it will throw 404s on every
kernel
andkernelspec
call. If you use your browser, it will also prevent you from choosing any kernel type so you can't proceed in running any notebook. Please see an example error log at the end of the Issue.
The logs from the running servers indicate that the base_url
is being processed correctly on the second server, but when the request gets forwarded to the base server, it does not add it, resulting in the 404.
jupyter_config-base.py
c.NotebookApp.open_browser = False
c.ServerApp.token = ""
c.ServerApp.password = ""
c.ServerApp.base_url = "/notebook/test"
c.ServerApp.port = 8887
c.Application.log_level = 0
jupyter_config-gateway.py
import json
c.NotebookApp.open_browser = True
c.ServerApp.token = ""
c.ServerApp.password = ""
c.ServerApp.base_url = "/notebook/test"
c.ServerApp.port = 8888
c.GatewayClient.headers = json.dumps({"Origin": PROXY_URL, "Cookie": "_xsrf=XSRF", "X-XSRFToken": "XSRF"})
c.GatewayClient.url = "http://localhost:8887"
c.Application.log_level = 0
Expected behavior
I expect the calls to properly redirect for seamless functionality. Based on my understanding of the base_url
functionality, it must match between the local and remote servers for other calls, so I would expect the same functionality here. If instead there is a different expectation, I am more than happy to be corrected.
Context
I hope the OS and browser versions don't matter, but for completeness, I'm running Chrome 139.0.7258.67 on Windows 11 and I can reproduce this bug with jupyter-server
as recent as 2.16.0 (the current version at the time of this issue).