Help required for Jenkins to SonarQube integration

My Sonarqube version is SonarQube server 7.8.0
SonarQube Scanner 4.0.0.1744
Java 11.0.3 AdoptOpenJDK (64-bit)

Am integrating SonarQube into Jenkins.
I have defined everything it relates to in .sonar.scanner properties and .sonar.project.properties and set all the configuration accordingly.

I could able to see that my jenkins is hitting sonarqube but unable to produce the results to my src code.

please find below error and kindly help

C:\Program Files\Git\bin\git.exe rev-list --no-walk 662d01f0e8b618d0b8711dfd40c976bb56886f15 # timeout=10
[sonar_test2] $ “C:\Program Files\sonar-scanner-4.0.0.1744-windows\bin\sonar-scanner.bat” “sonar running” -X -D/d:sonar.verbose=true -Dsonar.host.url=http://localhost:9000/sonar ******** -Dsonar.Sources=C:Usersvenugp3.jenkinsworkspacesonar_test2 -Dsonar.language=java,CSS,XML,HTML -Dsonar.ProjectVersion=1.0 -Dsonar.ProjectKey=sonartest -Dsonar.host.url=http://localhost:9000 -Dsonar.login=admin -Dsonar.java.binaries=. -Dsonar.ProjectName=sonartest -Dsonar.password=admin -Dsonar.projectBaseDir=C:\Users\venugp3.jenkins\workspace\sonar_test2
12:37:08.836 INFO: Scanner configuration file: C:\Program Files\sonar-scanner-4.0.0.1744-windows\bin..\conf\sonar-scanner.properties
12:37:08.853 INFO: Project root configuration file: C:\Users\venugp3.jenkins\workspace\sonar_test2\sonar-project.properties
12:37:09.070 INFO: SonarQube Scanner 4.0.0.1744
12:37:09.070 INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
12:37:09.070 INFO: Windows 10 10.0 amd64
12:37:09.941 DEBUG: keyStore is :
12:37:09.941 DEBUG: keyStore type is : pkcs12
12:37:09.942 DEBUG: keyStore provider is :
12:37:09.942 DEBUG: init keystore
12:37:09.947 DEBUG: init keymanager of type SunX509
12:37:10.868 DEBUG: Create: C:\Users\venugp3.sonar\cache
12:37:10.869 INFO: User cache: C:\Users\venugp3.sonar\cache
12:37:10.869 DEBUG: Create: C:\Users\venugp3.sonar\cache_tmp
12:37:10.881 DEBUG: Extract sonar-scanner-api-batch in temp…
12:37:10.900 DEBUG: Get bootstrap index…
12:37:10.900 DEBUG: Download: http://localhost:9000/batch/index
12:37:11.055 DEBUG: Get bootstrap completed
12:37:12.477 DEBUG: Create isolated classloader…
12:37:12.549 DEBUG: Start temp cleaning…
12:37:12.571 DEBUG: Temp cleaning done
12:37:12.572 DEBUG: Execution getVersion
12:37:12.619 INFO: SonarQube server 7.8.0
12:37:12.629 DEBUG: Execution execute
12:37:13.917 DEBUG: Community 7.8.0.26217
12:37:14.091 INFO: Load global settings
12:37:14.805 DEBUG: GET 200 http://localhost:9000/api/settings/values.protobuf | time=705ms
12:37:14.860 INFO: Load global settings (done) | time=769ms
12:37:14.862 INFO: Server id: BF41A1F2-AWuShYJKp6k-GpuZ5yuV
12:37:14.879 INFO: User cache: C:\Users\venugp3.sonar\cache
12:37:14.883 INFO: Load/download plugins
12:37:14.884 INFO: Load plugins index
12:37:15.515 DEBUG: GET 200 http://localhost:9000/api/plugins/installed | time=631ms
12:37:15.626 INFO: Load plugins index (done) | time=742ms
12:37:21.651 INFO: Load/download plugins (done) | time=6768ms
12:37:21.787 DEBUG: Plugins:
12:37:21.799 DEBUG: * SonarPython 1.14.0.3086 (python)
12:37:21.802 DEBUG: * SonarCSS 1.1.0.993 (cssfamily)
12:37:21.803 DEBUG: * GitHub Authentication for SonarQube 1.5.0.870 (authgithub)
12:37:21.804 DEBUG: * JaCoCo 1.0.1.143 (jacoco)
12:37:21.806 DEBUG: * SonarGo 1.1.1.2000 (go)
12:37:21.807 DEBUG: * SonarKotlin 1.5.0.315 (kotlin)
12:37:21.808 DEBUG: * Svn 1.9.0.1295 (scmsvn)
12:37:21.809 DEBUG: * SonarJS 5.2.1.7778 (javascript)
12:37:21.809 DEBUG: * SonarRuby 1.5.0.315 (ruby)
12:37:21.809 DEBUG: * SonarScala 1.5.0.315 (sonarscala)
12:37:21.809 DEBUG: * SonarC# 7.14.0.8411 (csharp)
12:37:21.810 DEBUG: * SonarJava 5.13.0.18197 (java)
12:37:21.810 DEBUG: * LDAP 2.2.0.608 (ldap)
12:37:21.810 DEBUG: * SonarHTML 3.1.0.1615 (web)
12:37:21.810 DEBUG: * Git 1.8.0.1574 (scmgit)
12:37:21.811 DEBUG: * SonarFlex 2.4.0.1222 (flex)
12:37:21.811 DEBUG: * SonarXML 2.0.1.2020 (xml)
12:37:21.811 DEBUG: * SAML 2.0 Authentication for SonarQube 1.1.0.181 (authsaml)
12:37:21.811 DEBUG: * SonarPHP 3.1.1.4762 (php)
12:37:21.811 DEBUG: * SonarTS 1.9.0.3766 (typescript)
12:37:21.812 DEBUG: * SonarVB 7.14.0.8411 (vbnet)
12:37:21.911 INFO: ------------------------------------------------------------------------
12:37:21.911 INFO: EXECUTION FAILURE
12:37:21.912 INFO: ------------------------------------------------------------------------
12:37:21.912 INFO: Total time: 13.257s
12:37:21.965 INFO: Final Memory: 4M/24M
12:37:21.966 INFO: ------------------------------------------------------------------------
12:37:21.966 ERROR: Error during SonarQube Scanner execution
Tasks support was removed in SonarQube 7.6.
ERROR: SonarQube scanner exited with non-zero code: 1
Finished: FAILURE

Hi,

from what is found here Search results for 'Tasks support was removed' - Sonar Community, it seems your commandline is wrong.

-D/d:sonar.verbose=true seems wrong, should be -Dsonar.verbose=true

Gilbert

Hi Guys, It was by mistake i have provided sonarqube port number as 9090 where it should be 9000.

Now when i ran again, i got the below . Please find log below and advise.

C:\Program Files\Git\bin\git.exe rev-list --no-walk 662d01f0e8b618d0b8711dfd40c976bb56886f15 # timeout=10
[sonar_test2] $ “C:\Program Files\sonar-scanner-4.0.0.1744-windows\bin\sonar-scanner.bat” “sonar running” -X -D/d:sonar.verbose=true -Dsonar.host.url=http://localhost:9000/sonar ******** -Dsonar.Sources=C:Usersvenugp3.jenkinsworkspacesonar_test2hybris -Dsonar.language=java,CSS,XML,HTML -Dsonar.ProjectVersion=1.0 -Dsonar.ProjectKey=sonartest -Dsonar.host.url=http://localhost:9000 -Dsonar.login=admin -Dsonar.java.binaries=. -Dsonar.ProjectName=sonartest -Dsonar.password=admin -Dsonar.projectBaseDir=C:\Users\venugp3.jenkins\workspace\sonar_test2
13:01:37.960 INFO: Scanner configuration file: C:\Program Files\sonar-scanner-4.0.0.1744-windows\bin..\conf\sonar-scanner.properties
13:01:37.964 INFO: Project root configuration file: C:\Users\venugp3.jenkins\workspace\sonar_test2\sonar-project.properties
13:01:37.997 INFO: SonarQube Scanner 4.0.0.1744
13:01:37.997 INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
13:01:37.997 INFO: Windows 10 10.0 amd64
13:01:38.162 DEBUG: keyStore is :
13:01:38.162 DEBUG: keyStore type is : pkcs12
13:01:38.162 DEBUG: keyStore provider is :
13:01:38.162 DEBUG: init keystore
13:01:38.163 DEBUG: init keymanager of type SunX509
13:01:38.539 DEBUG: Create: C:\Users\venugp3.sonar\cache
13:01:38.541 INFO: User cache: C:\Users\venugp3.sonar\cache
13:01:38.541 DEBUG: Create: C:\Users\venugp3.sonar\cache_tmp
13:01:38.546 DEBUG: Extract sonar-scanner-api-batch in temp…
13:01:38.553 DEBUG: Get bootstrap index…
13:01:38.553 DEBUG: Download: http://localhost:9000/batch/index
13:01:38.629 DEBUG: Get bootstrap completed
13:01:38.637 DEBUG: Create isolated classloader…
13:01:38.671 DEBUG: Start temp cleaning…
13:01:38.683 DEBUG: Temp cleaning done
13:01:38.683 DEBUG: Execution getVersion
13:01:38.701 INFO: SonarQube server 7.8.0
13:01:38.704 DEBUG: Execution execute
13:01:39.385 DEBUG: Community 7.8.0.26217
13:01:39.544 INFO: Load global settings
13:01:40.094 DEBUG: GET 200 http://localhost:9000/api/settings/values.protobuf | time=547ms
13:01:40.133 INFO: Load global settings (done) | time=589ms
13:01:40.134 INFO: Server id: BF41A1F2-AWuShYJKp6k-GpuZ5yuV
13:01:40.158 INFO: User cache: C:\Users\venugp3.sonar\cache
13:01:40.163 INFO: Load/download plugins
13:01:40.163 INFO: Load plugins index
13:01:40.547 DEBUG: GET 200 http://localhost:9000/api/plugins/installed | time=384ms
13:01:40.596 INFO: Load plugins index (done) | time=433ms
13:01:40.710 INFO: Load/download plugins (done) | time=547ms
13:01:40.840 DEBUG: Plugins:
13:01:40.840 DEBUG: * SonarPython 1.14.0.3086 (python)
13:01:40.840 DEBUG: * SonarCSS 1.1.0.993 (cssfamily)
13:01:40.840 DEBUG: * GitHub Authentication for SonarQube 1.5.0.870 (authgithub)
13:01:40.841 DEBUG: * JaCoCo 1.0.1.143 (jacoco)
13:01:40.841 DEBUG: * SonarGo 1.1.1.2000 (go)
13:01:40.841 DEBUG: * SonarKotlin 1.5.0.315 (kotlin)
13:01:40.841 DEBUG: * Svn 1.9.0.1295 (scmsvn)
13:01:40.841 DEBUG: * SonarJS 5.2.1.7778 (javascript)
13:01:40.842 DEBUG: * SonarRuby 1.5.0.315 (ruby)
13:01:40.842 DEBUG: * SonarScala 1.5.0.315 (sonarscala)
13:01:40.842 DEBUG: * SonarC# 7.14.0.8411 (csharp)
13:01:40.842 DEBUG: * SonarJava 5.13.0.18197 (java)
13:01:40.842 DEBUG: * LDAP 2.2.0.608 (ldap)
13:01:40.842 DEBUG: * SonarHTML 3.1.0.1615 (web)
13:01:40.843 DEBUG: * Git 1.8.0.1574 (scmgit)
13:01:40.843 DEBUG: * SonarFlex 2.4.0.1222 (flex)
13:01:40.843 DEBUG: * SonarXML 2.0.1.2020 (xml)
13:01:40.843 DEBUG: * SAML 2.0 Authentication for SonarQube 1.1.0.181 (authsaml)
13:01:40.843 DEBUG: * SonarPHP 3.1.1.4762 (php)
13:01:40.843 DEBUG: * SonarTS 1.9.0.3766 (typescript)
13:01:40.843 DEBUG: * SonarVB 7.14.0.8411 (vbnet)
13:01:40.909 INFO: ------------------------------------------------------------------------
13:01:40.909 INFO: EXECUTION FAILURE
13:01:40.909 INFO: ------------------------------------------------------------------------
13:01:40.910 INFO: Total time: 2.974s
13:01:40.931 INFO: Final Memory: 4M/27M
13:01:40.932 INFO: ------------------------------------------------------------------------
13:01:40.932 ERROR: Error during SonarQube Scanner execution
Tasks support was removed in SonarQube 7.6.
ERROR: SonarQube scanner exited with non-zero code: 1
Finished: FAILURE

Hi,

Welcome to the community!

This message:

Indicates that there is something on the command line that the scanner sees as an argument ( as opposed to a -D parameter). Looking at your command line

If I remove all the -D parameters, I get this:

$ “C:\Program Files\sonar-scanner-4.0.0.1744-windows\bin\sonar-scanner.bat” “sonar running” -X

The -X is a recognized flag, so that leaves this:

$ “C:\Program Files\sonar-scanner-4.0.0.1744-windows\bin\sonar-scanner.bat” “sonar running”

And now we’ve isolated the unrecognized argument:

“sonar running”

Drop that from your command and you should be fine.

 
HTH,
Ann

Hello. Thanks for your prompt responses.
However, my parameters were defined as below. I didn’t mentioned -D anywhere but not sure in logs how come it is coming with -D.

Please find my parameters as defined as properties,

sonar.ProjectKey=sonartest
sonar.ProjectName=sonartest
sonar.ProjectVersion=1.0
sonar.Sources=C:\Users\venugp3.jenkins\workspace\sonar_test2\hybris
sonar.java.binaries=.
sonar.language=java,CSS,XML,HTML
sonar.host.url=http://localhost:9000
sonar.login=xxx
sonar.password=xxx

Not sure what could be the reason for the failure.
Any help would be highly appreciated,