skip to Main Content

I’ve installed sonarqube using docker:

docker run -d --name sonarqube -p 9000:9000 sonarqube:lts-community

It runs successfully and when I login to it via https://my-sonar.something/ and admin/admin creds, I’m redirected to the password reset page which is fine. BUT:

when I reset the password, it doesn’t accept it, and it throws a 401 error and then forwards me to the login page again without changing the password.

enter image description here

I’ve tried to use other sonar images, but that wasn’t the issue.

I’ve Nginx in front of my sonar instance as a reverse proxy, but there is no much there:

server {
    listen 443 ssl;

        include /etc/nginx/includes/ssl.conf;
        server_name  sonarqube.cool;
        error_log /var/log/nginx/sonarqube.error.log warn;
        access_log /var/log/nginx/sonarqube.access.log upstream_time;

    location / {

        proxy_pass http://some-ip-address:9000/;

    }
}

4

Answers


  1. Chosen as BEST ANSWER

    I've found a workaround that solved my issue for now.

    I've called the API directly from the server. like:

    curl -vu admin:admin -X POST "http://localhost:9000/api/users/change_password?login=admin&previousPassword=admin&password=MyNewPassword"
    

    and it succeeded, now I'm not redirected to the reset password page anymore.


  2. The error was from another Nginx configuration "in front of my Nginx conf above" used as SSL termination.

    Anyway, I was setting HTTPOnly in proxy_cookie_path inside Nginx conf. removing it solved the issue.

    https://community.sonarsource.com/t/sonarqube-logs-me-out-on-any-save-operation/8837/12?u=raedshari

    Login or Signup to reply.
  3. Same problem. Solved by disabling my browsers adblocker.

    Login or Signup to reply.
  4. In my case, the issue was that some of the obsolete cookies (that stayed for the domain where my sonarqube was running) were obviously used for authentication.
    Simply try to clear all the cookies and retry.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search