SonarQube 9.9.2 - Authorization issue, azure devops

Sonarqube for last 6 months is failing with below issue,

##[error]ERROR: Error during SonarScanner execution

ERROR: You’re not authorized to run analysis. Please contact the project administrator.

ERROR:

ERROR: Error during SonarScanner execution

ERROR: You’re not authorized to run analysis. Please contact the project administrator.

ERROR:

##[error]The SonarScanner did not complete successfully

Last time it worked was under the version 9.4. Soon after the upgrade we are facing this issue.

We already opened a support ticket with SonarQube technician, we followed everythig they said but no luck yet.

What we did:

  1. Created a Global analysis token and paste that token inside the Azure service connection.
  2. Also did the Devops Platform Integrations with Azure Devops by generating the Personal Access Token
  3. Turned on the Executed anlaysis for the user who created the Global Analysis token.
  4. Also tuned on the execute analysis for the individual project as well.

When I see the logs from Azure devops,

SonarQube Scanner Parameters before: {“sonar.host.url”:“https://sonarqube-api.xxx.com/“,“sonar.login”:***,“sonar.projectKey”:“EnterpriseApps-GEDB.UI”,“sonar.projectVersion”:“458407”,“sonar.branch.name”:“sonarqube”,“sonar.scanner.metadataFilePath”:”/home/vsts/work/_temp/sonar/458407/9c05121c-0fa1-a7a2-94f1-529d7657063b/report-task.txt",“sonar.tsql.file.suffixes”:“sql,tsql”,“sonar.plsql.file.suffixes”:“pks,pkb”,“sonar.dependencyCheck.htmlReportPath”:“/home/vsts/work/1/TestResults/dependency-check/dependency-check-report.html”,“sonar.dependencyCheck.jsonReportPath”:“/home/vsts/work/1/TestResults/dependency-check/dependency-check-report.json”,“sonar.dependencyCheck.xmlReportPath”:“/home/vsts/work/1/TestResults/dependency-check/dependency-check-report.xml”,“sonar.scm.provider”:“git”,“sonar.projectBaseDir”:“/home/vsts/work/1/s”,"sonar.token”:***}

I read in a forum, it states that sonar.login is deprecated but still I see in the log that its getting passed.

I manually passed the sonar.token in the extra properties as well

Pipeline:

task: SonarQubePrepare@5
displayName: ‘Prepare analysis on SonarQube’
inputs:
SonarQube: SonarQube-Test
scannerMode: MSBuild
projectKey: EnterpriseApps-XXXX.UI
projectVersion: $(Build.BuildId)
extraProperties:
sonar.token=sqa_xxxxxxxxxxxxxxx6785f3

Is Someone facing the similar issue, we been stuck with this for long time. Can someone please help?

Hi,

Welcome to the community!

The error you’ve been seeing for the last 6 months(?! :scream:) indicates that the token you’re passing with analysis is from an account that doesn’t have analysis permissions on the project.

But if you’ve got access to our professional Support Engineers, you should really continue working with them.

 
HTH,
Ann