Sonarqube fresh install can't log in

  • SonarQube 9.9 LTS Community Edition
  • Setup Via Zip
  • Reset Admin/Admin, Assign User Role to Admin. Reinstall

Hi, I have spun up a AWS Instance and setup Sonarqube 9.9 LTS Community Edition with a PGSQL connection. When I try to use the default login admin/admin it redirects back to the login screen. I can see in the networks tab 401 Unauthorized for Current, Global and List.

Following error shows in the console
outDUFI7UAQ.js:1031 Application failed to start Response {type: ‘basic’, url: ‘http://3.94.106.255:9000/api/users/current’, redirected: false, status: 401, ok: false, …}

I have tried to update the admin user as per documentation using

UPDATE users
SET crypted_password='100000$t2h8AtNs1AlCHuLobDjHQTn9XppwTIx88UjqUm4s8RsfTuXQHSd/fpFexAnewwPsO6jGFQUv/24DnO55hY6Xew==',
    salt='k9x9eN127/3e/hf38iNiKwVfaVk=',
    hash_method='PBKDF2',
    reset_password='true',
    user_local='true',
    active='true'
WHERE login = 'admin';

and also set a user_role for the admin.

INSERT INTO user_roles(uuid, user_uuid, role)
VALUES (uuid_generate_v4(),
        (select uuid from users where login='admin'),
        'admin');

There is also no proxy in front of it.

I have seen here some communications that seem similar. But the solution suggested was to either upgrade, or the issue has been resolved but not how they have resolved it…

I have tried versions 10.2 and spun up yesterday 9.9 LTS. I have it working in my local using Docker but I have no clue as to why I cant login into the AWS setup.

The log is set to debug and I see in the

web.log

2023.11.14 12:08:32 DEBUG web[AYvNu17q9PHDM0S1AAAZ][auth.event] login failure [cause|User must be authenticated][method|BASIC][provider|LOCAL|local][IP|104.53.173.244|][login|]

sonar.log

2023.11.14 12:06:36 DEBUG app[][o.s.a.p.ManagedProcessLifecycle] EventWatcher[Web Server] tryToMoveTo Compute Engine from STARTING to STARTED => true
2023.11.14 12:06:37 WARN  app[][startup] ####################################################################################################################
2023.11.14 12:06:37 WARN  app[][startup] Default Administrator credentials are still being used. Make sure to change the password or deactivate the account.
2023.11.14 12:06:37 WARN  app[][startup] ####################################################################################################################
2023.11.14 12:06:42 INFO  app[][o.s.a.SchedulerImpl] Process[ce] is up
2023.11.14 12:06:42 DEBUG app[][o.s.a.p.ManagedProcessLifecycle] EventWatcher[Compute Engine] tryToMoveTo ElasticSearch from STARTED to STARTING => false
2023.11.14 12:06:42 DEBUG app[][o.s.a.p.ManagedProcessLifecycle] EventWatcher[Compute Engine] tryToMoveTo Web Server from STARTED to STARTING => false
2023.11.14 12:06:42 DEBUG app[][o.s.a.p.ManagedProcessLifecycle] EventWatcher[Compute Engine] tryToMoveTo Compute Engine from STARTED to STARTING => false
2023.11.14 12:06:42 DEBUG app[][o.s.a.NodeLifecycle] EventWatcher[Compute Engine] tryToMoveTo from STARTING to OPERATIONAL => true
2023.11.14 12:06:42 INFO  app[][o.s.a.SchedulerImpl] SonarQube is operational

While Elastic Search, Compute Engine and Webserver state from started to starting = false. I do see logs comming in from all three and the web server is up and running as I can see the login screen.

I don;t understand why I can’ t login and would really appreciate your help.

Hi,

for anyone having the same issue and running across this post the issue for me was that the login page required SSL. Once I setup a self signed SSL certificate. The login worked.

That being said I am setting this instance up as a test and therefore a self-signed certificate will suffice. In a real-world application, I do not recommend setting up a self-signed certificate.

1 Like