which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube Version 10.3.0.82913, MsBuild Scanner, Plugin csharp version 9.13.0.79967
how is SonarQube deployed: zip
what are you trying to achieve:
We are trying to do code analysis with SonarQube. We have multiple agents running on the same VM for the pipelines. In last 2 days SonarQubePrepare@5 task started to fail intermittently(usually works on 2nd attempt) on multiple C# projects builds.
With exception below:
2024-05-29T19:23:55.0323738Z Author : sonarsource
2024-05-29T19:23:55.0323783Z Help : Version: 5.19.1. [More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
2024-05-29T19:23:55.0323851Z ==============================================================================
2024-05-29T19:23:56.6212717Z [command]D:\Agents\DT.Agent1\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.19.1\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe begin /k:DataHub-API-DevSecOps
2024-05-29T19:24:17.5155974Z SonarScanner for MSBuild 5.15
2024-05-29T19:24:17.5157104Z Using the .NET Framework version of the Scanner for MSBuild
2024-05-29T19:24:47.4825619Z Pre-processing started.
2024-05-29T19:24:50.7769923Z Preparing working directories...
2024-05-29T19:25:05.6791046Z 20:25:05.678 Updating build integration targets...
2024-05-29T19:25:07.5921943Z 20:25:07.591 Fetching analysis configuration settings...
2024-05-29T19:25:09.5025316Z 20:25:09.501 Provisioning analyzer assemblies for cs...
2024-05-29T19:25:09.5031128Z 20:25:09.502 Installing required Roslyn analyzers...
2024-05-29T19:25:09.5035067Z 20:25:09.502 Processing plugin: csharp version 9.13.0.79967
2024-05-29T19:25:16.6401636Z
2024-05-29T19:25:16.6402076Z ##[error]Unhandled Exception:
2024-05-29T19:25:16.6450272Z ##[error]System.ApplicationException: Object synchronization method was called from an unsynchronized block of code.
at System.Threading.Mutex.ReleaseMutex()
at SonarScanner.MSBuild.Common.SingleGlobalInstanceMutex.Dispose()
at SonarScanner.MSBuild.PreProcessor.Roslyn.SubdirIndex.GetOrCreatePath(String key)
at SonarScanner.MSBuild.PreProcessor.Roslyn.EmbeddedAnalyzerInstaller.GetPluginResourceFiles(Plugin plugin)
at SonarScanner.MSBuild.PreProcessor.Roslyn.EmbeddedAnalyzerInstaller.InstallAssemblies(IEnumerable`1 plugins)
at SonarScanner.MSBuild.PreProcessor.Roslyn.RoslynAnalyzerProvider.FetchAnalyzerPlugins(String language, IEnumerable`1 activeRules)
at SonarScanner.MSBuild.PreProcessor.Roslyn.RoslynAnalyzerProvider.SetupAnalyzer(BuildSettings teamBuildSettings, IAnalysisPropertyProvider sonarProperties, IEnumerable`1 rules, String language)
at SonarScanner.MSBuild.PreProcessor.PreProcessor.<FetchArgumentsAndRuleSets>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.PreProcessor.PreProcessor.<DoExecute>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.PreProcessor.PreProcessor.<Execute>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.BootstrapperClass.<PreProcess>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.BootstrapperClass.<Execute>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.<Execute>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.<Execute>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.<Main>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.<Main>(String[] args)
2024-05-29T19:25:16.6452771Z System.ApplicationException: Object synchronization method was called from an unsynchronized block of code.
2024-05-29T19:25:16.6452928Z at System.Threading.Mutex.ReleaseMutex()
2024-05-29T19:25:16.6453034Z at SonarScanner.MSBuild.Common.SingleGlobalInstanceMutex.Dispose()
2024-05-29T19:25:16.6453268Z at SonarScanner.MSBuild.PreProcessor.Roslyn.SubdirIndex.GetOrCreatePath(String key)
2024-05-29T19:25:16.6453413Z at SonarScanner.MSBuild.PreProcessor.Roslyn.EmbeddedAnalyzerInstaller.GetPluginResourceFiles(Plugin plugin)
2024-05-29T19:25:16.6453608Z at SonarScanner.MSBuild.PreProcessor.Roslyn.EmbeddedAnalyzerInstaller.InstallAssemblies(IEnumerable`1 plugins)
2024-05-29T19:25:16.6453769Z at SonarScanner.MSBuild.PreProcessor.Roslyn.RoslynAnalyzerProvider.FetchAnalyzerPlugins(String language, IEnumerable`1 activeRules)
2024-05-29T19:25:16.6453958Z at SonarScanner.MSBuild.PreProcessor.Roslyn.RoslynAnalyzerProvider.SetupAnalyzer(BuildSettings teamBuildSettings, IAnalysisPropertyProvider sonarProperties, IEnumerable`1 rules, String language)
2024-05-29T19:25:16.6454131Z at SonarScanner.MSBuild.PreProcessor.PreProcessor.<FetchArgumentsAndRuleSets>d__9.MoveNext()
2024-05-29T19:25:16.6454259Z --- End of stack trace from previous location where exception was thrown ---
2024-05-29T19:25:16.6454381Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-05-29T19:25:16.6454513Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-05-29T19:25:16.6454644Z at SonarScanner.MSBuild.PreProcessor.PreProcessor.<DoExecute>d__7.MoveNext()
2024-05-29T19:25:16.6454756Z --- End of stack trace from previous location where exception was thrown ---
2024-05-29T19:25:16.6454872Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-05-29T19:25:16.6455000Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-05-29T19:25:16.6455125Z at SonarScanner.MSBuild.PreProcessor.PreProcessor.<Execute>d__6.MoveNext()
2024-05-29T19:25:16.6455241Z --- End of stack trace from previous location where exception was thrown ---
2024-05-29T19:25:16.6455347Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-05-29T19:25:16.6455472Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-05-29T19:25:16.6455600Z at SonarScanner.MSBuild.BootstrapperClass.<PreProcess>d__10.MoveNext()
2024-05-29T19:25:16.6455719Z --- End of stack trace from previous location where exception was thrown ---
2024-05-29T19:25:16.6455831Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-05-29T19:25:16.6455943Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-05-29T19:25:16.6456251Z at SonarScanner.MSBuild.BootstrapperClass.<Execute>d__8.MoveNext()
2024-05-29T19:25:16.6456370Z --- End of stack trace from previous location where exception was thrown ---
2024-05-29T19:25:16.6456485Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-05-29T19:25:16.6456614Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-05-29T19:25:16.6456736Z at SonarScanner.MSBuild.Program.<Execute>d__4.MoveNext()
2024-05-29T19:25:16.6456841Z --- End of stack trace from previous location where exception was thrown ---
2024-05-29T19:25:16.6456954Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-05-29T19:25:16.6457079Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-05-29T19:25:16.6457201Z at SonarScanner.MSBuild.Program.<Execute>d__3.MoveNext()
2024-05-29T19:25:16.6457310Z --- End of stack trace from previous location where exception was thrown ---
2024-05-29T19:25:16.6457416Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-05-29T19:25:16.6457541Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-05-29T19:25:16.6457678Z at SonarScanner.MSBuild.Program.<Main>d__2.MoveNext()
2024-05-29T19:25:16.6457791Z --- End of stack trace from previous location where exception was thrown ---
2024-05-29T19:25:16.6457945Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-05-29T19:25:16.6458063Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-05-29T19:25:16.6458182Z at SonarScanner.MSBuild.Program.<Main>(String[] args)
2024-05-29T19:25:16.6566407Z ##[error]The process 'D:\Agents\DT.Agent1\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.19.1\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 3762504530
2024-05-29T19:25:16.6640728Z ##[section]Finishing: Configure Sonarqube Analysis
After upgrade to latest version, same error have appeared.
2024-09-24T14:59:40.7966562Z ##[section]Starting: Configure Sonarqube Analysis
2024-09-24T14:59:40.8036541Z ==============================================================================
2024-09-24T14:59:40.8036650Z Task : Prepare Analysis Configuration
2024-09-24T14:59:40.8036701Z Description : Prepare SonarQube analysis configuration
2024-09-24T14:59:40.8036759Z Version : 5.19.2
2024-09-24T14:59:40.8036807Z Author : sonarsource
2024-09-24T14:59:40.8036852Z Help : [More Information](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarqube-extension-for-azure-devops/)
2024-09-24T14:59:40.8036951Z ==============================================================================
2024-09-24T14:59:41.6639263Z ##[warning]This task is deprecated. Please upgrade to the latest version. For more information, refer to https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarqube-extension-for-azure-devops/
2024-09-24T14:59:41.7038596Z [command]D:\AzureDevOps\Path\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\5.19.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe begin /k:CustomerProject
2024-09-24T14:59:49.2758459Z SonarScanner for MSBuild 5.15.1
2024-09-24T14:59:49.2759052Z Using the .NET Framework version of the Scanner for MSBuild
2024-09-24T15:00:20.4332620Z Pre-processing started.
2024-09-24T15:00:20.9956131Z Preparing working directories...
2024-09-24T15:00:31.1883654Z 16:00:31.176 Updating build integration targets...
2024-09-24T15:00:33.9437466Z 16:00:33.932 Fetching analysis configuration settings...
2024-09-24T15:00:34.5029887Z 16:00:34.495 Provisioning analyzer assemblies for cs...
2024-09-24T15:00:34.5035304Z 16:00:34.495 Installing required Roslyn analyzers...
2024-09-24T15:00:34.5039208Z 16:00:34.495 Processing plugin: csharp version 9.27.0.93347
2024-09-24T15:00:42.7062716Z
2024-09-24T15:00:42.7062985Z ##[error]Unhandled Exception:
2024-09-24T15:00:42.7109623Z ##[error]System.ApplicationException: Object synchronization method was called from an unsynchronized block of code.
at System.Threading.Mutex.ReleaseMutex()
at SonarScanner.MSBuild.Common.SingleGlobalInstanceMutex.Dispose()
at SonarScanner.MSBuild.PreProcessor.Roslyn.SubdirIndex.GetOrCreatePath(String key)
at SonarScanner.MSBuild.PreProcessor.Roslyn.EmbeddedAnalyzerInstaller.GetPluginResourceFiles(Plugin plugin)
at SonarScanner.MSBuild.PreProcessor.Roslyn.EmbeddedAnalyzerInstaller.InstallAssemblies(IEnumerable`1 plugins)
at SonarScanner.MSBuild.PreProcessor.Roslyn.RoslynAnalyzerProvider.FetchAnalyzerPlugins(String language, IEnumerable`1 activeRules)
at SonarScanner.MSBuild.PreProcessor.Roslyn.RoslynAnalyzerProvider.SetupAnalyzer(BuildSettings teamBuildSettings, IAnalysisPropertyProvider sonarProperties, IEnumerable`1 rules, String language)
at SonarScanner.MSBuild.PreProcessor.PreProcessor.<FetchArgumentsAndRuleSets>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.PreProcessor.PreProcessor.<DoExecute>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.PreProcessor.PreProcessor.<Execute>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.BootstrapperClass.<PreProcess>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.BootstrapperClass.<Execute>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.<Execute>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.<Execute>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.<Main>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at SonarScanner.MSBuild.Program.<Main>(String[] args)
2024-09-24T15:00:42.7112885Z System.ApplicationException: Object synchronization method was called from an unsynchronized block of code.
2024-09-24T15:00:42.7113055Z at System.Threading.Mutex.ReleaseMutex()
2024-09-24T15:00:42.7113193Z at SonarScanner.MSBuild.Common.SingleGlobalInstanceMutex.Dispose()
2024-09-24T15:00:42.7113344Z at SonarScanner.MSBuild.PreProcessor.Roslyn.SubdirIndex.GetOrCreatePath(String key)
2024-09-24T15:00:42.7113530Z at SonarScanner.MSBuild.PreProcessor.Roslyn.EmbeddedAnalyzerInstaller.GetPluginResourceFiles(Plugin plugin)
2024-09-24T15:00:42.7113706Z at SonarScanner.MSBuild.PreProcessor.Roslyn.EmbeddedAnalyzerInstaller.InstallAssemblies(IEnumerable`1 plugins)
2024-09-24T15:00:42.7113982Z at SonarScanner.MSBuild.PreProcessor.Roslyn.RoslynAnalyzerProvider.FetchAnalyzerPlugins(String language, IEnumerable`1 activeRules)
2024-09-24T15:00:42.7114222Z at SonarScanner.MSBuild.PreProcessor.Roslyn.RoslynAnalyzerProvider.SetupAnalyzer(BuildSettings teamBuildSettings, IAnalysisPropertyProvider sonarProperties, IEnumerable`1 rules, String language)
2024-09-24T15:00:42.7114425Z at SonarScanner.MSBuild.PreProcessor.PreProcessor.<FetchArgumentsAndRuleSets>d__9.MoveNext()
2024-09-24T15:00:42.7114575Z --- End of stack trace from previous location where exception was thrown ---
2024-09-24T15:00:42.7114944Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-09-24T15:00:42.7115092Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-09-24T15:00:42.7115246Z at SonarScanner.MSBuild.PreProcessor.PreProcessor.<DoExecute>d__7.MoveNext()
2024-09-24T15:00:42.7298881Z --- End of stack trace from previous location where exception was thrown ---
2024-09-24T15:00:42.7299083Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-09-24T15:00:42.7299240Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-09-24T15:00:42.7299420Z at SonarScanner.MSBuild.PreProcessor.PreProcessor.<Execute>d__6.MoveNext()
2024-09-24T15:00:42.7299622Z --- End of stack trace from previous location where exception was thrown ---
2024-09-24T15:00:42.7299763Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-09-24T15:00:42.7299920Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-09-24T15:00:42.7300068Z at SonarScanner.MSBuild.BootstrapperClass.<PreProcess>d__10.MoveNext()
2024-09-24T15:00:42.7300209Z --- End of stack trace from previous location where exception was thrown ---
2024-09-24T15:00:42.7300883Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-09-24T15:00:42.7301037Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-09-24T15:00:42.7301187Z at SonarScanner.MSBuild.BootstrapperClass.<Execute>d__8.MoveNext()
2024-09-24T15:00:42.7301341Z --- End of stack trace from previous location where exception was thrown ---
2024-09-24T15:00:42.7301483Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-09-24T15:00:42.7301630Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-09-24T15:00:42.7301774Z at SonarScanner.MSBuild.Program.<Execute>d__4.MoveNext()
2024-09-24T15:00:42.7301909Z --- End of stack trace from previous location where exception was thrown ---
2024-09-24T15:00:42.7302105Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-09-24T15:00:42.7302262Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-09-24T15:00:42.7302400Z at SonarScanner.MSBuild.Program.<Execute>d__3.MoveNext()
2024-09-24T15:00:42.7302535Z --- End of stack trace from previous location where exception was thrown ---
2024-09-24T15:00:42.7302673Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-09-24T15:00:42.7302836Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-09-24T15:00:42.7302977Z at SonarScanner.MSBuild.Program.<Main>d__2.MoveNext()
2024-09-24T15:00:42.7303112Z --- End of stack trace from previous location where exception was thrown ---
2024-09-24T15:00:42.7303250Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2024-09-24T15:00:42.7303397Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2024-09-24T15:00:42.7303548Z at SonarScanner.MSBuild.Program.<Main>(String[] args)
2024-09-24T15:00:42.7304334Z ##[warning]LIB_ResourceFile does not exist
2024-09-24T15:00:42.7304934Z ##[warning]Resource file haven't been set, can't find loc string for key: LIB_ProcessExitCode
2024-09-24T15:00:42.7305540Z ##[warning]Error while executing SonarQube:Prepare task: path/ 3762504530