self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

Cannot make a user admin or superuser via the admin menu.

Open martijnhartlief opened this issue 3 years ago • 9 comments

Version

22.6.0 (e68da5c)

Steps to Reproduce

  1. Go to the "admin" menu item (/manage/)
  2. Select a user
  3. Toggle admin or superuser status to on
  4. 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 avatar Jun 23 '22 13:06 martijnhartlief

@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

codegain avatar Jul 13 '22 09:07 codegain

I thought we fixed this in https://github.com/getsentry/sentry/pull/31714. Why are we still seeing this? 🤔

chadwhitacre avatar Jul 18 '22 21:07 chadwhitacre

@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.

martijnhartlief avatar Jul 22 '22 09:07 martijnhartlief

What version did you see this with @codegain?

chadwhitacre avatar Jul 26 '22 15:07 chadwhitacre

@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.

codegain avatar Jul 26 '22 15:07 codegain

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 ...

chadwhitacre avatar Jul 26 '22 15:07 chadwhitacre

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.

codegain avatar Jul 26 '22 15:07 codegain

@simPod also ran into this. This seems to be an issue with sentry or self-hosted.

emmatyping avatar Aug 03 '22 18:08 emmatyping

Just did a fresh 22.6.0 install and have this issue.

svigneri avatar Aug 04 '22 20:08 svigneri

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 avatar Nov 08 '22 08:11 maciejpankanin

@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 avatar Nov 08 '22 14:11 codegain

@codegain User I am trying add permissions to has only one email and it is also his username, it does not work.

maciejpankanin avatar Nov 08 '22 14:11 maciejpankanin

An alternative could be to remove and re-add the user with superuser permissions. (You can pass this to create-user)

emmatyping avatar Nov 08 '22 20:11 emmatyping