3

We upgraded to Sonar 5.2. But now, the task to process the sonar report fails:

2015.12.21 16:08:20 ERROR [o.s.s.c.t.CeWorkerRunnableImpl] Failed to execute task AVHFFR9SqYJURQAYr8yb
java.lang.IllegalArgumentException: There's no changeset on line 59
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:125) ~[guava-17.0.jar:na]
    at org.sonar.server.computation.scm.ScmInfoImpl.getChangesetForLine(ScmInfoImpl.java:64) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.scm.DbScmInfo.getChangesetForLine(DbScmInfo.java:69) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.computation.step.NewCoverageMeasuresStep$NewCoverageCounter.initialize(NewCoverageMeasuresStep.java:391) ~[so

If I uninstall the Cobertura Plugin which has version 1.6.3, then the report process works fine. But that's no solution for me because I need these reports. Did anybody succeed to solve this error in another way?

regards

James Dunn
  • 8,064
  • 13
  • 53
  • 87
faenschi
  • 271
  • 1
  • 3
  • 11

1 Answers1

1

Two thoughts:

1) Your issue seems related to this discussion on SonarQube's group. Check if you have such line number="0" in your cobertura.xml file. Unfortunately the fix is planned for SonarQube 5.4 (i.e. 04/Mar/16.)

2) Depending on your exact needs related to Cobertura reports generation and if you're using Maven, you can try to use QualInsight Maven Cobertura plugin to generate your Cobertura reports. This plugin provides the qualinsight-mojo-cobertura-core mojo, an alternative to the cobertura-maven-plugin mojo you're probably using if your build is Maven based. QualInsight Maven Cobertura plugin generates separate reports for UTs, ITs, and combined Overall Test coverage. It generates standard cobertura.xml reports, but also is able to convert them to SonarQube Generic Test Coverage plugin format.

Maybe generated reports by qualinsight-mojo-cobertura-core won't contain data causing issues + maybe using SonarQube's Generic Coverage plugin instead of SonarQube's Cobertura plugin won't cause the exception you get (it was released 9 days ago and tested towards SQ 5.2, while the Cobertura plugin was last released in September 2014)

If want to give it a try and need help / have questions with this solution, just ask (I'm the developer QualInsight Maven Cobertura plugin.)

Regards,

Kraal
  • 2,779
  • 1
  • 19
  • 36
  • Hey! Thanks for the reply and help. I tried it with the Generic Coverage Plugin. So you think I a can generate the reports with Cobertura as it is and then user the Generic Coverage Plugin on sonar instead of the cobertura plugin? Maven has a lot of these warnings then '[WARNING] Class 'net/sourceforge/cobertura/coveragedata/LightClassmapListener' is not accessible through the ClassLoader.' And finally it can't generate a report \target\site\cobertura\coverage.xml: Unknown coverage version: 2.1.1. This parser only handles version 1. – faenschi Jan 04 '16 at 12:18
  • 1
    Hi, no you won't be able to use the generic coverage plugin with `cobertura-maven-plugin` as the output format is not understood by the generic coverage plugin. That's why I wrote you should try to use it in conjunction with the alternative Maven plugin `qualinsight-mojo-corbertura`. – Kraal Jan 04 '16 at 12:42