Sonar Jacoco is failing with below error

sonarqube
jacoco

(Vijay Patnana) #1

Hi,

Sonar plugin version - 2.1.2
sonarqube version - 6.7.2

I noticed all our build plans started failing with the same issue. I don’t see much information in the logs to fix this. Has anyone come across this issue before? Please check the logs below.

|build|16-Jan-2019 18:15:48|[INFO] --- sonar-maven-plugin:3.6.0.1398:sonar (default-cli) @ fitchratingsapi ---|
|---|---|---|
|build|16-Jan-2019 18:15:48|[INFO] User cache: /home/bamboo/.sonar/cache|
|build|16-Jan-2019 18:15:49|[INFO] SonarQube version: 6.7.2|
|build|16-Jan-2019 18:15:49|[INFO] Default locale: "en_US", source code encoding: "UTF-8"|
|build|16-Jan-2019 18:15:49|[INFO] Publish mode|
|build|16-Jan-2019 18:15:50|[INFO] Load global settings|
|build|16-Jan-2019 18:15:50|[INFO] Load global settings (done) | time=224ms|
|build|16-Jan-2019 18:15:50|[INFO] Server id: AWLQq6RfWJWNTtHcgPD-|
|build|16-Jan-2019 18:15:50|[INFO] User cache: /home/bamboo/.sonar/cache|
|build|16-Jan-2019 18:15:50|[INFO] Load plugins index|
|build|16-Jan-2019 18:15:50|[INFO] Load plugins index (done) | time=114ms|
|build|16-Jan-2019 18:15:51|[INFO] Process project properties|
|build|16-Jan-2019 18:15:52|[INFO] Load project repositories|
|build|16-Jan-2019 18:15:52|[INFO] Load project repositories (done) | time=153ms|
|build|16-Jan-2019 18:15:52|[INFO] Load quality profiles|
|build|16-Jan-2019 18:15:52|[INFO] Load quality profiles (done) | time=42ms|
|build|16-Jan-2019 18:15:52|[INFO] Load active rules|
|build|16-Jan-2019 18:15:52|[INFO] Load active rules (done) | time=367ms|
|build|16-Jan-2019 18:15:52|[INFO] Load metrics repository|
|build|16-Jan-2019 18:15:52|[INFO] Load metrics repository (done) | time=35ms|
|build|16-Jan-2019 18:15:52|[INFO] Project key: com.fitchratings:fitchratingsapi|
|build|16-Jan-2019 18:15:52|[INFO] Branch key: CYB-develop|
|build|16-Jan-2019 18:15:52|[WARNING] The use of "sonar.branch" is deprecated and replaced by "sonar.branch.name". See https://redirect.sonarsource.com/doc/branches.html.|
|build|16-Jan-2019 18:15:52|[INFO] -------------  Scan fitchratingsapi|
|build|16-Jan-2019 18:15:53|[INFO] Base dir: /home/bamboo/bamboo-agent-home/xml-data/build-dir/GW-FV75-JOB1|
|build|16-Jan-2019 18:15:53|[INFO] Working dir: /home/bamboo/bamboo-agent-home/xml-data/build-dir/GW-FV75-JOB1/target/sonar|
|build|16-Jan-2019 18:15:53|[INFO] Source paths: pom.xml, src/main/java|
|build|16-Jan-2019 18:15:53|[INFO] Test paths: src/test/java|
|build|16-Jan-2019 18:15:53|[INFO] Source encoding: UTF-8, default locale: en_US|
|build|16-Jan-2019 18:15:53|[INFO] Load server rules|
|build|16-Jan-2019 18:15:53|[INFO] Load server rules (done) | time=72ms|
|build|16-Jan-2019 18:15:53|[INFO] Index files|
|build|16-Jan-2019 18:15:53|[INFO] 161 files indexed|
|build|16-Jan-2019 18:15:53|[INFO] Quality profile for java: Sonar way (outdated copy)|
|build|16-Jan-2019 18:15:53|[INFO] Quality profile for xml: Sonar way (outdated copy)|
|build|16-Jan-2019 18:15:54|[INFO] Sensor JavaSquidSensor [java]|
|build|16-Jan-2019 18:15:55|[INFO] Configured Java source version (sonar.java.source): 8|
|build|16-Jan-2019 18:15:55|[INFO] JavaClasspath initialization|
|build|16-Jan-2019 18:15:55|[INFO] JavaClasspath initialization (done) | time=29ms|
|build|16-Jan-2019 18:15:55|[INFO] JavaTestClasspath initialization|
|build|16-Jan-2019 18:15:55|[INFO] JavaTestClasspath initialization (done) | time=10ms|
|build|16-Jan-2019 18:15:56|[INFO] Java Main Files AST scan|
|build|16-Jan-2019 18:15:56|[INFO] 109 source files to be analyzed|
|build|16-Jan-2019 18:16:06|[INFO] 75/109 files analyzed, current file: /home/bamboo/bamboo-agent-home/xml-data/build-dir/GW-FV75-JOB1/src/main/java/com/fitchratings/api/model/search/result/SurveillancePageResult.java|
|build|16-Jan-2019 18:16:11|[INFO] 109/109 source files have been analyzed|
|build|16-Jan-2019 18:16:11|[WARNING] Classes not found during the analysis : [javax.annotation.meta.When]|
|build|16-Jan-2019 18:16:11|[INFO] Java Main Files AST scan (done) | time=15553ms|
|build|16-Jan-2019 18:16:11|[INFO] Java Test Files AST scan|
|build|16-Jan-2019 18:16:11|[INFO] 51 source files to be analyzed|
|build|16-Jan-2019 18:16:15|[WARNING] Classes not found during the analysis : [javax.annotation.meta.When]|
|build|16-Jan-2019 18:16:15|[INFO] 51/51 source files have been analyzed|
|build|16-Jan-2019 18:16:15|[INFO] Java Test Files AST scan (done) | time=3871ms|
|build|16-Jan-2019 18:16:15|[INFO] Sensor JavaSquidSensor [java] (done) | time=20644ms|
|build|16-Jan-2019 18:16:15|[INFO] Sensor CoberturaSensor [cobertura]|
|build|16-Jan-2019 18:16:15|[INFO] parsing /home/bamboo/bamboo-agent-home/xml-data/build-dir/GW-FV75-JOB1/target/site/jacoco/jacoco.xml|
|build|16-Jan-2019 18:16:15|[INFO] ------------------------------------------------------------------------|
|build|16-Jan-2019 18:16:15|[INFO] BUILD FAILURE|
|build|16-Jan-2019 18:16:15|[INFO] ------------------------------------------------------------------------|
|build|16-Jan-2019 18:16:15|[INFO] Total time: 31.579 s|
|build|16-Jan-2019 18:16:15|[INFO] Finished at: 2019-01-16T23:16:15+00:00|
|build|16-Jan-2019 18:16:16|[INFO] Final Memory: 54M/768M|
|build|16-Jan-2019 18:16:16|[INFO] ------------------------------------------------------------------------|
|build|16-Jan-2019 18:16:16|[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project *******api: null: MojoExecutionException: NullPointerException -> [Help 1]|
|build|16-Jan-2019 18:16:16|[ERROR] |
|build|16-Jan-2019 18:16:16|[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.|
|build|16-Jan-2019 18:16:16|[ERROR] Re-run Maven using the -X switch to enable full debug logging.|
|build|16-Jan-2019 18:16:16|[ERROR] |
|build|16-Jan-2019 18:16:16|[ERROR] For more information about the errors and possible solutions, please read the following articles:|
|build|16-Jan-2019 18:16:16|[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException|
|simple|16-Jan-2019 18:16:16|Failing task since return code of [/opt/maven-3.3/bin/mvn -Djava.io.tmpdir=/tmp/GW-FV75-JOB1 sonar:sonar -Dsonar.host.url=https://sonarqube.*******.com/ -Dsonar.login=****** -Dsonar.password=****** -Dsonar.branch=CYB-develop] was 1 while expected 0|
|simple|16-Jan-2019 18:16:16|SONAR4BAMBOO: was not able to find a SonarQube result URL|
|simple|16-Jan-2019 18:16:16|Finished task 'Analyze with sonar' with result: Failed|
|simple|16-Jan-2019 18:16:16|Running post build plugin 'BrowserStack Post Runner'|
|simple|16-Jan-2019 18:16:16|Running post build plugin 'Docker Container Cleanup'|
|simple|16-Jan-2019 18:16:16|Running post build plugin 'NCover Results Collector'|
|simple|16-Jan-2019 18:16:16|Running post build plugin 'Cucumber Artifact Copier'|
|simple|16-Jan-2019 18:16:16|Running post build plugin 'Artifactory Release Management Staging'|
|simple|16-Jan-2019 18:16:16|Running post build plugin 'Artifactory Build Info Copier'|
|simple|16-Jan-2019 18:16:16|Running post build plugin 'Artifactory Gradle Properties Info Copier'|
|simple|16-Jan-2019 18:16:16|Running post build plugin 'Clover Results Collector'|
|simple|16-Jan-2019 18:16:16|Running post build plugin 'npm Cache Cleanup'|
|simple|16-Jan-2019 18:16:16|Running post build plugin 'Artifact Copier'|
|simple|16-Jan-2019 18:16:16|Publishing an artifact: *******API-v2 artifact|
|simple|16-Jan-2019 18:16:20|Finished publishing of artifact Shared artifact: [********API-v2 artifact], pattern: [**/*.jar] anchored at: [target] in 3.405 s|
|simple|16-Jan-2019 18:16:20|Publishing an artifact: site report html|
|simple|16-Jan-2019 18:16:20|Finished publishing of artifact Shared artifact: [site report html], pattern: [*report.html] anchored at: [target/site] in 9.338 ms|
|simple|16-Jan-2019 18:16:20|Publishing an artifact: site vunerability html|
|simple|16-Jan-2019 18:16:20|Finished publishing of artifact Shared artifact: [site vunerability html], pattern: [*vulnerability.html] anchored at: [target/site] in 6.846 ms|
|simple|16-Jan-2019 18:16:20|Finalising the build...|
|simple|16-Jan-2019 18:16:20|Stopping timer.|
|simple|16-Jan-2019 18:16:20|Build GW-FV75-JOB1-8 completed.|

Thank you!


(Evgeny Mandrikov) #2

Hi,

could you please do as one of error messages says

i.e. execute Maven with -e to be able to see full stack trace?


(Vijay Patnana) #3

Hi Evgeny,

I don’t see any difference after trying with -e option. It is generating the same logs.


(Evgeny Mandrikov) #4

This is impossible.


But ok, let me try to make wild guess:

according to the following two lines

|build|16-Jan-2019 18:16:15|[INFO] Sensor CoberturaSensor [cobertura]|
|build|16-Jan-2019 18:16:15|[INFO] parsing /home/bamboo/bamboo-agent-home/xml-data/build-dir/GW-FV75-JOB1/target/site/jacoco/jacoco.xml|

seems that you are trying to pass JaCoCo report as Cobertura, whereas this is two completely different tools with different formats of report.