Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
Recently upgrade to v10 - how is SonarQube deployed: zip, Docker, Helm
Zip - what are you trying to achieve
Running quality checks from Azure DevOps - what have you tried so far to achieve this
It was working fine prior to a recent upgrade then without anything else changing we got the following error when trying to run code analysis from an Azure DevOps build
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
00:03:35.683 Fetching analysis configuration settings...
##[error]00:03:37.015 Failed to request and parse 'https://ourdomain/api/qualityprofiles/search?projectKey=ourproject': Sequence contains more than one matching element
00:03:37.015 Failed to request and parse 'https://ourdomain/api/qualityprofiles/search?projectKey=ourproject': Sequence contains more than one matching element
##[error]Unhandled Exception:
##[error]System.InvalidOperationException: Sequence contains more than one matching element
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at SonarScanner.MSBuild.PreProcessor.SonarWebService.<>c__DisplayClass6_0.<TryGetQualityProfile>b__0()
at SonarScanner.MSBuild.PreProcessor.SonarWebService.DoLogExceptions[T](Func`1 op, String url, Action`1 onError)
at SonarScanner.MSBuild.PreProcessor.SonarWebService.TryGetQualityProfile(String projectKey, String projectBranch, String organization, String language, String& qualityProfileKey)
at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ISonarQubeServer server, ProcessedArgs args, TeamBuildSettings settings, IDictionary`2& serverSettings, List`1& analyzersSettings)
at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs localSettings)
at SonarScanner.MSBuild.BootstrapperClass.PreProcess()
at SonarScanner.MSBuild.BootstrapperClass.Execute()
at SonarScanner.MSBuild.Program.Execute(String[] args, ILogger logger)
at SonarScanner.MSBuild.Program.Main(String[] args)
System.InvalidOperationException: Sequence contains more than one matching element
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at SonarScanner.MSBuild.PreProcessor.SonarWebService.<>c__DisplayClass6_0.<TryGetQualityProfile>b__0()
at SonarScanner.MSBuild.PreProcessor.SonarWebService.DoLogExceptions[T](Func`1 op, String url, Action`1 onError)
at SonarScanner.MSBuild.PreProcessor.SonarWebService.TryGetQualityProfile(String projectKey, String projectBranch, String organization, String language, String& qualityProfileKey)
at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ISonarQubeServer server, ProcessedArgs args, TeamBuildSettings settings, IDictionary`2& serverSettings, List`1& analyzersSettings)
at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs localSettings)
at SonarScanner.MSBuild.BootstrapperClass.PreProcess()
at SonarScanner.MSBuild.BootstrapperClass.Execute()
at SonarScanner.MSBuild.Program.Execute(String[] args, ILogger logger)
##[error]The process 'D:\a\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.11.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 3762504530
Finishing: Prepare Analysis Configuration