Hey all,
We’ve been running z2jh helm in our 1.26 EKS Cluster. We’ve upgraded the helm chart from version 2.0.0
to 3.2.1
.
This involves upgrading the version of jupyterhub (software) from 3.0.0
to 4.0.2
.
Trying to spawn with this upgraded version of software is causing an error. Jupyterhub says spawn failed
, and the hub logs are below:
[I 2024-03-18 20:28:36.603 JupyterHub log:191] 302 GET /hub/spawn/sean.turner -> /hub/spawn-pending/sean.turner (sean.turner@::ffff:10.2.67.251) 630.85ms
[I 2024-03-18 20:28:36.616 JupyterHub reflector:282] watching for pods with label selector='component=singleuser-server' in namespace jupyterhub
[I 2024-03-18 20:28:36.617 JupyterHub reflector:282] watching for events with field selector='involvedObject.kind=Pod' in namespace jupyterhub
[I 2024-03-18 20:28:36.619 JupyterHub spawner:2551] Attempting to create pvc jupyterhub-sean-2eturner, with timeout 3
[I 2024-03-18 20:28:36.635 JupyterHub spawner:2567] PVC jupyterhub-sean-2eturner already exists, so did not create new pvc.
[E 2024-03-18 20:28:36.635 JupyterHub user:884] Unhandled error starting sean.turner's server: 'JUPYTERHUB_SERVICE_PREFIX'
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/jupyterhub/user.py", line 798, in spawn
url = await gen.with_timeout(timedelta(seconds=spawner.start_timeout), f)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubespawner/spawner.py", line 2718, in _start
pod = await self.get_pod_manifest()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubespawner/spawner.py", line 2014, in get_pod_manifest
env=self.get_env(), # Expansion is handled by get_env
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubespawner/spawner.py", line 2168, in get_env
env.update(self._expand_all(self.environment))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubespawner/spawner.py", line 1847, in _expand_all
return {k: self._expand_all(v) for k, v in src.items()}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubespawner/spawner.py", line 1847, in <dictcomp>
return {k: self._expand_all(v) for k, v in src.items()}
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubespawner/spawner.py", line 1849, in _expand_all
return self._expand_user_properties(src)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubespawner/spawner.py", line 1827, in _expand_user_properties
rendered = template.format(
^^^^^^^^^^^^^^^^
KeyError: 'JUPYTERHUB_SERVICE_PREFIX'
[E 2024-03-18 20:28:36.855 JupyterHub gen:630] Exception in Future <Task finished name='Task-128' coro=<BaseHandler.spawn_single_user.<locals>.finish_user_spawn() done, defined at /usr/local/lib/python3.11/site-packages/jupyterhub/handlers/base.py:981> exception=KeyError('JUPYTERHUB_SERVICE_PREFIX')> after timeout
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/tornado/gen.py", line 625, in error_callback
future.result()
File "/usr/local/lib/python3.11/site-packages/jupyterhub/handlers/base.py", line 988, in finish_user_spawn
await spawn_future
File "/usr/local/lib/python3.11/site-packages/jupyterhub/user.py", line 902, in spawn
raise e
File "/usr/local/lib/python3.11/site-packages/jupyterhub/user.py", line 798, in spawn
url = await gen.with_timeout(timedelta(seconds=spawner.start_timeout), f)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubespawner/spawner.py", line 2718, in _start
pod = await self.get_pod_manifest()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubespawner/spawner.py", line 2014, in get_pod_manifest
env=self.get_env(), # Expansion is handled by get_env
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubespawner/spawner.py", line 2168, in get_env
env.update(self._expand_all(self.environment))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubespawner/spawner.py", line 1847, in _expand_all
return {k: self._expand_all(v) for k, v in src.items()}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubespawner/spawner.py", line 1847, in <dictcomp>
return {k: self._expand_all(v) for k, v in src.items()}
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubespawner/spawner.py", line 1849, in _expand_all
return self._expand_user_properties(src)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/kubespawner/spawner.py", line 1827, in _expand_user_properties
rendered = template.format(
^^^^^^^^^^^^^^^^
KeyError: 'JUPYTERHUB_SERVICE_PREFIX'
[E 2024-03-18 20:28:36.880 JupyterHub pages:375] Previous spawn for sean.turner failed: 'JUPYTERHUB_SERVICE_PREFIX'
My understanding is that this prefix is automatically supposed to be configured as /users/{{username}}
. However, I’m not able to understand why this is no longer happening.
We have customized our jupyterhub slightly, mainly subclassing the KubeSpawner to add taints and tolerations to the pods spun up so that we have access to GPU, and, adding some environment variables. Most other things are untouched. We also added an HTML template that is used to select what docker image should be deployed.
Any thoughts? I’ve directly tried to configure this on FooSpawner.environment (subclass of KubeSpawner), and also tried to add an init()
function that sets self.server = True
in order to set the JUPYTERHUB_SERVICE_PREFIX
directly. Have also added it to singleUser.extraEnv
on the helm chart to try and set the JUPYTERHUB_SERVICE_PREFIX
on the template that is rendered in the stack trace, but still no luck.
Any thoughts? Am I thinking about this all wrong? Is there something else that I should be considering?
Thank you very much