automatic configuration.
09:24:44 INFO: Load branch configuration (done) | time=1ms
09:24:44 INFO: Auto-configuring with CI 'Jenkins'
09:24:44 INFO: Load quality profiles
09:24:45 INFO: Load quality profiles (done) | time=350ms
09:24:45 INFO: Auto-configuring with CI 'Jenkins'
09:24:45 INFO: Load active rules
09:24:57 INFO: Load active rules (done) | time=11335ms
09:24:57 INFO: Branch name: feature/Update-sonarqube
09:24:57 INFO: Indexing files...
09:24:57 INFO: Project configuration:
09:24:57 INFO: Excluded sources: /**/*java, client/tests/**/*, targets, client/security/820sconfig/**/*, client/3rdparty/**/*, /**/*.ts, client/simulator/**/*
09:24:57 INFO: ------------------------------------------------------------------------
09:24:57 INFO: EXECUTION FAILURE
09:24:57 INFO: ------------------------------------------------------------------------
09:24:57 INFO: Total time: 15.792s
09:24:57 INFO: Final Memory: 8M/80M
09:24:57 INFO: ------------------------------------------------------------------------
09:24:57 ERROR: Error during SonarScanner execution
09:24:57 ERROR: Language of file 'client/common/datalistener.h' can not be decided as the file matches patterns of both sonar.lang.patterns.cov-cpp : **/*.cpp,**/*.cc,**/*.c++,**/*.cp,**/*.cxx,**/*.c,**/*.hxx,**/*.hpp,**/*.hh,**/*.h,**/*.m,**/*.mm and sonar.lang.patterns.c : **/*.c,**/*.h
09:24:57 ERROR:
09:24:57 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
Try to fix the issue
Per the message:
ERROR: Language of file 'client/common/datalistener.h' can not be decided as the file matches patterns of both
sonar.lang.patterns.cov-cpp : **/*.cpp,**/*.cc,**/*.c++,**/*.cp,**/*.cxx,**/*.c,**/*.hxx,**/*.hpp,**/*.hh,**/*.h,**/*.m,**/*.mm and
sonar.lang.patterns.c : **/*.c,**/*.h
That means you have to go to: ${SONARURL}/admin/settings?category=languages, under Administration | Languages, pick the appropriate Language option and adjust the duplicate language "file suffixes" according to your needs. Or remove the extra plugin.
Related
i'm getting the above error eventhoug it has all the properties. all the sonar properties defined in -Dsettings=./sonar-project.properties file. still getting the same error.
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (sonarqube analysis)
[Pipeline] withSonarQubeEnv Injecting SonarQube environment variables using the configuration: sonar
[Pipeline] {
[Pipeline] sh
+ /var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonar/bin/sonar-scanner -
Dproject.settings=./sonar-project.properties
INFO: Scanner configuration file:
/var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonar/conf/sonar-
scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.6.2.2472
INFO: Java 1.8.0_292 AdoptOpenJDK (64-bit)
INFO: Linux 3.10.0-1160.24.1.el7.x86_64 amd64
INFO: User cache: /var/jenkins_home/.sonar/cache
INFO: Scanner configuration file:
/var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonar/conf/sonar-
scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarQube server 7.5.0
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Publish mode
INFO: Load global settings
INFO: Load global settings (done) | time=122ms
INFO: Server id: BF41A1F2-AXjqWPPbWWxxqvtkaXSc
INFO: User cache: /var/jenkins_home/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=60ms
INFO: Load/download plugins (done) | time=1203ms
INFO: Loaded core extensions:
INFO: Process project properties
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 4.114s
INFO: Final Memory: 11M/219M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: You must define the following mandatory properties for 'Unknown': sonar.projectKey,
sonar.sources
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
[Pipeline] }
WARN: Unable to locate 'report-task.txt' in the workspace. Did the 'SonarScanner' succeed?
[Pipeline] // 'withSonarQubeEnv'
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // 'withEnv'
[Pipeline] }
[Pipeline] // 'withEnv'
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 2
Finished: FAILURE
Shell Script -- ${scannerHome}/bin/sonar-scanner -Dproject.settings=./sonar-project.properties (self time 2s)
/var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonar/bin/sonar-scanner -Dproject.settings=./sonar-project.properties
INFO: Scanner configuration file: /var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonar/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.6.2.2472
INFO: Java 1.8.0_292 AdoptOpenJDK (64-bit)
INFO: Linux 3.10.0-1160.24.1.el7.x86_64 amd64
INFO: User cache: /var/jenkins_home/.sonar/cache
INFO: Scanner configuration file: /var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonar/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarQube server 8.9.0
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
WARN: SonarScanner will require Java 11 to run, starting in SonarQube 9.x
INFO: Load global settings
INFO: Load global settings (done) | time=90ms
INFO: Server id: BF41A1F2-AXl0u-SQAyVEzukSwxVv
INFO: User cache: /var/jenkins_home/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=51ms
INFO: Load/download plugins (done) | time=92ms
INFO: Process project properties
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1.837s
INFO: Final Memory: 9M/125M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: You must define the following mandatory properties for 'Unknown': sonar.projectKey
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
I am trying to learn the basics of sonarqube, I have set it up on my jenkins pipeline (which uses MSBuild to compile the project) and the set a step to execute SonarQube but after reading and watching a few tutorials and the documentation itself I think I got a bit lost as when my pipeline finishes executing I go to my SonarQube server and I my project says The main branch has no lines of code.. I get the following log when running the sonarqube step on my jenkins:
00:10:43.369 Injecting SonarQube environment variables using the configuration: SonarQube
[Pipeline] {
[Pipeline] bat
00:10:43.653
00:10:43.653 C:\Users\anton\.jenkins\workspace\Boston>C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\sonar-scanner.bat
00:10:43.653 INFO: Scanner configuration file: C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
00:10:43.653 INFO: Project root configuration file: NONE
00:10:43.653 INFO: SonarScanner 4.4.0.2170
00:10:43.653 INFO: Java 1.8.0_261 Oracle Corporation (64-bit)
00:10:43.653 INFO: Windows 10 10.0 amd64
00:10:44.230 INFO: User cache: C:\WINDOWS\system32\config\systemprofile\.sonar\cache
00:10:44.230 INFO: Scanner configuration file: C:\Users\anton\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\Sonnar_scanner\sonar-scanner-4.4.0.2170\bin\..\conf\sonar-scanner.properties
00:10:44.230 INFO: Project root configuration file: NONE
00:10:44.230 INFO: Analyzing on SonarQube server 8.5.1
00:10:44.230 INFO: Default locale: "es_ES", source code encoding: "UTF-8"
00:10:44.783 WARN: SonarScanner will require Java 11 to run starting in SonarQube 8.x
00:10:44.784 INFO: Load global settings
00:10:44.784 INFO: Load global settings (done) | time=40ms
00:10:44.784 INFO: Server id: BF41A1F2-AXWnoupqHjnRwWgEnmvK
00:10:44.784 INFO: User cache: C:\WINDOWS\system32\config\systemprofile\.sonar\cache
00:10:44.784 INFO: Load/download plugins
00:10:44.784 INFO: Load plugins index
00:10:44.784 INFO: Load plugins index (done) | time=26ms
00:10:44.784 INFO: Load/download plugins (done) | time=48ms
00:10:45.037 INFO: Process project properties
00:10:45.037 INFO: Process project properties (done) | time=6ms
00:10:45.037 INFO: Execute project builders
00:10:45.037 INFO: Execute project builders (done) | time=1ms
00:10:45.037 INFO: Project key: Boston
00:10:45.037 INFO: Base dir: C:\Users\anton\.jenkins\workspace\Boston
00:10:45.037 INFO: Working dir: C:\Users\anton\.jenkins\workspace\Boston\.scannerwork
00:10:45.301 INFO: Load project settings for component key: 'Boston'
00:10:45.301 INFO: Load project settings for component key: 'Boston' (done) | time=10ms
00:10:45.301 INFO: Load quality profiles
00:10:45.301 INFO: Load quality profiles (done) | time=27ms
00:10:45.301 INFO: Auto-configuring with CI 'Jenkins'
00:10:45.301 INFO: Load active rules
00:10:46.241 INFO: Load active rules (done) | time=787ms
00:10:46.241 INFO: Indexing files...
00:10:46.241 INFO: Project configuration:
00:10:46.241 INFO: 0 files indexed
00:10:46.241 INFO: ------------- Run sensors on module Boston
00:10:46.241 INFO: Load metrics repository
00:10:46.241 INFO: Load metrics repository (done) | time=12ms
00:10:46.807 INFO: Sensor CSS Rules [cssfamily]
00:10:46.807 INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
00:10:46.807 INFO: Sensor CSS Rules [cssfamily] (done) | time=1ms
00:10:46.807 INFO: Sensor JaCoCo XML Report Importer [jacoco]
00:10:46.807 INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
00:10:46.807 INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
00:10:46.807 INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1ms
00:10:46.807 INFO: Sensor C# Properties [csharp]
00:10:46.807 INFO: Sensor C# Properties [csharp] (done) | time=1ms
00:10:46.807 INFO: Sensor JavaXmlSensor [java]
00:10:46.807 INFO: Sensor JavaXmlSensor [java] (done) | time=0ms
00:10:46.807 INFO: Sensor VB.NET Properties [vbnet]
00:10:46.807 INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
00:10:46.807 INFO: ------------- Run sensors on project
00:10:46.807 INFO: Sensor Zero Coverage Sensor
00:10:46.807 INFO: Sensor Zero Coverage Sensor (done) | time=0ms
00:10:46.807 INFO: SCM Publisher is disabled
00:10:46.807 INFO: CPD Executor Calculating CPD for 0 files
00:10:46.807 INFO: CPD Executor CPD calculation finished (done) | time=0ms
00:10:46.807 INFO: Analysis report generated in 48ms, dir size=82 KB
00:10:46.807 INFO: Analysis report compressed in 10ms, zip size=10 KB
00:10:47.060 INFO: Analysis report uploaded in 26ms
00:10:47.060 INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=Boston
00:10:47.060 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
00:10:47.060 INFO: More about the report processing at http://localhost:9000/api/ce/task?id=AXWt8eSC9o0F9NdVJGJP
00:10:47.060 INFO: Executing post-job 'Final report'
00:10:47.060 INFO: Turn debug info on to get more details (sonar-scanner -X -Dsonar.verbose=true ...).
00:10:47.060 INFO: Analysis total time: 2.118 s
00:10:47.060 INFO: ------------------------------------------------------------------------
00:10:47.060 INFO: EXECUTION SUCCESS
00:10:47.060 INFO: ------------------------------------------------------------------------
00:10:47.060 INFO: Total time: 3.274s
00:10:47.060 INFO: Final Memory: 21M/549M
00:10:47.060 INFO: ------------------------------------------------------------------------
[Pipeline] }
[Pipeline] // withSonarQubeEnv
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
and I think the main issue is the line where it says Project root configuration file: NONE I have created a sonar-project.properties file in the root folder of my project and it has the following configuration:
sonar.projectKey=Boston
sonar.projectName=Boston
sonar.dotnet.visualStudio.solution=Age3DE.sln
sonar.scm.disabled=true
sonar.sources=./Source
sonar.language=c++
sonar.sourceEncoding=UTF-8
But yet I cannot make it work. I do not know what I am doing wrong, should the sonar-project.properties be set anywhere else?
If the source files are present in Sources directory, then your sonar.sources should be like this
sonar.sources=**/Sources/*
Or
sonar.sources=Sources/*
sonar.exclusions parameter is not working for Sonarqube, the sonar.exclusions parameter defined in Jenkins or project setting in SonarQube Server it is not taking effect and scanning all files.
I want to exclude CSS,JS and HTML file scanning from the project for that I defined
sonar.exclusions=**/*.css, **/*.js ,**/*.html
also defined the path with root path with Jenkins workspace like
sonar.exclusions=$WORKSPACE/src/**/*.css, $WORKSPACE/src/**/*.js
still no positive result .
Also defined exclusions in sonarQube sever also
Software Stack
SonarQube:7.9.4-community
Jenkins: 2.235.1
Jenkins-plugin: SonarQubeScanner for Jenkins 2.11
SonarQube Scanner:- 3.0.0.702
The Jenkins console output is the following . what mistake I am making here can someone guide me?
Dsonar.coverage.jacoco.xmlReportPaths=/opt/cloudhost/apps/.jenkins/workspace/TEMP_SONARQUBE_CI_CD_LEMS_BUILD_EXTRA/build/reports/jacoco/test/jacocoTestReport.xml
Dsonar.sources=/opt/cloudhost/apps/.jenkins/workspace/TEMP_SONARQUBE_CI_CD_LEMS_BUILD_EXTRA/src
Dsonar.surefire.reportsPath=/opt/cloudhost/apps/.jenkins/workspace/TEMP_SONARQUBE_CI_CD_LEMS_BUILD_EXTRA/
build/test-results/test "-Dsonar.exclusions=**/*.css, **/*.js , **/*.html" -Dsonar.projectVersion=Octane-137020-SonarQube-Integrations -
Dsonar.java.binaries=/opt/cloudhost/apps/.jenkins/workspace/TEMP_SONARQUBE_CI_CD_LEMS_BUILD_EXTRA/build/c
lasses -Dsonar.projectKey=LEMS_X_Exclude -
Dsonar.junit.reportPaths=/opt/cloudhost/apps/.jenkins/workspace/TEMP_SONARQUBE_CI_CD_LEMS_BUILD_EXTRA/bui
ld/test-results/test
Dsonar.projectBaseDir=/opt/cloudhost/apps/.jenkins/workspace/TEMP_SONARQUBE_CI_CD_LEMS_BUILD_EXTRA
INFO: Scanner configuration file: /opt/cloudhost/apps/.jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQubeScanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 3.0.0.702
INFO: Java 1.8.0_252 Oracle Corporation (64-bit)
INFO: Linux 3.10.0-1127.10.1.el7.x86_64 amd64
INFO: User cache: /home/stlpdapi/.sonar/cache
INFO: SonarQube server 7.9.4
INFO: Default locale: "en_US", source code encoding: "UTF-8"
WARN: SonarScanner will require Java 11 to run starting in SonarQube 8.x
INFO: Load global settings
INFO: Load global settings (done) | time=119ms
INFO: Server id: E2281BAA-AXPWxgc9dGdpV1spT8iU
INFO: User cache: /home/stlpdapi/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=79ms
INFO: Load/download plugins (done) | time=134ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=3ms
INFO: Project key: LEMS_X_Exclude
INFO: Base dir: /opt/cloudhost/apps/.jenkins/workspace/TEMP_SONARQUBE_CI_CD_LEMS_BUILD_EXTRA
INFO: Working dir: /opt/cloudhost/apps/.jenkins/workspace/TEMP_SONARQUBE_CI_CD_LEMS_BUILD_EXTRA/.scannerwork
INFO: Load project settings for component key: 'LEMS_X_Exclude'
INFO: Load project settings for component key: 'LEMS_X_Exclude' (done) | time=22ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=75ms
INFO: Detected Jenkins
INFO: Load active rules
INFO: Load active rules (done) | time=747ms
INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources: **/*.css, **/*.js, **/*.html
INFO: Load project repositories
INFO: Load project repositories (done) | time=44ms
INFO: 1221 files indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for css: Sonar way
INFO: Quality profile for java: Sonar way
INFO: Quality profile for jsp: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: ------------- Run sensors on module LEMS_X_Exclude
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=25ms
INFO: Sensor JavaSquidSensor [java]
INFO: Configured Java source version (sonar.java.source): none
INFO: JavaClasspath initialization
WARN: Bytecode of dependencies was not provided for analysis of source files, you might end up with less precise results. Bytecode can be provided using sonar.java.libraries property.
INFO: JavaClasspath initialization (done) | time=12ms
INFO: JavaTestClasspath initialization
INFO: JavaTestClasspath initialization (done) | time=2ms
INFO: Java Main Files AST scan
INFO: 405 source files to be analyzed
INFO: 28/405 files analyzed, current file: src/main/java/com/mf/pdapi/orm/pojo/SoftwareLicenseStructure.java
INFO: 100/405 files analyzed, current file: src/main/java/com/mf/pdapi/services/pdapi/mappers/response/APGetEntitlementResponseMapper.java
INFO: 168/405 files analyzed, current file: src/main/java/com/mf/pdapi/web/controller/IndexController.java
INFO: 206/405 files analyzed, current file: src/main/java/com/mf/pdapi/web/controller/licensePanination/LicenseController.java
INFO: 258/405 files analyzed, current file: src/main/java/com/mf/pdapi/web/models/ProductVO.java
WARN: Invalid character encountered in file /opt/cloudhost/apps/.jenkins/workspace/TEMP_SONARQUBE_CI_CD_LEMS_BUILD_EXTRA/src/test/java/com/mf/pdapi/services/utils/SecurityHelperUtilTest.java at line 34 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: 405/405 source files have been analyzed
INFO: Java Main Files AST scan (done) | time=57784ms
INFO: Java Test Files AST scan
INFO: 0 source files to be analyzed
INFO: Java Test Files AST scan (done) | time=2ms
INFO: 0/0 source files have been analyzed
INFO: Sensor JavaSquidSensor [java] (done) | time=58443ms
INFO: Sensor SonarCSS Metrics [cssfamily]
INFO: Sensor SonarCSS Metrics [cssfamily] (done) | time=125ms
INFO: Sensor SonarCSS Rules [cssfamily]
ERROR: CSS rules were not executed. Error when running: 'node -v'. Is Node.js available during analysis?
org.sonarsource.nodejs.NodeCommandException: Error when running: 'node -v'. Is Node.js available during analysis?
at org.sonarsource.nodejs.NodeCommand.start(NodeCommand.java:83)
at org.sonarsource.nodejs.NodeCommandBuilderImpl.getVersion(NodeCommandBuilderImpl.java:196)
at org.sonarsource.nodejs.NodeCommandBuilderImpl.checkNodeCompatibility(NodeCommandBuilderImpl.java:169)
at org.sonarsource.nodejs.NodeCommandBuilderImpl.build(NodeCommandBuilderImpl.java:144)
at org.sonar.css.plugin.server.CssAnalyzerBridgeServer.initNodeCommand(CssAnalyzerBridgeServer.java:133)
at org.sonar.css.plugin.server.CssAnalyzerBridgeServer.startServer(CssAnalyzerBridgeServer.java:101)
at org.sonar.css.plugin.server.CssAnalyzerBridgeServer.startServerLazily(CssAnalyzerBridgeServer.java:153)
at org.sonar.css.plugin.CssRuleSensor.execute(CssRuleSensor.java:99)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:400)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:395)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:358)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:99)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.io.IOException: Cannot run program "node": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at org.sonarsource.nodejs.NodeCommand$ProcessWrapperImpl.start(NodeCommand.java:175)
at org.sonarsource.nodejs.NodeCommand.start(NodeCommand.java:79)
... 37 common frames omitted
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 39 common frames omitted
INFO: Sensor SonarCSS Rules [cssfamily] (done) | time=938ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list.
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=253ms
INFO: Sensor SurefireSensor [java]
INFO: parsing [/opt/cloudhost/apps/.jenkins/workspace/TEMP_SONARQUBE_CI_CD_LEMS_BUILD_EXTRA/build/test-results/test]
INFO: Sensor SurefireSensor [java] (done) | time=35ms
INFO: Sensor JaCoCoSensor [java]
INFO: Sensor JaCoCoSensor [java] (done) | time=1ms
INFO: Sensor JavaXmlSensor [java]
INFO: 41 source files to be analyzed
INFO: Sensor JavaXmlSensor [java] (done) | time=526ms
INFO: Sensor HTML [web]
INFO: 41/41 source files have been analyzed
INFO: Sensor HTML [web] (done) | time=1841ms
INFO: Sensor XML Sensor [xml]
INFO: 52 source files to be analyzed
INFO: Sensor XML Sensor [xml] (done) | time=562ms
INFO: 52/52 source files have been analyzed
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=22ms
INFO: Sensor Java CPD Block Indexer
INFO: Sensor Java CPD Block Indexer (done) | time=640ms
INFO: 78 files had no CPD blocks
INFO: Calculating CPD for 427 files
INFO: CPD calculation finished
INFO: Analysis report generated in 378ms, dir size=9 MB
INFO: Analysis report compressed in 1574ms, zip size=3 MB
INFO: Analysis report uploaded in 263ms
The error is:
ERROR: CSS rules were not executed. Error when running: 'node -v'. Is Node.js available during analysis?
It means what you do not have nodejs installed. Just configure it in jenkins global tools menu, add it to your job and run it again.
SonarQuber Version: 6.7.5 and
TFS - 2017 Update3
I am using SonarQube’s VSTS extensions to trigger the builds. I am building angular projects but the build definition is getting failed in Run Code Analysis task of Sonar.
Previously it used to work fine with SonarQube 5.6.6 but recently we upgraded the SonarQube to 6.7.5 in production and from then on wards the build started getting failed with the below error.
2018-11-21T13:26:26.4847112Z ##[error]ERROR: Error during SonarQube Scanner execution
2018-11-21T13:26:26.4847112Z ##[debug]Processed: ##vso[task.logissue type=error;]ERROR: Error during SonarQube Scanner execution
2018-11-21T13:26:26.4847112Z ##[debug]Processed: ERROR: Error during SonarQube Scanner execution##vso[task.logissue type=error;]
**2018-11-21T13:26:26.4847112Z **
2018-11-21T13:26:26.4847112Z ##[error]ERROR: Unable to register token in file src/app/areas/match-group/create-match-group/create-match-group.component.ts
Before we upgraded the SonarQube version in production to 6.7.5, I had tested the Build definition by pointing to it on Staging environment and it used to work there as well but after actual upgrade took place in production it started failing.
I think it is because the Quality gate is failing but I am not sure that really the Quality gate is failing because it is not mentioned in the log anywhere that Project does not pass the quality gate or it might be because of the Upgrade as well?
So can anyone please help me in resolving the issue?
Below is the complete log of Run Code Analysis task for Reference.
2018-11-21T13:26:04.1713599Z ##[debug]Evaluating condition for step: 'Run Code Analysis'
2018-11-21T13:26:04.1713599Z ##[debug]Evaluating: succeeded()
2018-11-21T13:26:04.1713599Z ##[debug]Evaluating succeeded:
2018-11-21T13:26:04.1713599Z ##[debug]=> (Boolean) True
2018-11-21T13:26:04.1713599Z ##[debug]Expanded: True
2018-11-21T13:26:04.1713599Z ##[debug]Result: True
2018-11-21T13:26:04.1713599Z ##[section]Starting: Run Code Analysis
2018-11-21T13:26:04.1713599Z ==============================================================================
2018-11-21T13:26:04.1713599Z Task : Run Code Analysis
2018-11-21T13:26:04.1713599Z Description : Run scanner and upload the results to the SonarQube server.
2018-11-21T13:26:04.1713599Z Version : 4.4.1
2018-11-21T13:26:04.1713599Z Author : sonarsource
2018-11-21T13:26:04.1713599Z Help : This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.
[More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
2018-11-21T13:26:04.1713599Z ==============================================================================
2018-11-21T13:26:04.4369873Z ##[debug]agent.TempDirectory=F:\Builds\Sonar\_temp
2018-11-21T13:26:04.4369873Z ##[debug]loading inputs and endpoints
2018-11-21T13:26:04.4369873Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2018-11-21T13:26:04.4369873Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2018-11-21T13:26:04.4369873Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2018-11-21T13:26:04.4369873Z ##[debug]loading SECRET_SONARQUBE_ENDPOINT
2018-11-21T13:26:04.4369873Z ##[debug]loaded 4
2018-11-21T13:26:04.4526142Z ##[debug]Agent.ProxyUrl=undefined
2018-11-21T13:26:04.4526142Z ##[debug]Agent.CAInfo=undefined
2018-11-21T13:26:04.4526142Z ##[debug]Agent.ClientCert=undefined
2018-11-21T13:26:04.4526142Z ##[debug]Agent.SkipCertValidation=undefined
2018-11-21T13:26:04.5307416Z ##[debug]SONARQUBE_SCANNER_MODE=CLI
2018-11-21T13:26:04.5307416Z ##[debug]Absolute path for pathSegments: F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1,sonar-scanner,bin,sonar-scanner = F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner
2018-11-21T13:26:04.5307416Z ##[debug]which 'F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat'
2018-11-21T13:26:04.5307416Z ##[debug]found: 'F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat'
2018-11-21T13:26:04.5307416Z ##[debug]which 'F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat'
2018-11-21T13:26:04.5307416Z ##[debug]found: 'F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat'
2018-11-21T13:26:04.5307416Z ##[debug]system.debug=True
2018-11-21T13:26:04.5307416Z ##[debug]exec tool: F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat
2018-11-21T13:26:04.5307416Z ##[debug]arguments:
2018-11-21T13:26:04.5307416Z [command]C:\Windows\system32\cmd.exe /D /S /C "F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat"
2018-11-21T13:26:04.7963804Z INFO: Scanner configuration file: F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\..\conf\sonar-scanner.properties
2018-11-21T13:26:04.7963804Z INFO: Project root configuration file: NONE
2018-11-21T13:26:04.8276263Z INFO: SonarQube Scanner 3.2.0.1227
2018-11-21T13:26:04.8432500Z INFO: Java 1.8.0_172 Oracle Corporation (64-bit)
2018-11-21T13:26:04.8432500Z INFO: Windows Server 2016 10.0 amd64
2018-11-21T13:26:05.2184811Z INFO: User cache: C:\Users\svc_TFSservice\.sonar\cache
2018-11-21T13:26:05.6403612Z INFO: SonarQube server 6.7.5
2018-11-21T13:26:05.6403612Z INFO: Default locale: "en_US", source code encoding: "UTF-8"
2018-11-21T13:26:06.1403664Z INFO: Publish mode
2018-11-21T13:26:06.4059994Z INFO: Load global settings
2018-11-21T13:26:06.8122594Z INFO: Load global settings (done) | time=407ms
2018-11-21T13:26:06.8435246Z INFO: Server id: 98F64F5D-AWciJELiWXjIvPjAIE0y
2018-11-21T13:26:06.8591409Z INFO: User cache: C:\Users\svc_TFSservice\.sonar\cache
2018-11-21T13:26:07.0778908Z INFO: Load plugins index
2018-11-21T13:26:07.1716405Z INFO: Load plugins index (done) | time=94ms
2018-11-21T13:26:08.1247924Z INFO: Process project properties
2018-11-21T13:26:08.1247924Z INFO: Execute project builders
2018-11-21T13:26:08.1247924Z INFO: Execute project builders (done) | time=0ms
2018-11-21T13:26:08.1560423Z INFO: Load branch configuration
2018-11-21T13:26:08.1560423Z INFO: Load branch configuration (done) | time=0ms
2018-11-21T13:26:08.1560423Z INFO: Load project repositories
2018-11-21T13:26:08.2654212Z INFO: Load project repositories (done) | time=109ms
2018-11-21T13:26:08.4841842Z INFO: Load quality profiles
2018-11-21T13:26:08.5466788Z INFO: Load quality profiles (done) | time=62ms
2018-11-21T13:26:08.5623129Z INFO: Load active rules
2018-11-21T13:26:09.6406179Z INFO: Load active rules (done) | time=1078ms
2018-11-21T13:26:09.6406179Z INFO: Load metrics repository
2018-11-21T13:26:09.7030223Z INFO: Load metrics repository (done) | time=63ms
2018-11-21T13:26:09.7185915Z INFO: Project key: NextGenHTML5
2018-11-21T13:26:09.7185915Z INFO: ------------- Scan SNR-IM-NextGen-HTML5
2018-11-21T13:26:10.0008521Z INFO: Base dir: F:\Builds\Sonar\12\s
2018-11-21T13:26:10.0008521Z INFO: Working dir: F:\Builds\Sonar\12\s\.scannerwork
2018-11-21T13:26:10.0008521Z INFO: Source paths: src
2018-11-21T13:26:10.0008521Z INFO: Test paths: src
2018-11-21T13:26:10.0008521Z INFO: Source encoding: UTF-8, default locale: en_US
2018-11-21T13:26:10.1248422Z INFO: Load server rules
2018-11-21T13:26:10.4217641Z INFO: Load server rules (done) | time=297ms
2018-11-21T13:26:10.6404902Z INFO: Index files
2018-11-21T13:26:10.6404902Z INFO: Excluded sources:
2018-11-21T13:26:10.6404902Z INFO: **/node_modules/**
2018-11-21T13:26:10.6564588Z INFO: **/*.spec.ts
2018-11-21T13:26:10.6564588Z INFO: src/Tools/**
2018-11-21T13:26:10.6564588Z INFO: **/*.spec.ts
2018-11-21T13:26:10.6564588Z INFO: Included tests:
2018-11-21T13:26:10.6564588Z INFO: **/*.spec.ts
2018-11-21T13:26:10.9686205Z INFO: 188 files indexed
2018-11-21T13:26:10.9686205Z INFO: 212 files ignored because of inclusion/exclusion patterns
2018-11-21T13:26:10.9686205Z INFO: Quality profile for js: Sonar way Recommended
2018-11-21T13:26:10.9686205Z INFO: Quality profile for ts: TsLint
2018-11-21T13:26:10.9686205Z INFO: Quality profile for xml: Sonar way
2018-11-21T13:26:12.2655236Z INFO: Sensor JavaScript Squid Sensor [javascript]
2018-11-21T13:26:12.2655236Z INFO: 2 source files to be analyzed
2018-11-21T13:26:12.7030349Z INFO: Unit Test Coverage Sensor is started
2018-11-21T13:26:12.7030349Z INFO: 2/2 source files have been analyzed
2018-11-21T13:26:12.7030349Z INFO: Integration Test Coverage Sensor is started
2018-11-21T13:26:12.7030349Z INFO: Overall Coverage Sensor is started
2018-11-21T13:26:12.7030349Z INFO: Sensor JavaScript Squid Sensor [javascript] (done) | time=438ms
2018-11-21T13:26:12.7030349Z INFO: Sensor SonarJavaXmlFileSensor [java]
2018-11-21T13:26:12.7342853Z INFO: 1 source files to be analyzed
2018-11-21T13:26:12.7967860Z INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=93ms
2018-11-21T13:26:12.7967860Z INFO: Sensor XML Sensor [xml]
2018-11-21T13:26:12.7967860Z INFO: 1/1 source files have been analyzed
2018-11-21T13:26:13.2030475Z INFO: Sensor XML Sensor [xml] (done) | time=407ms
2018-11-21T13:26:13.2030475Z INFO: Sensor Analyzer for "php.ini" files [php]
2018-11-21T13:26:13.2186797Z INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=15ms
2018-11-21T13:26:13.2186797Z INFO: Sensor TypeScript Sensor [typescript]
2018-11-21T13:26:26.3752598Z INFO: ------------------------------------------------------------------------
2018-11-21T13:26:26.3752598Z INFO: EXECUTION FAILURE
2018-11-21T13:26:26.3752598Z INFO: ------------------------------------------------------------------------
2018-11-21T13:26:26.3752598Z INFO: Total time: 21.595s
2018-11-21T13:26:26.4690128Z INFO: Final Memory: 19M/535M
2018-11-21T13:26:26.4690128Z INFO: ------------------------------------------------------------------------
2018-11-21T13:26:26.4847112Z ##[error]ERROR: Error during SonarQube Scanner execution
2018-11-21T13:26:26.4847112Z ##[debug]Processed: ##vso[task.logissue type=error;]ERROR: Error during SonarQube Scanner execution
2018-11-21T13:26:26.4847112Z ##[debug]Processed: ERROR: Error during SonarQube Scanner execution##vso[task.logissue type=error;]
2018-11-21T13:26:26.4847112Z
2018-11-21T13:26:26.4847112Z ##[error]ERROR: Unable to register token in file src/app/areas/match-group/create-match-group/create-match-group.component.ts
ERROR: Caused by: 59 is not a valid line offset for pointer. File src/app/areas/match-group/create-match-group/create-match-group.component.ts has 58 character(s) at line 1
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
2018-11-21T13:26:26.4847112Z ##[debug]Processed: ##vso[task.logissue type=error;]ERROR: Unable to register token in file src/app/areas/match-group/create-match-group/create-match-group.component.ts%0D%0AERROR: Caused by: 59 is not a valid line offset for pointer. File src/app/areas/match-group/create-match-group/create-match-group.component.ts has 58 character(s) at line 1%0D%0AERROR: %0D%0AERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
2018-11-21T13:26:26.4847112Z ERROR: Unable to register token in file src/app/areas/match-group/create-match-group/create-match-group.component.ts
2018-11-21T13:26:26.4847112Z ERROR: Caused by: 59 is not a valid line offset for pointer. File src/app/areas/match-group/create-match-group/create-match-group.component.ts has 58 character(s) at line 1
2018-11-21T13:26:26.4847112Z ERROR:
2018-11-21T13:26:26.4847112Z ##[debug]Processed: ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.##vso[task.logissue type=error;]
2018-11-21T13:26:26.4847112Z
2018-11-21T13:26:26.5627661Z ##[debug]rc:1
2018-11-21T13:26:26.5627661Z ##[debug]success:false
2018-11-21T13:26:26.5627661Z ##[debug]task result: Failed
2018-11-21T13:26:26.5627661Z ##[error]F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat failed with return code: 1
2018-11-21T13:26:26.5627661Z ##[debug]Processed: ##vso[task.issue type=error;]F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat failed with return code: 1
2018-11-21T13:26:26.5627661Z ##[debug]Processed: ##vso[task.complete result=Failed;]F:\Builds\Sonar\_tasks\SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055\4.4.1\sonar-scanner\bin\sonar-scanner.bat failed with return code: 1
2018-11-21T13:26:26.5802746Z ##[section]Finishing: Run Code Analysis
Regards,
SRP.
Context:
Right now I have a Jenkins freestyle job that is triggered by some Gerrit events. When it is triggered, it downloads the changes and runs a Sonarqube Analysis on them. After the analysis is done, it is supposed to post comments on Gerrit detailing the results.
Unfortunately, no matter what the result of the Sonarqube analysis, the comment always says "sonarqube violations have not been found."
Some pictures:
Jenkins Freestyle Job Configuration:
Versions:
Jenkins v2.46.2
Gerrit Trigger Plugin v.2.24.0
Sonar Gerrit Plugin v2.0
Sonarqube Scanner for Jenkins Plugin v2.6.1
Sonarqube v6.3.1
Gerrit v2.13.5
Output from the Jenkins console:
Unpacking https://repo1.maven.org/maven2/org/sonarsource/scanner/cli/sonar-scanner-cli/3.0.3.778/sonar-scanner-cli-3.0.3.778.zip to /var/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonar on ubuntu-graphical
[osstp-ci] $ /var/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonar/bin/sonar-scanner -e -Dsonar.host.url=<ip_address>:9000 -Dsonar.projectName=osstp-work -Dsonar.issuesReport.json.enable=true -Dsonar.report.export.path=sonar-report.json -Dsonar.analysis.mode=preview -Dsonar.projectKey=org.vmware:osstpmgt -Dsonar.inclusions=**/*.py -Dsonar.host.url=http://10.20.96.87:9000 -Dsonar.sources=. -Dsonar.projectBaseDir=/var/jenkins/workspace/osstp-ci
INFO: Option -e/--errors is no longer supported and will be ignored
INFO: Scanner configuration file: /var/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonar/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 3.0.3.778
INFO: Java 1.8.0_131 Oracle Corporation (64-bit)
INFO: Linux 4.8.0-36-generic amd64
INFO: User cache: /home/tgong/.sonar/cache
INFO: Load global settings
INFO: Load global settings (done) | time=160ms
INFO: User cache: /home/tgong/.sonar/cache
INFO: Exclude plugins: devcockpit, ldap, authgithub, authbitbucket, pdfreport, authaad, googleanalytics, governance
INFO: Load plugins index
INFO: Load plugins index (done) | time=10ms
INFO: Download sonar-csharp-plugin-5.7.0.612.jar
INFO: Download sonar-python-plugin-1.7.0.1195.jar
INFO: Download sonar-java-plugin-4.5.0.8398.jar
INFO: Download sonar-flex-plugin-2.3.jar
INFO: Download sonar-scm-git-plugin-1.2.jar
INFO: Download sonar-php-plugin-2.9.2.1744.jar
INFO: Download sonar-scm-svn-plugin-1.4.0.522.jar
INFO: Download sonar-javascript-plugin-2.20.0.4207.jar
INFO: SonarQube server 6.3.1
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=217ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=66ms
INFO: Load active rules
INFO: Load active rules (done) | time=1693ms
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=141ms
INFO: Issues mode
INFO: Scanning only changed files
INFO: Project key: org.vmware:osstpmgt
INFO: ------------- Scan osstp-work
INFO: Load server rules
INFO: Load server rules (done) | time=68ms
INFO: Base dir: /var/jenkins/workspace/osstp-ci
INFO: Working dir: /var/jenkins/workspace/osstp-ci/.scannerwork
INFO: Source paths: .
INFO: Source encoding: UTF-8, default locale: en_US
INFO: Index files
INFO: Included sources:
INFO: **/*.py
WARN: Not indexing due to symlink loop: /var/jenkins/workspace/osstp-ci/www/scotzilla
INFO: 717 files indexed
INFO: 2093 files ignored because of inclusion/exclusion patterns
INFO: Quality profile for py: Sonar way
INFO: Sensor NoSonar Sensor [php]
INFO: Sensor NoSonar Sensor [php] (done) | time=1ms
INFO: Sensor Coverage Report Import [csharp]
INFO: Sensor Coverage Report Import [csharp] (done) | time=1ms
INFO: Sensor Coverage Report Import [csharp]
INFO: Sensor Coverage Report Import [csharp] (done) | time=0ms
INFO: Sensor Unit Test Results Import [csharp]
INFO: Sensor Unit Test Results Import [csharp] (done) | time=1ms
INFO: Sensor XmlFileSensor [java]
INFO: Sensor XmlFileSensor [java] (done) | time=7ms
INFO: Sensor Analyzer for "php.ini" files [php]
INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=8ms
INFO: Load server issues
INFO: Load server issues (done) | time=1053ms
INFO: Performing issue tracking
INFO: 813/813 components tracked
INFO: Export issues to /var/jenkins/workspace/osstp-ci/.scannerwork/sonar-report.json
INFO: ANALYSIS SUCCESSFUL
INFO: Task total time: 11.610 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 17.577s
INFO: Final Memory: 46M/114M
INFO: ------------------------------------------------------------------------
Getting Sonar Report from: /var/jenkins/workspace/osstp-ci/.scannerwork/sonar-report.json
Report has loaded and contains 1492 issues
Connected to Gerrit: server name: Gerrit. Change Number: 32, PatchSetNumber: 1
Review has been sent
Finished: SUCCESS
Not sure if you already resolved this, but your "Project Settings" entry is empty and there was a recent fix (Jan 2018 - JENKINS-43730) that addresses what may have caused your issue: https://wiki.jenkins.io/display/JENKINS/Sonar+Gerrit#SonarGerrit-Version2.1(6Jan2018)
Try to set the following:
1) Build > Execute SonarQube Scanner > Analysis properties
sonar.report.export.path=sonar-report.json
2) Post-build Actions > Post SonarQube issues as Gerrit comments > Project Settings
SonarQube report path = .sonar/sonar-report.json
Seems like your user.dir property is not set. Set it to the location where git downloads the code (most probably in $WORKSPACE)
so, include this user.dir=$WORKSPACE with the other analysis parameters.