Cannot make a user admin or superuser via the admin menu.
Version
22.6.0 (e68da5c)
Steps to Reproduce
- Go to the "admin" menu item (/manage/)
- Select a user
- Toggle admin or superuser status to on
- Press "Save changes"
Expected Result
Admin and superuser status should be persisted
Actual Result
- The put request is completed successfully
- Toast pops up with "User account updated"
- After reloading the page, the admin and/or superuser toggles are disabled.
(I inspected network traffic, the put request has isStaff and isSuperuser as true, the response had the isStaff and isSuperuser property as false)
I tested if the user saving is just broken, but changing the username or active works just fine. It just looks like the data is dropped or ignored without reason/error.
- The user email is validated
- Having 2FA on or off made no difference
@martijnhartlief I had the same problem. Have you tried the solution in #1288?
docker exec -ti sentry-self-hosted_web_1 sentry permissions add -u <USER_EMAIL> -p "users.admin" did the trick for me
I thought we fixed this in https://github.com/getsentry/sentry/pull/31714. Why are we still seeing this? 🤔
@martijnhartlief I had the same problem. Have you tried the solution in #1288?
docker exec -ti sentry-self-hosted_web_1 sentry permissions add -u <USER_EMAIL> -p "users.admin"did the trick for me
Thanks for suggesting an alternative way to add an admin.
Still, the web interface is not behaving as expected. Which probably needs to be fixed.
What version did you see this with @codegain?
@chadwhitacre 22.6.0 (the lastest at the time I was upgrading)
I was on 21.10.0 (or 21.11.0) before that and I always do upgrades one at a time (working upwards the list at https://github.com/getsentry/self-hosted/releases). I did start with like 21.6.0 a year ago if that helps.
EDIT:
Still, the web interface is not behaving as expected. Which probably needs to be fixed.
After I used the command above the interface is behaving as it should on my install. I can now toggle admins/superuser off and on.
Hrm, I do wonder if this only shows up if you were on an old version and upgrade vs. with a new version out of the box. More research required ...
I should add that I had the sentry-ldap plugin installed and active in 21.10.0. After I switched to Azure SSO and disabled the plugin I began upgrading to the lastest version. I did not open a new issue here because I thought this had something to do with my "special" setup.
@simPod also ran into this. This seems to be an issue with sentry or self-hosted.
Just did a fresh 22.6.0 install and have this issue.
Any updates on this? Still experiencing it on 22.10.0. Executing
sentry permissions add -u <USER_EMAIL> -p "users.admin"
is giving me: Error: User <USER_EMAIL> does not have superuser status.
@maciejpankanin Try replacing <USER_EMAIL> with an actual email address from a user you want to promote to superuser.
f.e. sentry permissions add -u [email protected] -p "users.admin"
@codegain User I am trying add permissions to has only one email and it is also his username, it does not work.
An alternative could be to remove and re-add the user with superuser permissions. (You can pass this to create-user)