User 'admin' locked

Hi Team,

We are trying to login with admin user and the authentication is failing, LDAP is working, I suspect The user ‘admin’ locked.

we are on 8.9.3 version, How to unlocked the user???

I found this from document

INSERT INTO user_roles(uuid, user_uuid, role)
VALUES (‘random-uuid’,
(select uuid from users where login=‘mylogin’),
‘admin’);

Do i need to execute this from database or else on server side???

Hi,

Welcome to the community!

Does the admin user show up in your list of users? If so, it would be worth taking a closer look there.

Do you still have a user with global admin permissions?

 
Ann

Hi Ann,

No it doesn’t show.

could you please make me understand what you saying.

We are able to login with LDAP users,All LDAP users don’t have administrator access.

Only initial user ‘admin’ has administrator acces now this admin user authentication is failing.

How do we get back this user with successful login???

Hi,

Okay, I think I understand now. Yes, you should run the SQL from your OP.

 
Ann

I am doing this in psql

INSERT INTO user_roles(uuid, user_uuid, role)
VALUES (‘random-uuid’,
(select uuid from users where login=‘mylogin’),
‘admin’);

As well as

update users set crypted_password=‘100000$t2h8AtNs1AlCHuLobDjHQTn9XppwTIx88UjqUm4s8RsfTuXQHSd/fpFexAnewwPsO6jGFQUv/24DnO55hY6Xew==’, salt=‘k9x9eN127/3e/hf38iNiKwVfaVk=’, hash_method=‘PBKDF2’, reset_password=‘true’, user_local=‘true’ where login=‘admin’;

Still i am not able to reset the admin password, let me correct if iam doing anything not conventional to sonar doc.

Hi,

For this:

You’re supposed to sub-in your login, where it says 'mylogin'. That grants your account admin permissions and from there you should be able to do what you need to do via the UI - including re-instating the admin account (just re-add it) and then resetting its password.

The second query resets the admin account’s password to admin, but that’s not going to do any good if the account has been deactivated and not re-established yet.

 
HTH,
Ann

Hi,

when i try to execute this INSERT INTO command i am getting error like this

Hi,

Just Wanted to clear understand on the issue. Exactly what is going here , is admin user locked or just failing or user is not recognized , user delete???.

if i am clear on this i can work on that part.

Hi,

Are you sure you’re in the right schema?

SonarQube doesn’t delete user accounts, for referential integrity reasons. Users are deactivated instead. Among other things, that blanks out their passwords & drops their group associations.

 
HTH,
Ann