Open szazs89 opened 11 months ago
It seems to be similar to #3671 but in the opposite way ( /tree <-> /lab )
Hm... the following modifications in jupyterhub_config.py
seem to help:
{ 'name': 'share-role',
'scopes': [ 'access:services!service=SHARED_SERVICE', 'read:users' ],
'groups': [ 'share_group' ],
'services': [ 'SHARED_SERVICE' ]
}
The read:users
options may be needed for the specific use of the service (it is a grader service for nbgrader
).
However, the services
key referring to the appropriate service is important.
This issue of jupyterlab-rise may be also related: https://github.com/jupyterlab-contrib/rise/issues/71
Bug description
https://jupyterhub/services/SHARED_SERVICE/lab
works fine whilehttps://jupyterhub/services/SHARED_SERVICE/tree
doesn't (Help -> Launch Jupyter Notebook File Browser) It stucks with a blank page and a Jupyter logo.How to reproduce
In
jupyterhub_config.py
share_user
share_group
share_group
withshare_user
and normal usersCreate linux user
share_user
(adduser -q --gecos '' share_user
)(Re)Start JupyterHub and
admin
) added toshare_group
Expected behaviour
The new tab with url
https://jupyterhub/services/SHARED_SERVICE/tree
should show the classic file browser with the file structure ofshare_user
.Actual behaviour
The new tab opens but does not show the file structure, only a single Jupyter logo on a white (blank) page.
Your personal set up
Full environment
Configuration
``` # jupyterhub_config.py c = get_config() #noqa service_token = '...' c.JupyterHub.services = [ { 'name': 'culler-service', 'command': [ 'jupyterhub-idle-culler', '--timeout=21600', '--url=http://127.0.0.1:8081/hub/api' ], 'api_token': service_token }, { 'name': 'SHARED_SERVICE', 'url': 'http://127.0.0.1:9999', 'command': [ 'jupyterhub-singleuser', '--group=share_group', '--debug' ], 'user': 'share_user', 'cwd': '/home/share_user', } ] c.JupyterHub.load_roles = [ { 'name': 'server', 'scopes': [ 'inherit' ] }, { 'name': 'idle-culler-role', 'scopes': [ 'read:servers', 'delete:servers', 'admin:users', 'admin:groups', ], 'services': [ 'culler-service' ] }, # access courses by its tutors only: { 'name': 'share-role', 'scopes': [ 'access:services!service=SHARED_SERVICE' ], 'groups': [ 'share_group' ] } ] c.JupyterHub.load_groups = { 'share_group': { 'users': [ 'share_user', 'admin' ] }, } c.Authenticator.admin_users = {'admin'} ```Logs
``` D 17:18:01.415 ServerApp] Checking user admin with scopes ['access:services!service=SHARED_SERVICE', 'read:users:groups!user=admin', 'read:users:name!user=admin'] against {'access:services!service=SHARED_SERVICE', 'access:services'} D 17:18:01.415 ServerApp] Allowing user admin with scopes {'access:services!service=SHARED_SERVICE'} D 17:18:01.416 ServerApp] 304 GET /services/SHARED_SERVICE/lab/extensions/@jupyter-notebook/lab-extension/static/776.c7baadfaddfd4518c935.js?v=c7baadfaddfd4518c935 (admin@192.168.33.1) 2.32ms D 17:18:01.517 ServerApp] HubAuth cache miss: token:04a83242c3224c91b7dfe90fafd84eee:94162264e2e6a4e40a4397b91866b8477815563becace5d31dce2c65bdcefc63 D 17:18:01.522 ServerApp] Paths used for configuration of default_setting_overrides: /etc/jupyter/labconfig/default_setting_overrides.json D 17:18:01.523 ServerApp] Paths used for configuration of default_setting_overrides: /usr/local/etc/jupyter/labconfig/default_setting_overrides.json D 17:18:01.524 ServerApp] Paths used for configuration of default_setting_overrides: /usr/etc/jupyter/labconfig/default_setting_overrides.json D 17:18:01.524 ServerApp] Paths used for configuration of default_setting_overrides: /home/grader-00yz/.local/etc/jupyter/labconfig/default_setting_overrides.json D 17:18:01.525 ServerApp] Paths used for configuration of default_setting_overrides: /home/grader-00yz/.jupyter/labconfig/default_setting_overrides.json D 17:18:01.527 ServerApp] HubAuth cache miss: token:... D 17:18:01.527 ServerApp] HubAuth cache miss: token:... D 17:18:01.533 ServerApp] HubAuth cache miss: token:... D 17:18:01.533 ServerApp] HubAuth cache miss: token:... D 17:18:01.533 ServerApp] HubAuth cache miss: token:... D 17:18:01.674 ServerApp] HubAuth cache miss: token:... I 17:18:01.964 JupyterHub log:191] 200 GET /hub/api/user (SHARED_SERVICE@127.0.0.1) 422.80ms D 17:18:01.965 ServerApp] Received request from Hub user {'name': 'SHARED_SERVICE', 'kind': 'service', 'admin': False, 'session_id': None, 'scopes': []} D 17:18:01.965 ServerApp] Checking user SHARED_SERVICE with scopes [] against {'access:services!service=SHARED_SERVICE', 'access:services'} W 17:18:01.966 ServerApp] Not allowing user SHARED_SERVICE D 17:18:01.968 ServerApp] Redirecting to login url: /hub/api/oauth2/authorize?client_id=service-SHARED_SERVICE&redirect_uri=%2Fservices%2FSHARED_SERVICE%2Foauth_callback&response_type=code&state=eyJ1dWlkIjogImY2OWM3ZmZkNDQ4YzQ0NzdhOTMzYjUxNmE5MmYxYjRhIiwgIm5leHRfdXJsIjogIi9zZXJ2aWNlcy8wMFlaL2FwaS9rZXJuZWxzcGVjcz8xNjk2MTgwNjgxNDU0In0 I 17:18:01.972 JupyterHub log:191] 200 GET /hub/api/user (SHARED_SERVICE@127.0.0.1) 429.59ms W 17:18:01.968 ServerApp] wrote error: 'Forbidden' Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/tornado/web.py", line 1784, in _execute result = method(*self.path_args, **self.path_kwargs) File "/usr/local/lib/python3.10/dist-packages/tornado/web.py", line 3278, in wrapper url = self.get_login_url() File "/usr/local/lib/python3.10/dist-packages/jupyterhub/singleuser/extension.py", line 148, in get_login_url return original_get_login_url() File "/usr/local/lib/python3.10/dist-packages/jupyter_server/base/handlers.py", line 753, in get_login_url raise web.HTTPError(403) tornado.web.HTTPError: HTTP 403: Forbidden W 17:18:01.973 ServerApp] 403 GET /services/SHARED_SERVICE/api/kernelspecs?1696180681454 (@152.66.33.1) 457.73ms ```