kubernetes JupyterHub启动笔记本进程不工作,出现403错误(停止服务器也会产生403)

li9yvcax  于 2023-04-20  发布在  Kubernetes
关注(0)|答案(1)|浏览(185)

我们在k8s集群中安装了JupyterHub,通过KeyCloak进行身份验证。JupyterHub是由https://jupyterhub.github.io/helm-chart存储库中的jupyterhub Helm chart版本2.0.0安装的。
当用户通过身份验证并运行服务器时,带有消息“您的服务器正在启动。当它为您准备好时,您将被自动重定向”的页面不会显示任何进度,并且集线器会记录以下错误:当前范围未授权操作;需要任何[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
感谢任何关于如何修复的建议。

wswtfjt7

wswtfjt71#

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

相关问题