Closed dragz closed 1 month ago
Thank you @dragz for trying out the beta release and reporting this back!!!
The key parts from this report is that kubespawner 7.0.0b2 in z2jh 4.0.0-beta.2 resulted in...
[W 2024-10-03 10:50:38.346 JupyterHub spawner:3138] Using legacy pvc claim-abc000-40uit-2eno for abc000@uit.no
[I 2024-10-03 10:50:38.347 JupyterHub spawner:2940] Attempting to create pvc claim-abc000-40uit-2eno, with timeout 3
[I 2024-10-03 10:50:38.367 JupyterHub spawner:2956] PVC claim-abc000-40uit-2eno already exists, so did not create new pvc.
2024-10-03T10:50:38.416759Z [Warning] 0/1 nodes are available: persistentvolumeclaim "claim-abc000-uit-no---1ea1e26d" not found.
@minrk it seems from this that kubespawner was smart and concluded it should re-use the old PVC, but that it at the same time failed to do so.
Note from the default values of z2jh, we have this btw @minrk, so we have explicit and defaults overriding the kubespawner defaults.
storage:
type: dynamic
extraLabels: {}
extraVolumes: []
extraVolumeMounts: []
static:
pvcName:
subPath: "{username}"
capacity: 10Gi
homeMountPath: /home/jovyan
dynamic:
storageClass:
pvcNameTemplate: claim-{username}{servername}
volumeNameTemplate: volume-{username}{servername}
storageAccessModes: [ReadWriteOnce]
subPath:
pvcNameTemplate should probably be removed, since that's already the default. volumeNameTemplate
doesn't match the kubespawner default, so it should still be defined. But where we have {username}{servername}
, we should replace it with {user_server}
(which is identical in escape
scheme).
I'll investigate the tests to see why they don't cover this case, I thought they did.
(unless pvcNameTemplate is consumed in the chart, which I suspect it actually is. In that case, it should stay and be updated to {user_server}
)
I think I understand it now, the chart actually defines the volume:pvc mount, so even though the pvc itself is correct, the volume mount points to the pvc name that doesn't exist. Fortunately, the updated templates address this, because there is a {pvc_name}
field that resolves directly to spawner.pvc_name
, however that may be resolved.
Thank you @minrk!! @dragz could you try if this resolved things for you by using the latest development release of the chart?
It will be listed soon at https://hub.jupyter.org/helm-chart/#development-releases-jupyterhub
It is version 4.0.0-beta.2.git.6792.hc3e818e9
Yes, this fixed the issue. Home dir is now found and mounted correctly.
(I'm impressed with the speed here)
Thank you for testing, reporting, and verifying the attempted fix @dragz!!
4.0.0-beta.3 released for this fix btw
Bug description
Just ran an upgrade from version 3.3.7 and found that the spawn fails because it cannot find the users home dir PVC.
How to reproduce
Expected behaviour
It should look for a PVC named claim-abc000-40uit-2eno which was created before the upgrade.
Actual behaviour
It tries to find a PVC named claim-abc000-uit-no---1ea1e26d which does not exist
Your personal set up
Rather straight forward setup with Azure Kubernetes Service using zero-to-jupyterhub with autoscaling and EntraID for authentication.
Configuration
```python # jupyterhub_config.py ```Logs
``` Loading /usr/local/etc/jupyterhub/secret/values.yaml No config at /usr/local/etc/jupyterhub/existing-secret/values.yaml Loading extra config: checkvolumes [I 2024-10-03 10:50:13.022 JupyterHub app:3352] Running JupyterHub version 5.2.0 [I 2024-10-03 10:50:13.023 JupyterHub app:3382] Using Authenticator: oauthenticator.azuread.AzureAdOAuthenticator-17.0.0 [I 2024-10-03 10:50:13.023 JupyterHub app:3382] Using Spawner: kubespawner.spawner.KubeSpawner-7.0.0b2 [I 2024-10-03 10:50:13.023 JupyterHub app:3382] Using Proxy: jupyterhub.proxy.ConfigurableHTTPProxy-5.2.0 [I 2024-10-03 10:50:13.052 JupyterHub dbutil:129] Upgrading sqlite:///jupyterhub.sqlite [I 2024-10-03 10:50:13.052 JupyterHub dbutil:100] Backing up jupyterhub.sqlite => jupyterhub.sqlite.2024-10-03-105013 [I 2024-10-03 10:50:14.117 alembic.runtime.migration migration:215] Context impl SQLiteImpl. [I 2024-10-03 10:50:14.117 alembic.runtime.migration migration:218] Will assume non-transactional DDL. [I 2024-10-03 10:50:14.127 alembic.runtime.migration migration:623] Running upgrade 0eee8c825d24 -> 3c2384c5aae1, Add from_config column to the services table [I 2024-10-03 10:50:14.174 alembic.runtime.migration migration:623] Running upgrade 3c2384c5aae1 -> 4621fec11365, manage roles [I 2024-10-03 10:50:14.586 JupyterHub roles:210] Role attribute admin.scopes has been changed [I 2024-10-03 10:50:14.696 JupyterHub app:2925] Creating service jupyterhub-idle-culler without oauth. [I 2024-10-03 10:50:14.738 JupyterHub roles:281] Adding role admin for User: abc000@uit.no [I 2024-10-03 10:50:14.786 JupyterHub app:3422] Initialized 0 spawners in 0.014 seconds [I 2024-10-03 10:50:14.793 JupyterHub metrics:373] Found 0 active users in the last ActiveUserPeriods.twenty_four_hours [I 2024-10-03 10:50:14.794 JupyterHub metrics:373] Found 0 active users in the last ActiveUserPeriods.seven_days [I 2024-10-03 10:50:14.795 JupyterHub metrics:373] Found 1 active users in the last ActiveUserPeriods.thirty_days [I 2024-10-03 10:50:14.795 JupyterHub app:3702] Not starting proxy [I 2024-10-03 10:50:14.804 JupyterHub app:3738] Hub API listening on http://:8081/hub/ [I 2024-10-03 10:50:14.804 JupyterHub app:3740] Private Hub API connect url http://hub:8081/hub/ [I 2024-10-03 10:50:14.805 JupyterHub app:3621] Starting managed service jupyterhub-idle-culler [I 2024-10-03 10:50:14.805 JupyterHub service:423] Starting service 'jupyterhub-idle-culler': ['python3', '-m', 'jupyterhub_idle_culler', '--url=http://localhost:8081/hub/api', '--timeout=3600', '--cull-every=600', '--concurrency=10'] [I 2024-10-03 10:50:14.807 JupyterHub service:136] Spawning python3 -m jupyterhub_idle_culler --url=http://localhost:8081/hub/api --timeout=3600 --cull-every=600 --concurrency=10 [I 2024-10-03 10:50:14.810 JupyterHub proxy:477] Adding route for Hub: / => http://hub:8081 [I 2024-10-03 10:50:14.817 JupyterHub app:3781] JupyterHub is now running, internal Hub API at http://hub:8081/hub/ [I 2024-10-03 10:50:15.166 JupyterHub log:192] 200 GET /hub/api/ (jupyterhub-idle-culler@::1) 27.87ms [I 2024-10-03 10:50:15.188 JupyterHub log:192] 200 GET /hub/api/users?state=[secret] (jupyterhub-idle-culler@::1) 18.79ms [I 2024-10-03 10:50:26.307 JupyterHub log:192] 302 GET / -> /hub/ (@::ffff:10.244.1.1) 0.87ms [I 2024-10-03 10:50:28.890 JupyterHub log:192] 302 GET / -> /hub/ (@::ffff:10.244.1.1) 0.81ms [I 2024-10-03 10:50:30.204 JupyterHub log:192] 302 GET / -> /hub/ (@::ffff:10.244.1.1) 1.00ms [W 2024-10-03 10:50:30.305 JupyterHub spawner:2546] Loading state for abc000@uit.no/ from unknown prior version of kubespawner (likely 6.x), will attempt to upgrade. [I 2024-10-03 10:50:30.306 JupyterHub log:192] 302 GET /hub/ -> /hub/spawn (abc000@uit.no@::ffff:10.244.1.1) 40.00ms [I 2024-10-03 10:50:30.413 JupyterHub _xsrf_utils:125] Setting new xsrf cookie for b'KVMkVzPaApnZAJdX5_Z_TUdiGiiyYJiT3q211Kuclgw=:cf609962c22f43ed8cb6ad6bafc27d0c' {'path': '/hub/'} [I 2024-10-03 10:50:30.469 JupyterHub log:192] 200 GET /hub/spawn (abc000@uit.no@::ffff:10.244.1.1) 87.21ms [I 2024-10-03 10:50:38.131 JupyterHub provider:661] Creating oauth client jupyterhub-user-abc000%40uit.no [I 2024-10-03 10:50:38.196 JupyterHub