Hello, I’ve recently started a position responsible for a JupyterHub installation as part of an HPC environment; the old team left without leaving much in the way of documentation, and I’ve never worked on JupyterHub before, so please bear with me.
When launching JupyterHub, the system will stay on the page “Your server is starting up. You will be redirected automatically when it’s ready for you. Spawning server…” for as long as the value of c.Spawner.start_timeout is configured.
[root] # /hpc/project/projwork47/pyjup/sboxtest/bin/python3.1 /hpc/project/projwork47/pyjup/sboxtest/bin/jupyterhub --version
3.0.0
This is the output of starting jupyterhub from the command line, then trying to connect from the browser:
[root] # /hpc/project/projwork47/pyjup/sboxtest/bin/python3.1 /hpc/project/projwork47/pyjup/sboxtest/bin/jupyterhub --debug -f /hpc/project/projwork47/pyjup/sboxtest/etc/jupyterhub_config.py
[D 2023-12-05 15:25:43.094 JupyterHub application:902] Looking for /hpc/project/projwork47/pyjup/sboxtest/etc/jupyterhub_config in /hpc/project/projwork47/pyjup/sboxtest/bin
[D 2023-12-05 15:25:43.096 JupyterHub application:923] Loaded config file: /hpc/project/projwork47/pyjup/sboxtest/etc/jupyterhub_config.py
[INFO] [JupyterHub] Running JupyterHub version 3.0.0
[INFO] [JupyterHub] Using Authenticator: jupyterhub.auth.PAMAuthenticator-3.0.0
[INFO] [JupyterHub] Using Spawner: systemdspawner.systemdspawner.SystemdSpawner
[INFO] [JupyterHub] Using Proxy: jupyterhub.proxy.ConfigurableHTTPProxy-3.0.0
[INFO] [JupyterHub] Loading cookie_secret from /hpc/project/projwork47/pyjup/sboxtest/etc/jupyterhub_cookie_secret
[DEBUG] [JupyterHub] Connecting to db: sqlite:///jupyterhub.sqlite
[DEBUG] [JupyterHub] database schema version found: 651f5419b74d
[INFO] [JupyterHub] Generating new CONFIGPROXY_AUTH_TOKEN
[DEBUG] [JupyterHub] Loading roles into database
[DEBUG] [JupyterHub] Purging expired APITokens
[DEBUG] [JupyterHub] Purging expired OAuthCodes
[DEBUG] [JupyterHub] Loading role assignments from config
[DEBUG] [JupyterHub] Assigning 17 allowed_users to the user role
[DEBUG] [JupyterHub] Initializing spawners
[DEBUG] [JupyterHub] Loaded users:
[INFO] [JupyterHub] Initialized 0 spawners in 0.006 seconds
[INFO] [JupyterHub] Starting proxy @ https://0.0.0.0:443/
[DEBUG] [JupyterHub] Proxy cmd: ['configurable-http-proxy', '--ip', '0.0.0.0', '--port', '443', '--api-ip', '127.0.0.1', '--api-port', '8001', '--error-target', 'http://127.0.0.1:8081/hub/error', '--log-level', 'info', '--ssl-key', '/hpc/project/projwork47/pyjup/sboxtest/ssl/ssl.key', '--ssl-cert', '/hpc/project/projwork47/pyjup/sboxtest/ssl/ssl.crt']
[DEBUG] [JupyterHub] Writing proxy pid file: jupyterhub-proxy.pid
15:25:43.846 [ConfigProxy] info: Proxying https://0.0.0.0:443 to (no default)
15:25:43.851 [ConfigProxy] info: Proxy API at http://127.0.0.1:8001/api/routes
[DEBUG] [JupyterHub] Proxy started and appears to be up
[DEBUG] [JupyterHub] Proxy: Fetching GET http://127.0.0.1:8001/api/routes
[INFO] [JupyterHub] Hub API listening on http://127.0.0.1:8081/hub/
[DEBUG] [JupyterHub] Fetching routes to check
15:25:44.408 [ConfigProxy] info: 200 GET /api/routes
[DEBUG] [JupyterHub] Proxy: Fetching GET http://127.0.0.1:8001/api/routes
15:25:44.410 [ConfigProxy] info: 200 GET /api/routes
[DEBUG] [JupyterHub] Checking routes
[INFO] [JupyterHub] Adding route for Hub: / => http://127.0.0.1:8081
[DEBUG] [JupyterHub] Proxy: Fetching POST http://127.0.0.1:8001/api/routes/
15:25:44.412 [ConfigProxy] info: Adding route / -> http://127.0.0.1:8081
15:25:44.412 [ConfigProxy] info: Route added / -> http://127.0.0.1:8081
15:25:44.413 [ConfigProxy] info: 201 POST /api/routes/
[INFO] [JupyterHub] JupyterHub is now running at https://0.0.0.0:443/
[DEBUG] [JupyterHub] It took 1.325 seconds for the Hub to start
[DEBUG] [JupyterHub] Refreshing auth for m5573
[DEBUG] [JupyterHub] Checking access via scope servers
[DEBUG] [JupyterHub] Unrestricted access to /hub/spawn-pending/m5573 via servers
[DEBUG] [JupyterHub] Creating <class 'systemdspawner.systemdspawner.SystemdSpawner'> for m5573:
[DEBUG] [JupyterHub] user:m5573 Initialized spawner with unit jupyter-m5573-singleuser
[INFO] [JupyterHub] 200 GET /hub/spawn-pending/m5573 (m5573@10.144.0.27) 36.47ms
[DEBUG] [JupyterHub] 200 GET /hub/static/js/not_running.js?v=20231205152543 (@10.144.0.27) 1.79ms
[DEBUG] [JupyterHub] 200 GET /hub/static/js/utils.js?v=20231205152543 (@10.144.0.27) 1.37ms
[DEBUG] [JupyterHub] Checking access via scope servers
[DEBUG] [JupyterHub] Unrestricted access to /hub/spawn/m5573 via servers
[DEBUG] [JupyterHub] Triggering spawn with default options for m5573
[DEBUG] [JupyterHub] Initiating spawn for m5573
[DEBUG] [JupyterHub] 1/100 concurrent spawns
[DEBUG] [JupyterHub] 1/4 active servers
[INFO] [JupyterHub] Creating oauth client jupyterhub-user-m5573
[DEBUG] [JupyterHub] Calling Spawner.start for m5573
[DEBUG] [JupyterHub] user:m5573 Using port 60473 to start spawning user server
[INFO] [JupyterHub] user:m5573 Unit jupyter-m5573-singleuser in a failed state. Resetting state.
Running as unit: jupyter-m5573-singleuser.service
[INFO] [JupyterHub] 302 GET /hub/spawn/m5573 -> /hub/spawn-pending/m5573 (m5573@10.144.0.27) 1004.59ms
[DEBUG] [JupyterHub] Checking access via scope servers
[DEBUG] [JupyterHub] Unrestricted access to /hub/spawn-pending/m5573 via servers
[INFO] [JupyterHub] m5573 is pending spawn
[INFO] [JupyterHub] 200 GET /hub/spawn-pending/m5573 (m5573@10.144.0.27) 13.87ms
[DEBUG] [JupyterHub] Checking access via scope read:servers
[DEBUG] [JupyterHub] Unrestricted access to /hub/api/users/m5573/server/progress via read:servers
[WARNING] [JupyterHub] User m5573 is slow to start (timeout=10)
[DEBUG] [JupyterHub] Proxy: Fetching GET http://127.0.0.1:8001/api/routes
15:30:44.416 [ConfigProxy] info: 200 GET /api/routes
[DEBUG] [JupyterHub] Checking routes
[DEBUG] [JupyterHub] Proxy: Fetching GET http://127.0.0.1:8001/api/routes
15:35:44.416 [ConfigProxy] info: 200 GET /api/routes
[DEBUG] [JupyterHub] Checking routes
[DEBUG] [JupyterHub] Proxy: Fetching GET http://127.0.0.1:8001/api/routes
15:40:44.415 [ConfigProxy] info: 200 GET /api/routes
[DEBUG] [JupyterHub] Checking routes
[DEBUG] [JupyterHub] Proxy: Fetching GET http://127.0.0.1:8001/api/routes
15:45:44.416 [ConfigProxy] info: 200 GET /api/routes
[DEBUG] [JupyterHub] Checking routes
This is the config file:
c = get_config() #noqa
c.Application.log_datefmt = '%m-$d-%Y %H:%M:%S'
c.Application.log_format = '[%(levelname)s] [%(name)s] %(message)s'
c.Application.log_level = 'INFO'
c.JupyterHub.active_server_limit = 4
c.JupyterHub.active_user_window = 5
c.JupyterHub.config_file = '/hpc/project/projwork47/pyjup/sboxtest/etc/jupyterhub_config.py'
c.JupyterHub.cookie_max_age_days = 2
c.JupyterHub.cookie_secret_file = '/hpc/project/projwork47/pyjup/sboxtest/etc/jupyterhub_cookie_secret'
c.JupyterHub.data_files_path = '/hpc/project/projwork47/pyjup/sboxtest/share/jupyterhub'
c.JupyterHub.init_spawners_timeout = 15
c.JupyterHub.ip = '0.0.0.0'
c.JupyterHub.log_datefmt = '%m-%d-%Y %H:%M:%S'
c.JupyterHub.log_format = '[%(levelname)s] [%(name)s] %(message)s'
c.JupyterHub.log_level = 'DEBUG'
c.JupyterHub.named_server_limit_per_user = 2
c.JupyterHub.port = 443
c.JupyterHub.service_check_interval = 60
c.JupyterHub.shutdown_on_logout = True
c.JupyterHub.spawner_class = 'systemdspawner.SystemdSpawner'
c.SystemdSpawner.dynamic_users = False
c.SystemdSpawner.mem_limit = '2G'
c.SystemdSpawner.cpu_limit = 1.0
c.JupyterHub.ssl_cert = '/hpc/project/projwork47/pyjup/sboxtest/ssl/ssl.crt'
c.JupyterHub.ssl_key = '/hpc/project/projwork47/pyjup/sboxtest/ssl/ssl.key'
c.Spawner.cmd = ['/hpc/project/projwork47/pyjup/sboxtest/bin/jupyterhub-singleuser']
c.Spawner.cpu_guarantee = 0.5
c.Spawner.cpu_limit = 1.0
c.Spawner.env_keep = ['PATH', 'PYTHONPATH', 'CONDA_ROOT', 'CONDA_DEFAULT_ENV', 'VIRTUAL_ENV', 'LANG', 'LC_ALL', 'JUPYTERHUB_SINGLEUSER_APP']
c.Spawner.http_timeout = 3600
c.Spawner.mem_guarantee = '500M'
c.Spawner.mem_limit = '2G'
c.Spawner.notebook_dir = '/hpc/project/projwork47/jupyterLabUsers'
c.Spawner.poll_interval = 30
c.Spawner.port = 0
c.Spawner.start_timeout = 3600