SOLUTION: Upgraded Sonarqube from 9.9.5 to 10.7 and now Jenkins job fails with Token error

We recently upgraded our SonarQube Community Edition from 9.9.5 to 10.7

The application opens fine and no errors in the logs. However, a subsequent test of Jenkins jobs after the upgrade produces the following error.

The token you provided doesn’t have sufficient rights to check license

We created a new API token for the service account and applied in Jenkins, but the job still fails.

Then we elevated the permissions of service account to Admin of project/gates and Execute analysis, then created a new token, but it still fails.

Rolled back to the previous version (9.9.5) of SonarQube and restored original API key in Jenkins and the Jenkins job works. So, I am wondering if perhaps I missed something in the upgrade process. Because I didn’t find and obvious errors in the SonarQube logs and didn’t see anything in the upgrade release notes.

Hello ,

I faced something similar while moving from 9.9 to 10.X versions. You might not have same exact reason but it’s worth investigating.

Sonar plugin configured in Jenkins still sends sonar.login as env variables in Jenkins build. In our cases this env variable was overriding token that i was passing in the build.

To make sure this is not causing problems , Try passing new token as sonar.login instead of sonar.token.

https://issues.jenkins.io/browse/JENKINS-71057

2 Likes

Hi,

You don’t mention the underlying scanner, but this thread may also be relevant.

 
HTH,
Ann

Thank you Manish!! - it was the SONAR.LOGIN as you mentioned. Issue is resolved.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.