Open sxnaan opened 1 year ago
Hi, I'm getting the same issue. Any news here?
We just fixed this issue in our Jenkins pipeline. We were using an env var called COVERAGE_FILE in our pipeline.
We needed to rename our environment variable COVERAGE_FILE to literally anything else. That env var has a special meaning for new versions of python coverage and by overwriting it (inadvertently) we are creating that error
Getting this error from a Sonar check in Jenkins for my project. Never seen it before. Sonar team says it may be from a broken report from Cobertura. Appreciate any insight
Full trace:
11:16:14 java.lang.IllegalStateException: Line number must be strictly positive: 0 11:16:14 at org.sonar.api.utils.Preconditions.checkState(Preconditions.java:61) 11:16:14 at org.sonar.api.batch.sensor.coverage.internal.DefaultCoverage.validateLine(DefaultCoverage.java:82) 11:16:14 at org.sonar.api.batch.sensor.coverage.internal.DefaultCoverage.lineHits(DefaultCoverage.java:69) 11:16:14 at org.sonar.plugins.python.coverage.CoberturaParser.collectFileData(CoberturaParser.java:156) 11:16:14 at org.sonar.plugins.python.coverage.CoberturaParser.collectFileMeasures(CoberturaParser.java:109) 11:16:14 at org.sonar.plugins.python.coverage.CoberturaParser.lambda$parseReport$0(CoberturaParser.java:68) 11:16:14 at org.sonar.plugins.python.parser.StaxParser.parse(StaxParser.java:62) 11:16:14 at org.sonar.plugins.python.parser.StaxParser.parse(StaxParser.java:53) 11:16:14 at org.sonar.plugins.python.coverage.CoberturaParser.parseReport(CoberturaParser.java:72) 11:16:14 at org.sonar.plugins.python.coverage.PythonCoverageSensor.parseReport(PythonCoverageSensor.java:115) 11:16:14 at org.sonar.plugins.python.coverage.PythonCoverageSensor.execute(PythonCoverageSensor.java:81) 11:16:14 at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64) 11:16:14 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88) 11:16:14 at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61) 11:16:14 at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79) 11:16:14 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61) 11:16:14 at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82) 11:16:14 at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188) 11:16:14 at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167) 11:16:14 at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:403) 11:16:14 at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:399) 11:16:14 at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:368) 11:16:14 at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188) 11:16:14 at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167) 11:16:14 at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:137) 11:16:14 at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188) 11:16:14 at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167) 11:16:14 at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72) 11:16:14 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66) 11:16:14 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46) 11:16:14 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 11:16:14 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 11:16:14 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 11:16:14 at java.base/java.lang.reflect.Method.invoke(Method.java:566) 11:16:14 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) 11:16:14 at com.sun.proxy.$Proxy0.execute(Unknown Source) 11:16:14 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189) 11:16:14 at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138) 11:16:14 at org.sonarsource.scanner.cli.Main.execute(Main.java:126) 11:16:14 at org.sonarsource.scanner.cli.Main.execute(Main.java:81) 11:16:14 at org.sonarsource.scanner.cli.Main.main(Main.java:62)