Reactivate deactivated user

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube Version 7.1 (build 11001)

  • what are you trying to achieve
    Reactivate a deactivated User

  • what have you tried so far to achieve this
    The user has been set with “active=true” flag in the database


One thing for sure is that you should not tamper with the database directly, you’re at risk of corrupting your dataset. Once a user is deactivated, I believe the most efficient way to get it back on track is to simply recreate it with the same login.

Thanks Nicolas. In case is a user related LDAP, is it possible to recreate it?

Hi Carles,

Did you get the user to just try logging in ? From recent tests I think this should just work (when you leverage LDAP integration then user management is fully delegated to LDAP server).

Hi Nicolas,
Yes, we tried. Currently the user is available to add it into the groups, but it isn’t showed in the general user list. I guess it isn’t in the default group “sonar-users” (and I can’t manually add it there). What do you think? Thanks

That sounds like a glitch. I suggest checking if you can find the user via WebAPI, and ultimately if the inconsistency remains then it might be the symptom of a data problem. In which case:

Thanks Nicolas! Do you recommend to delete the folder es5 or just its content?

Either way should be fine!

A post was split to a new topic: Fail to reactivate user

Hey, @NicoB we understand that we should not edit the database directly. But there does not seem to be any way to reactivate a deactivated user through the UI or API. For the API, with SAML users, we would have to know the LastName-FirstName-MI00000 random five digits generated for the account to reactivate. In other words, you have a disable feature with no re-enable feature. As you would expect, deactivated users do not show in any of the lists or API results. Would be great if an API would list deactivated users, then I could use the idea against the /create webapi as per documentation to re-enable it. This is causing problems. This has to resonate at some level…right?? We need a fix or a way to reactivate.