SonarQube analysis fails: java.lang.IllegalStateException: Can't create measure for line x

1,000 views
Skip to first unread message

beaudry...@gmail.com

unread,
Apr 27, 2016, 10:51:54 AM4/27/16
to SonarQube
I was using SonarQube with the C# plugin for a few months and everything was working fine. Starting last week, our SonarQube analysis started failing with this error:

2016-04-27T01:04:28.7190178Z ##[error]ERROR: Error during Sonar runner execution
2016-04-27T01:04:28.7200175Z ##[error]org.sonar.runner.impl.RunnerException: Unable to execute Sonar
2016-04-27T01:04:28.7210178Z ##[error]    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
2016-04-27T01:04:28.7210178Z ##[error]    at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
2016-04-27T01:04:28.7220171Z ##[error]    at java.security.AccessController.doPrivileged(Native Method)
2016-04-27T01:04:28.7220171Z ##[error]    at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
2016-04-27T01:04:28.7230181Z ##[error]    at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
2016-04-27T01:04:28.7240179Z ##[error]    at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
2016-04-27T01:04:28.7240179Z ##[error]    at org.sonar.runner.api.Runner.execute(Runner.java:100)
2016-04-27T01:04:28.7250177Z ##[error]    at org.sonar.runner.Main.executeTask(Main.java:70)
2016-04-27T01:04:28.7260181Z ##[error]    at org.sonar.runner.Main.execute(Main.java:59)
2016-04-27T01:04:28.7260181Z ##[error]    at org.sonar.runner.Main.main(Main.java:53)
2016-04-27T01:04:28.7270180Z ##[error]Caused by: java.lang.IllegalStateException: Can't create measure for line 137 for file 'C:/a/1/s/Source/Platform/OCS/OvertureServices/Foundation.ApplicationServices/ScopeApplicationService.cs' with 128 lines
2016-04-27T01:04:28.7270180Z ##[error]    at org.sonar.batch.sensor.coverage.CoverageExclusions.validateMaxLine(CoverageExclusions.java:158)
2016-04-27T01:04:28.7280181Z ##[error]    at org.sonar.batch.sensor.coverage.CoverageExclusions.validate(CoverageExclusions.java:129)
2016-04-27T01:04:28.7290180Z ##[error]    at org.sonar.batch.deprecated.DeprecatedSensorContext.saveMeasure(DeprecatedSensorContext.java:204)
2016-04-27T01:04:28.7290180Z ##[error]    at org.sonar.plugins.dotnet.tests.CoverageReportImportSensor.analyze(CoverageReportImportSensor.java:103)
2016-04-27T01:04:28.7300170Z ##[error]    at org.sonar.plugins.dotnet.tests.CoverageReportImportSensor.analyse(CoverageReportImportSensor.java:74)
2016-04-27T01:04:28.7300170Z ##[error]    at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
2016-04-27T01:04:28.7310174Z ##[error]    at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
2016-04-27T01:04:28.7310174Z ##[error]    at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:102)
2016-04-27T01:04:28.7320179Z ##[error]    at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185)
2016-04-27T01:04:28.7330177Z ##[error]    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
2016-04-27T01:04:28.7330177Z ##[error]    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
2016-04-27T01:04:28.7340171Z ##[error]    at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:264)
2016-04-27T01:04:28.7340171Z ##[error]    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:259)
2016-04-27T01:04:28.7350179Z ##[error]    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:257)
2016-04-27T01:04:28.7350179Z ##[error]    at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:249)
2016-04-27T01:04:28.7360179Z ##[error]    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
2016-04-27T01:04:28.7360179Z ##[error]    at org.sonar.batch.scan.ProjectScanContainer.startComponents(ProjectScanContainer.java:127)
2016-04-27T01:04:28.7370181Z ##[error]    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
2016-04-27T01:04:28.7380175Z ##[error]    at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
2016-04-27T01:04:28.7380175Z ##[error]    at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
2016-04-27T01:04:28.7390182Z ##[error]    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
2016-04-27T01:04:28.7400181Z ##[error]    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
2016-04-27T01:04:28.7400181Z ##[error]    at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
2016-04-27T01:04:28.7410181Z ##[error]    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
2016-04-27T01:04:28.7410181Z ##[error]    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
2016-04-27T01:04:28.7420178Z ##[error]    at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
2016-04-27T01:04:28.7420178Z ##[error]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2016-04-27T01:04:28.7430180Z ##[error]    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2016-04-27T01:04:28.7430180Z ##[error]    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2016-04-27T01:04:28.7440179Z ##[error]    at java.lang.reflect.Method.invoke(Method.java:483)
2016-04-27T01:04:28.7440179Z ##[error]    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
2016-04-27T01:04:28.7450180Z ##[error]    ... 9 more

The error says that the file only has 128 lines. This is correct.

Here are the versions that I use:
  • SonarQube : 5.4 (up to date)
  • SonarQube msbuild runner: 2.0 (up to date)
  • SonarQube C# plugin: 5.1 (up to date)

If it can help, I have uploaded my coverage xml file and my sonar qube msbuild runner logs here : https://we.tl/fstfeCVFmw


Thanks,

Maxime

Jared Holgate

unread,
Apr 27, 2016, 2:16:30 PM4/27/16
to SonarQube, beaudry...@gmail.com
I'm having the same issue, see here;


No resolution as of yet I'm afraid. It's interesting that your setup used to work.
Reply all
Reply to author
Forward
0 new messages