I’m new to SonarQube and the community, and trying to re-implement something that was implemented, then shut down after the previous AppSec Engineer left (it then sat dormant for a little over a year). Originally, it was deployed with Docker. I shut down the docker instance and deployed with .zip (although the docker images were not removed and can easily be spun back up with the previous configs if necessary).
My pipeline tasks:
Use Nuget
NuGet restore
Prepare Analysis on SQ
Build SLN
VsTest Assemblies
Run Code Analysis (SQ)
Publish Quality Gate (SQ)
… (cont’d)
Current version of .zip is 10.7.
Unsure of scanner version, but it’s Azure DevOps.
Trying to use .NET scanner/build
Have tried task v5, v6 and v7
Problem: I keep receiving the following error:
Plugin resource not found: csharp, version 9.32.0.97167. Resource: SonarAnalyzer-9.32.0.97167.zip.
***As I understand it, if I build out the SonarQube server and add the project, the Azure DevOps runner is supposed to execute all of the scanning stuff for me. This is a crucial part I could be missing.
What have I done: Spent several hours searching the docs, re-reading the installation manual, re-reading the DevOps Integration parts, looking at the scanner information (which leads me to believe the scanner part does not apply to my situation because I am using ADO, so ADO will take care of that for me) and searched the community posts here. Several google searches which don’t turn up anything for this error message except a log file of someone else with a similar problem.
More of the error log (truncated)
##[error]Unhandled Exception:
##[error]System.IO.FileNotFoundException: Plugin resource not found: csharp, version 9.32.0.97167. Resource: SonarAnalyzer-9.32.0.97167.zip.
at SonarScanner.MSBuild.PreProcessor.Roslyn.EmbeddedAnalyzerInstaller.FetchResourceFromServer(Plugin plugin, String targetDir)
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 ---
(truncated)
--- 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)
##[warning]Can't find loc string for key: LIB_ProcessExitCode
##[error][ERROR] SonarQube: Error while executing task Prepare: LIB_ProcessExitCode C:\hostedtoolcache\windows\SonarScanner .NET\9.0.0\x64\SonarScanner.MSBuild.exe 3762504530
##[error]LIB_ProcessExitCode C:\hostedtoolcache\windows\SonarScanner .NET\9.0.0\x64\SonarScanner.MSBuild.exe 3762504530
Finishing: Prepare analysis on SonarQube