Dotnet sonarscanner 10.4.1 Unable to access jarfile

Must-share information (formatted with Markdown):

  • which versions are you using SonarScanner for .NET 10.4.1
  • what are you trying to achieve: dotnet sonarscanner end
  • what have you tried so far to achieve: Rollback to 10.3.0

When using the latest dotnet sonarscanner tool with version 10.4.1 we get the following exception. Rolling back solves it.

dotnet sonarscanner end /d:sonar.login=**** SonarScanner for .NET 10.4.1 Using the .NET Core version of the Scanner for .NET Post-processing started. 04:58:14.867 WARNING: File ‘/home/jenkins/.nuget/packages/microsoft.net.test.sdk/18.0.0/build/net8.0/Microsoft.NET.Test.Sdk.Program.cs’ does not exist. 04:58:14.91 Using Java found in Analysis Config: /usr/lib/jvm/java-17-openjdk-amd64/bin/java 04:58:14.931 Error: Unable to access jarfile /home/jenkins/.sonar/cache/18e7603825ce6741327a1566f61ab7bd26d0ec578a1ac6eded7b25cf7ffc64cb/scanner-developer-2025.1.1.104738-all.jar Unhandled exception. System.IO.IOException: Pipe is broken. at System.IO.Pipes.PipeStream.CheckWriteOperations() at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) at System.IO.StreamWriter.Dispose(Boolean disposing) at System.IO.TextWriter.Dispose() at SonarScanner.MSBuild.Common.ProcessRunner.Execute(ProcessRunnerArguments runnerArgs) at SonarScanner.MSBuild.Shim.SonarEngineWrapper.Execute(ProcessRunnerArguments args) at SonarScanner.MSBuild.Shim.SonarEngineWrapper.Execute(AnalysisConfig config, String standardInput, IAnalysisPropertyProvider userCmdLineArguments) at SonarScanner.MSBuild.PostProcessor.PostProcessor.InvokeScannerEngine(IAnalysisPropertyProvider cmdLineArgs, AnalysisConfig config, ScannerEngineInput input) at SonarScanner.MSBuild.PostProcessor.PostProcessor.Execute(String args, AnalysisConfig config, IBuildSettings settings) at SonarScanner.MSBuild.BootstrapperClass.PostProcess() at SonarScanner.MSBuild.BootstrapperClass.Execute() at SonarScanner.MSBuild.Program.Execute(String args, IRuntime runtime) at SonarScanner.MSBuild.Program.Main(String args) at SonarScanner.MSBuild.Program.(String args)

If it helps we use mutliple docker stages, with individual containers.
So sonar start & dotnet build run in 1 container.
All test stages run in a different container

Sonar end run in a different container.

Hello @pregress

We cache some artifacts in the begin step, that we also need in the end step. Please make sure that the cache is available in all containers that run the begin and end steps.

You can specify the path to the cache by specifying sonar.userHome like so in the begin step:

dotnet sonarscanner begin ... /d:sonar.userHome=/some/persisted/folder

You can also instead specify /d:sonar.scanner.useSonarScannerCLI=true in the begin step if the problem persists.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.