JupyterHub 启动笔记本进度不起作用并出现 403 错误(停止服务器也会产生 403)



我们在k8s集群中安装了JupyterHub,并通过KeyCloak进行身份验证。JupyterHub是由https://jupyterhub.github.io/helm-chart repository中的JupyterHub Helm chart version 2.0.0安装的。

当用户通过身份验证并运行服务器时,页面显示消息"您的服务器正在启动。当它为你准备好时,你会自动被重定向。没有显示任何进度,hub记录以下错误:操作未被授权使用当前范围;[read:servers]">

完整日志为:

[I 2023-01-11 16:41:08.977 JupyterHub app:2775] Running JupyterHub version 3.0.0
[I 2023-01-11 16:41:08.978 JupyterHub app:2805] Using Authenticator: oauthenticator.generic.GenericOAuthenticator-15.1.0
[I 2023-01-11 16:41:08.978 JupyterHub app:2805] Using Spawner: kubespawner.spawner.KubeSpawner-4.2.0
[I 2023-01-11 16:41:08.978 JupyterHub app:2805] Using Proxy: jupyterhub.proxy.ConfigurableHTTPProxy-3.0.0
[I 2023-01-11 16:41:09.049 JupyterHub roles:183] Role attribute user.scopes has been changed
[I 2023-01-11 16:41:09.061 JupyterHub app:1934] Not using allowed_users. Any authenticated user will be allowed.
...
...
...
[W 2023-01-11 16:41:44.763 JupyterHub base:89] Blocking Cross Origin API request.  Referer: https://styx-dev.themodelvault.com/hub/spawn-pending/stasdavydov, Host: styx-dev.themodelvault.com, Host URL: http://styx-dev.themodelvault.com/hub/
[W 2023-01-11 16:41:44.763 JupyterHub scopes:804] Not authorizing access to /hub/api/users/stasdavydov/server/progress. Requires any of [read:servers], not derived from scopes []
[W 2023-01-11 16:41:44.763 JupyterHub web:1796] 403 GET /hub/api/users/stasdavydov/server/progress (::ffff:10.0.138.202): Action is not authorized with current scopes; requires any of [read:servers]
[W 2023-01-11 16:41:44.766 JupyterHub log:186] 403 GET /hub/api/users/stasdavydov/server/progress (@::ffff:10.0.138.202) 4.57ms
同样的问题发生在停止服务器时:API请求失败(403):操作未被当前范围授权;[delete:servers]

.UPD:我发现类似的问题解释,但没有看到解决方案:https://discourse.jupyter.org/t/cross-origin-issue-upgrading-from-1-5/15428

感谢您对如何修复的任何建议。

毕竟,通过将JupyterHub图表版本降级到1.2.0,问题就解决了。

最新更新