Getting Authorization error while integrating sonarqube with Jenkins

Hi Team,

I am trying to integrate sonarqube with Jenkins but I am getting Authorization error while running the sonarqube scanner analysis. I am making the sonarqube server up manually and then trying to run the Jenkins job for sonarscannar analysis(here I am getting authorization issue)

Below are the versions that I am using

image

|Jenkins Version|2.190.3|
|SonarQube Version|7.9.2|
|Sonarqube Scanner Version|4.2.0.1873|
|SonarQube for Jenkins plugin version|2.11|

I have created a user in sonarqube and created the secret token for it. I have passed the secret token in jenkins configuire section. Also execute analysis permissions have been given to this user in sonarqube.

Command that I am using to run jenkins is

java -Dsonar.login=**** -Dsonar.password=**** -jar jenkins.war --httpPort=9091

Please find below the error logs extracted from Jenkins console output

Running as SYSTEM Building in workspace C:\Users\myusername\.jenkins\workspace\SonarAnalysis [SonarAnalysis] $ C:\Users\myusername\Desktop\SonarQube\sonar-scanner-cli-4.2.0.1873-windows\sonar-scanner-4.2.0.1873-windows\bin\sonar-scanner.bat -Dsonar.login=**** -Dsonar.password=**** -Dsonar.host.url=http://localhost:9000 ******** “-Dproject.settings=C:\Users\myusername\Desktop\Development Code\WebClient\sonar-project.properties” -Dsonar.projectBaseDir=C:\Users\myusername\.jenkins\workspace\SonarAnalysis INFO: Scanner configuration file: C:\Users\myusername\Desktop\SonarQube\sonar-scanner-cli-4.2.0.1873-windows\sonar-scanner-4.2.0.1873-windows\bin…\conf\sonar-scanner.properties INFO: Project root configuration file: C:\Users\myusername\Desktop\Development Code\WebClient\sonar-project.properties INFO: SonarQube Scanner 4.2.0.1873 INFO: Java 11.0.3 AdoptOpenJDK (64-bit) INFO: Windows 10 10.0 amd64 INFO: User cache: C:\Users\myusername.sonar\cache INFO: SonarQube server 7.9.2 INFO: Default locale: “en_US”, source code encoding: “windows-1252” (analysis is platform dependent) INFO: Load global settings INFO: ------------------------------------------------------------------------ INFO: EXECUTION FAILURE INFO: ------------------------------------------------------------------------ INFO: Total time: 6.227s INFO: Final Memory: 4M/20M INFO: ------------------------------------------------------------------------ ERROR: Error during SonarQube Scanner execution ERROR: Not authorized. Please check the properties sonar.login and sonar.password. ERROR: ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging. WARN: Unable to locate ‘report-task.txt’ in the workspace. Did the SonarScanner succeeded? ERROR: SonarQube scanner exited with non-zero code: 1 Finished: FAILURE