# Reactivate deactivated user

**URL:** <https://community.sonarsource.com/t/reactivate-deactivated-user/2315>\
**Category:** SonarQube Server / Community Build\
**Tags:** sonarqube, administration\
**Created:** [September 5, 2018, 12:43pm UTC](https://community.sonarsource.com/t/reactivate-deactivated-user/2315 "2018-09-05T12:43:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![carles.perez.gassio](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@carles.perez.gassio](https://community.sonarsource.com/u/carles.perez.gassio)\
**Post date:** [September 5, 2018, 12:43pm UTC](https://community.sonarsource.com/t/reactivate-deactivated-user/2315/1 "2018-09-05T12:43:13Z")

</div>

Must-share information (formatted with [Markdown](https://commonmark.org/help/)):

- 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

---

<div class="post-metadata">

**Author:** ![NicoB](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nicob/32/3_2.png) [@NicoB](https://community.sonarsource.com/u/NicoB)\
**Post date:** [September 7, 2018, 9:01am UTC](https://community.sonarsource.com/t/reactivate-deactivated-user/2315/2 "2018-09-07T09:01:16Z")

</div>

Hi,

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.

---

<div class="post-metadata">

**Author:** ![carles.perez.gassio](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@carles.perez.gassio](https://community.sonarsource.com/u/carles.perez.gassio)\
**Post date:** [September 10, 2018, 7:11am UTC](https://community.sonarsource.com/t/reactivate-deactivated-user/2315/3 "2018-09-10T07:11:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NicoB](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nicob/32/3_2.png) [@NicoB](https://community.sonarsource.com/u/NicoB)\
**Post date:** [September 10, 2018, 7:41am UTC](https://community.sonarsource.com/t/reactivate-deactivated-user/2315/4 "2018-09-10T07:41:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![carles.perez.gassio](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@carles.perez.gassio](https://community.sonarsource.com/u/carles.perez.gassio)\
**Post date:** [September 12, 2018, 9:50am UTC](https://community.sonarsource.com/t/reactivate-deactivated-user/2315/5 "2018-09-12T09:50:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NicoB](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nicob/32/3_2.png) [@NicoB](https://community.sonarsource.com/u/NicoB)\
**Post date:** [September 13, 2018, 8:06am UTC](https://community.sonarsource.com/t/reactivate-deactivated-user/2315/6 "2018-09-13T08:06:46Z")

</div>

> [@carles.perez.gassio](#):
>
> Currently the user is available to add it into the groups, but it isn’t showed in the general user list.

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:

> [@Failure to load server rules using Sonar Scanner ( InvalidProtocolBufferException )](https://community.sonarsource.com/t/failure-to-load-server-rules-using-sonar-scanner-invalidprotocolbufferexception/2442/2):
>
> you may want to rebuild your ElasticSearch index: stop SQ, delete `data/es5` , restart. Note that subsequent startup may take slightly longer than usual, due to ES data rebuild (which is not a usual operation, always better to investigate it first as you did here).

---

<div class="post-metadata">

**Author:** ![carles.perez.gassio](https://avatars.discourse-cdn.com/v4/letter/c/3bc359/32.png) [@carles.perez.gassio](https://community.sonarsource.com/u/carles.perez.gassio)\
**Post date:** [September 17, 2018, 9:08am UTC](https://community.sonarsource.com/t/reactivate-deactivated-user/2315/7 "2018-09-17T09:08:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NicoB](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nicob/32/3_2.png) [@NicoB](https://community.sonarsource.com/u/NicoB)\
**Post date:** [September 17, 2018, 10:11am UTC](https://community.sonarsource.com/t/reactivate-deactivated-user/2315/8 "2018-09-17T10:11:15Z")

</div>

Either way should be fine!

---

<div class="post-metadata">

**Author:** ![julienlancelot](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/julienlancelot/32/68225_2.png) [@julienlancelot](https://community.sonarsource.com/u/julienlancelot)\
**Post date:** [May 6, 2020, 2:57pm UTC](https://community.sonarsource.com/t/reactivate-deactivated-user/2315/9 "2020-05-06T14:57:48Z")

</div>

Split this topic on May 6, 2020, 2:57pm UTC

A post was split to a new topic: [Fail to reactivate user](https://community.sonarsource.com/t/fail-to-reactivate-user/24240)

---

<div class="post-metadata">

**Author:** ![kirkpabk](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/kirkpabk/32/13595_2.png) [@kirkpabk](https://community.sonarsource.com/u/kirkpabk)\
**Post date:** [September 17, 2021, 2:30pm UTC](https://community.sonarsource.com/t/reactivate-deactivated-user/2315/10 "2021-09-17T14:30:38Z")

</div>

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.
