Sonarqube C# 扫描器异常:"java.lang.IllegalArgumentException: is not a valid line offset for pointer"

Sonarqube C# scanner exception: "java.lang.IllegalArgumentException: is not a valid line offset for pointer"

有人知道这是怎么回事吗?

在 windows 服务器上使用 Sonarqube v5.6,c# scanner v5.5.0.479

似乎在多个文件中发现了这一点,而不是总是相同的文件,这是最令人担忧的。

有人有什么想法吗?

16:46:03 INFO: Importing analysis results from E:\Jenkins\workspace\Job Build-UnitTest (PullRequests)\.sonar\output-cs
16:46:05 INFO: ------------------------------------------------------------------------
16:46:05 INFO: EXECUTION FAILURE
16:46:05 INFO: ------------------------------------------------------------------------
16:46:05 INFO: Total time: 3:36.304s
16:46:05 INFO: Final Memory: 53M/700M
16:46:05 INFO: ------------------------------------------------------------------------
16:46:05 ERROR: Error during SonarQube Scanner execution
16:46:05 java.lang.IllegalArgumentException: 30 is not a valid line offset for pointer. File [moduleKey=JOB:develop, relative=DataStructures/Interval.cs, basedir=E:\Jenkins\workspace\Job Build-UnitTest (PullRequests)] has 1 character(s) at line 132
16:46:05    at org.sonar.api.internal.google.common.base.Preconditions.checkArgument(Preconditions.java:148)
16:46:05    at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:218)
16:46:05    at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:209)
16:46:05    at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:239)
16:46:05    at org.sonarsource.dotnet.shared.plugins.SensorContextUtils.toTextRange(SensorContextUtils.java:41)
16:46:05    at org.sonarsource.dotnet.shared.plugins.protobuf.IssuesImporter.importMessage(IssuesImporter.java:54)
16:46:05    at org.sonarsource.dotnet.shared.plugins.protobuf.IssuesImporter.importMessage(IssuesImporter.java:31)
16:46:05    at org.sonarsource.dotnet.shared.plugins.protobuf.AbstractProtobufImporter.accept(AbstractProtobufImporter.java:49)
16:46:05    at org.sonarsource.dotnet.shared.plugins.AbstractSensor.parseProtobuf(AbstractSensor.java:80)
16:46:05    at org.sonarsource.dotnet.shared.plugins.AbstractSensor.importResults(AbstractSensor.java:70)
16:46:05    at org.sonar.plugins.csharp.CSharpSensor.executeInternal(CSharpSensor.java:114)
16:46:05    at org.sonar.plugins.csharp.CSharpSensor.execute(CSharpSensor.java:85)
16:46:05    at org.sonar.batch.sensor.SensorWrapper.analyse(SensorWrapper.java:57)
16:46:05    at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
16:46:05    at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
16:46:05    at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
16:46:05    at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
16:46:05    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
16:46:05    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
16:46:05    at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
16:46:05    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
16:46:05    at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
16:46:05    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
16:46:05    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
16:46:05    at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
16:46:05    at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
16:46:05    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
16:46:05    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
16:46:05    at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
16:46:05    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
16:46:05    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
16:46:05    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:46:05    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:46:05    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:46:05    at java.lang.reflect.Method.invoke(Method.java:498)
16:46:05    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
16:46:05    at com.sun.proxy.$Proxy0.execute(Unknown Source)
16:46:05    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:240)
16:46:05    at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
16:46:05    at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
16:46:05    at org.sonarsource.scanner.cli.Main.execute(Main.java:72)
16:46:05    at org.sonarsource.scanner.cli.Main.main(Main.java:60)
16:46:05 ERROR: 
16:46:05 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
16:46:05 ERROR: SonarQube scanner exited with non-zero code: 1

这是 C# 插件中的错误。修复即将到来。在此之前,您可以将文件的编码更改为 UTF-8。