onyxia icon indicating copy to clipboard operation
onyxia copied to clipboard

Onyxia ui doesn't start if param userNamespace is set to false

Open Donatien26 opened this issue 1 year ago • 1 comments

Hi !

We have an onyxia instance in a cluster where user namespace are not allowed and only groups namespace are allowed. If we set the param userNamespace to false onyxia web doesn't start. Onyxia ui show a popup with this error message:

Error: Wrong assertion encountered: "There should be only one project without group (user project)"

Donatien26 avatar Jul 16 '24 06:07 Donatien26

Thanks for reporting Donatien

garronej avatar Jul 16 '24 07:07 garronej

I ran into this situation as well - would be neat to see guidance on how to debug this. I set it to "true" with no result.

cslovell avatar Jan 24 '25 21:01 cslovell

@cslovell Hi ! First step to debug this is probably to check the return body of the API call to /user/info. You should have the list of the resolved projects which is composed of user namespace (if usernamespace is not set or set to true) + any groups the user belongs to (populated based on the groups claim in the JWT token). If this list of projects is empty then Onyxia can't figure out where to work (no user namespace and no group namespace) resulting in the error you have. If you have not set usernamespace or set it to true then the most likely reason the list is empty is due to the username (by default preferred_username) contains invalid characters. Onyxia will filter out any invalid username / group name because all the downstream logic (Kubernetes namespaces & S3 buckets names) relies on the username (usually prefixed).

Please check the content of the resolved list of projects and, if it's empty like I'm guessing, please check that your username only contains alphanumerical lowercase or - characters. If needed, change the username claim to a claim that only contains allowed characters and / or create a custom mapper to add a such claim in the OIDC token

olevitt avatar Jan 24 '25 23:01 olevitt