Skip to content

hub_routespec set via values.yaml doesn't apply correctly — shows "Launch Server" page instead of 404 #3686

@uqqasha-pmx

Description

@uqqasha-pmx

Bug description

Setting hub.config.JupyterHub.hub_routespec: "/hub/" via Helm values.yaml in a z2jh v4.2.0 deployment does not behave as expected. Instead of returning a 404 page for requests to stopped user servers, it redirects to the Hub and shows the "Launch Server" UI.

However, when the same setting is applied by manually editing the hub ConfigMap and restarting the Hub pod, the behavior is correct and a 404 is returned as expected.

How to reproduce

  1. Create a values.yaml file containing:
hub:
  config:
    JupyterHub:
      hub_routespec: "/hub/"
  1. Deploy JupyterHub using Helm.
  2. Start a user server, then stop it.
  3. Try to access /user/<username>/... in the browser.

Expected behaviour

A 404 page should appear from the proxy, since hub_routespec is set to /hub/ and the user's server is not running. See: https://jupyterhub.readthedocs.io/en/5.3.0/howto/api-only.html#disabling-hub-ui

Actual behaviour

JupyterHub redirects to /hub/user/<username>/... and shows the "Your server is not running. Would you like to start it?" message with a "Launch Server" button — the same behavior as if hub_routespec had never been customized.

Your personal set up

  • OS: OpenShift 4.17
  • Helm Chart Version: 4.2.0
  • Spawner: KubeSpawner
  • Authenticator: GenericOAuthenticator (with Keycloak)

We also tested applying c.JupyterHub.hub_routespec = "/hub/" via jupyterhub_config.py and via extraConfig, and neither worked. The only working method was manually editing the Hub's ConfigMap and restarting the pod.

Logs
[W 2025-06-02 18:19:02.321 JupyterHub app:1146] Using custom route for Hub: /hub/. Requests for not-running servers may not be handled.
....
[I 2025-06-02 18:19:02.752 JupyterHub app:3711] Not starting proxy
[D 2025-06-02 18:19:02.752 JupyterHub proxy:925] Proxy: Fetching GET http://proxy-api:8001/api/routes
[D 2025-06-02 18:19:02.773 JupyterHub proxy:996] Omitting non-jupyterhub route '/'
[I 2025-06-02 18:19:02.774 JupyterHub app:3747] Hub API listening on http://:8081/hub/
[I 2025-06-02 18:19:02.774 JupyterHub app:3749] Private Hub API connect url http://hub:8081/hub/
[I 2025-06-02 18:19:02.774 JupyterHub app:3623] Starting managed service jupyterhub-idle-culler
[I 2025-06-02 18:19:02.774 JupyterHub service:423] Starting service 'jupyterhub-idle-culler': ['python3', '-m', 'jupyterhub_idle_culler', '--url=http://localhost:8081/hub/api', '--timeout=120', '--cull-every=30', '--concurrency=10', '--cull-users', '--cull-admin-users=false', '--remove-named-servers']
[I 2025-06-02 18:19:02.776 JupyterHub service:136] Spawning python3 -m jupyterhub_idle_culler --url=http://localhost:8081/hub/api --timeout=120 --cull-every=30 --concurrency=10 --cull-users --cull-admin-users=false --remove-named-servers
[D 2025-06-02 18:19:02.777 JupyterHub spawner:1693] Polling subprocess every 30s
[D 2025-06-02 18:19:02.777 JupyterHub proxy:389] Fetching routes to check
[D 2025-06-02 18:19:02.777 JupyterHub proxy:925] Proxy: Fetching GET http://proxy-api:8001/api/routes
[D 2025-06-02 18:19:02.780 JupyterHub proxy:996] Omitting non-jupyterhub route '/'
[D 2025-06-02 18:19:02.780 JupyterHub proxy:392] Checking routes
[I 2025-06-02 18:19:02.780 JupyterHub proxy:477] Adding route for Hub: /hub/ => http://hub:8081
[D 2025-06-02 18:19:02.780 JupyterHub proxy:925] Proxy: Fetching POST http://proxy-api:8001/api/routes/hub
[I 2025-06-02 18:19:02.839 JupyterHub app:3780] JupyterHub is now running, internal Hub API at http://hub:8081/hub/
[D 2025-06-02 18:19:02.840 JupyterHub app:3347] It took 1.004 seconds for the Hub to start
Despite logs indicating correct route setup, the actual behavior remains incorrect unless applied manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions