sonarqubesonarqube-scan

Not authorized to execute any sonarqube analysis with sonarqube scanner on Travis CI


I recently started using Travis CI and sonarqube in an open source project and have run into a problem with sonarqube-scanner.

My Travis CI page can be seen here: https://travis-ci.org/uglyoldbob/decompiler

My sonarqube page can be seen here: https://sonarqube.com/overview?id=uglyoldbob_decompiler

I'm running sonarqube-scanner on Travis CI it suddenly stopped working with the following error:

"ERROR: You're not authorized to execute any SonarQube analysis. Please contact your SonarQube administrator."

I am using a token generated on sonarqube and have added it to the environment variables of Travis CI. I generated a new token when I noticed the problem and updated the environment variable with Travis but it did not change anything.

What can I do to fix this?


Solution

  • In General: You need to pass a user token from an account with analysis permissions in your analysis parameters. Use the sonar.login property to do it.

    Specifically: I see from your travis log that you are passing what looks like a user token in the sonar.login property. However you are passing it to sonar.host.url=http://nemo.sonarqube.org. You need to change this to https://sonarqube.com