Reset admin User password sonarqube 9.9 docker container fails

==

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    docker image sonarqube:9.9.5-community with postgres

sonarqube@7aad142e800a:/home$ printenv | grep SONAR_VERSION
SONAR_VERSION=9.9.5.90363

sonarqube@7aad142e800a:/home$ printenv | grep JAVA_VERSION
JAVA_VERSION=jdk-17.0.11+9

sonarqube@7aad142e800a:/home$ printenv | grep sonar.jdbc.url
sonar.jdbc.url=jdbc:postgresql://dblatest:5432/sonar

  • how is SonarQube deployed: zip, Docker, Helm
    docker

  • what are you trying to achieve
    login again with admin

  • what have you tried so far to achieve this
    queries against postgres from here:
    Security

and

insert into user_roles(uuid, user_uuid, role) values (‘random-uuid’, (select uuid from users where login=‘root’), ‘admin’);

and

update users set crypted_password = ‘$2a$12$uCkkXmhW5ThVK8mpBvnXOOJRLd64LJeHTeCkSuB3lfaR2N0AYBaSi’, salt=null, hash_method=‘BCRYPT’ where login = ‘admin’

What error did you get when you ran them?

no error.

root@fc6dd18420eb:/# psql -U sonar
psql (10.21 (Debian 10.21-1.pgdg90+1))
Type “help” for help.

sonar=# update users set
sonar-# crypted_password='100000$t2h8AtNs1AlCHuLobDjHQTn9XppwTIx88UjqUm4s8RsfTuXQHSd/fpFexAnewwPsO6jGFQUv/24DnO55hY6Xew==',
sonar-# salt='k9x9eN127/3e/hf38iNiKwVfaVk=',
sonar-# hash_method='PBKDF2',
sonar-# reset_password='true',
sonar-# user_local='true',
sonar-# active='true'
sonar-# where login='admin';
UPDATE 1

Okay. So the SQL is successful, but you still can’t log in.

The SQL works to reset the password on my side. Is there any chance there are multiple SonarQube databases in this Postgres database, and you’re targeting the wrong one?