SonarQubeAnalyze v6 task failed in latest Azure DevOps managed windows agent(3.240.1)

I am running self-managed SonarQube Server 10.3.0.82913.I use Azure DevOps managed agent to run my pipeline. When I use SonarQubeAnalyze v5 task with Microsoft managed Azure DevOps agent, and it always worked fine until early of June.

That’s when Microsoft update Azure DevOps agent version to 3.240.1 and deprecated SonarQubeAnalyze v5.

SonarQube scan failed since then, we tried to upgrade to SonarQubeAnalyze v6, but still got same errors. I contacted Microsoft support; I was asked to contact SonarQube for support. I would appreciate any help in advance.

2024-06-13T16:52:21.4340135Z ##[error]ERROR: Error during SonarScanner execution
2024-06-13T16:52:21.4341343Z ERROR: Error during SonarScanner execution
2024-06-13T16:52:21.4342367Z ##[error]java.lang.IllegalArgumentException: Line 11 is out of range for file YVR.ARSE.Web/_Imports.razor. File has 10 lines.
2024-06-13T16:52:21.4343435Z java.lang.IllegalArgumentException: Line 11 is out of range for file YVR.ARSE.Web/_Imports.razor. File has 10 lines.
2024-06-13T16:52:21.4368971Z ##[error]at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)
2024-06-13T16:52:21.4370804Z 	at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)
2024-06-13T16:52:21.4373192Z ##[error]at org.sonar.scanner.DefaultFileLinesContext.checkLineRange(DefaultFileLinesContext.java:63)
	at org.sonar.scanner.DefaultFileLinesContext.setIntValue(DefaultFileLinesContext.java:56)
	at org.sonarsource.dotnet.shared.plugins.protobuf.MetricsImporter.consumeFor(MetricsImporter.java:66)
	at org.sonarsource.dotnet.shared.plugins.protobuf.MetricsImporter.consumeFor(MetricsImporter.java:38)
2024-06-13T16:52:21.4374851Z 	at org.sonar.scanner.DefaultFileLinesContext.checkLineRange(DefaultFileLinesContext.java:63)
2024-06-13T16:52:21.4376211Z 	at org.sonar.scanner.DefaultFileLinesContext.setIntValue(DefaultFileLinesContext.java:56)
2024-06-13T16:52:21.4376994Z 	at org.sonarsource.dotnet.shared.plugins.protobuf.MetricsImporter.consumeFor(MetricsImporter.java:66)
2024-06-13T16:52:21.4379291Z 	at org.sonarsource.dotnet.shared.plugins.protobuf.MetricsImporter.consumeFor(MetricsImporter.java:38)
2024-06-13T16:52:21.4381318Z ##[error]at org.sonarsource.dotnet.shared.plugins.protobuf.ProtobufImporter.consume(ProtobufImporter.java:73)
	at org.sonarsource.dotnet.shared.plugins.protobuf.RawProtobufImporter.accept(RawProtobufImporter.java:49)
	at org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.parseProtobuf(ProtobufDataImporter.java:105)
2024-06-13T16:52:21.4383313Z 	at org.sonarsource.dotnet.shared.plugins.protobuf.ProtobufImporter.consume(ProtobufImporter.java:73)
2024-06-13T16:52:21.4384019Z 	at org.sonarsource.dotnet.shared.plugins.protobuf.RawProtobufImporter.accept(RawProtobufImporter.java:49)
2024-06-13T16:52:21.5820025Z 	at org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.parseProtobuf(ProtobufDataImporter.java:105)
2024-06-13T16:52:21.5822119Z ##[error]at org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.importResults(ProtobufDataImporter.java:80)
	at org.sonarsource.dotnet.shared.plugins.DotNetSensor.importResults(DotNetSensor.java:104)
	at org.sonarsource.dotnet.shared.plugins.DotNetSensor.execute(DotNetSensor.java:82)
2024-06-13T16:52:21.5824238Z 	at org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.importResults(ProtobufDataImporter.java:80)
2024-06-13T16:52:21.5824990Z 	at org.sonarsource.dotnet.shared.plugins.DotNetSensor.importResults(DotNetSensor.java:104)
2024-06-13T16:52:21.5825428Z 	at org.sonarsource.dotnet.shared.plugins.DotNetSensor.execute(DotNetSensor.java:82)
2024-06-13T16:52:21.5833422Z ##[error]at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
	at org.sonar.scanner.sensor.ProjectSensorsExecutor.execute(ProjectSensorsExecutor.java:52)
2024-06-13T16:52:21.5834430Z 	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
2024-06-13T16:52:21.5834892Z 	at org.sonar.scanner.sensor.ProjectSensorsExecutor.execute(ProjectSensorsExecutor.java:52)
2024-06-13T16:52:21.5835933Z ##[error]at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:366)
2024-06-13T16:52:21.5836624Z 	at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:366)
2024-06-13T16:52:21.5837450Z ##[error]at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:201)
2024-06-13T16:52:21.5838194Z 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:201)
2024-06-13T16:52:21.5839796Z ##[error]at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:180)
	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:139)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:201)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:180)
2024-06-13T16:52:21.5840888Z 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:180)
2024-06-13T16:52:21.5841343Z 	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:139)
2024-06-13T16:52:21.5841812Z 	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:201)
2024-06-13T16:52:21.5842212Z 	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:180)
2024-06-13T16:52:21.5843721Z ##[error]at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:71)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:65)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2024-06-13T16:52:21.5844688Z 	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:71)
2024-06-13T16:52:21.5845070Z 	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:65)
2024-06-13T16:52:21.5845494Z 	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
2024-06-13T16:52:21.5845863Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2024-06-13T16:52:21.5848177Z ##[error]at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
	at org.sonarsource.scanner.cli.Main.main(Main.java:62)
ERROR:
2024-06-13T16:52:21.5861354Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
2024-06-13T16:52:21.5862180Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2024-06-13T16:52:21.5880665Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
2024-06-13T16:52:21.5881244Z 	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
2024-06-13T16:52:21.5881672Z 	at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
2024-06-13T16:52:21.5882014Z 	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
2024-06-13T16:52:21.5882465Z 	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
2024-06-13T16:52:21.5882868Z 	at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
2024-06-13T16:52:21.5883722Z 	at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
2024-06-13T16:52:21.5884224Z 	at org.sonarsource.scanner.cli.Main.main(Main.java:62)
2024-06-13T16:52:21.5884606Z ERROR: 
2024-06-13T16:52:21.5885293Z ##[error]The SonarScanner did not complete successfully
2024-06-13T16:52:21.5886170Z The SonarScanner did not complete successfully
2024-06-13T16:52:21.5886817Z ##[error]16:52:21.547  Post-processing failed. Exit code: 1
2024-06-13T16:52:21.5888138Z 16:52:21.547  Post-processing failed. Exit code: 1
2024-06-13T16:52:21.5889437Z ##[warning]Can't find loc string for key: LIB_ProcessExitCode
2024-06-13T16:52:21.5890453Z ##[warning]Error while executing SonarQube:Analyze task: LIB_ProcessExitCode D:\a\_temp\48ed7a74-8777-4c96-aede-3a5b76fbe3a7\SonarScanner.MSBuild.exe 1
2024-06-13T16:52:21.5891722Z ##[error]LIB_ProcessExitCode D:\a\_temp\48ed7a74-8777-4c96-aede-3a5b76fbe3a7\SonarScanner.MSBuild.exe 1
2024-06-13T16:52:21.5895252Z ##[section]Finishing: SonarQubeAnalyze

Hey there!

Interestingly enough, the issue is actually tied to an upgrade of the .NET framework for your project (either intentional or not, if the version was unpinned).

In any case, the issue is fixed in SonarQube v10.6! Time to upgrade!

1 Like