Thanks for testing 2.0!
JupyterHub 2.0 is a major release, so you’ll probably need to use the latest dev version of the chart if you want to also use the latest dev version of jupyterhub itself.
Can you share your configuration of users and roles (with usernames obfuscated, if needed)? Have you customized either the user role or the server role?
The error means that a token was assigned a role (the default server
role) which contains scopes the user itself does not have. This could mean an overlapping scope where the user has a filter (e.g. users:activity!user
) while the server role has the full users:activity
, which would mean permissions for all users, which would be forbidden.
You would see this error if you declared one or both of the user
and server
roles such that the server role exceeded the user role. This could be done by either increasing the server role (default: ['users:activity!user', 'access:servers!user']
) or decreasing the user role: (default: ['self']
).
If you don’t have any role-related configuration, my hunch is that something here prevented JupyterHub’s default role assignment for existing users. I don’t know if it was a bug in the JupyterHub 2.0 beta or in the customizations you’ve made. First, make sure your user having trouble actually has the user
role.
It would be useful to check the database status.
One way to do this is to poke around with jupyterhub.dbutil
. To launch the db shell in your hub pod:
hub=$(kubectl get pod --no-headers -l component=hub | awk '{print $1}')
kubectl exec -it ${hub} -- bash
Then in the shell, run:
python3 -m pip install ipython
python3 -m jupyterhub.dbutil shell
At which point, you’ll have an IPython shell connected to your JupyterHub database.
You can then collect info about the user and roles:
from jupyterhub import scopes
# look up the user
user = orm.User.find(db, name="username")
# check user's role assignments
print(user.roles)
# check user's expanded roles
print(scopes.get_scopes_for(user))
# check server role
server_role = orm.Role.find(db, name="server")
print(server_role.scopes)