VSTS SonarQube错误ArgumentNullException:值不能为空

时间:2017-12-19 15:16:33

标签: tfs msbuild sonarqube azure-devops sonarqube-scan

是否有人熟悉此错误以及如何解决?我正在使用由VSTS构建和发布提供的Sonarqube Scanner 2.3.1。我无法在互联网上找到解决这个问题的方法。我按照https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Extension+for+VSTS-TFS上的步骤进行了操作。根据下面的日志,“GetActiveRules()”似乎出现了问题。使用的SonarQube服务器版本是6.3。

2017-12-19T14:47:51.7143720Z ##[section]Starting: Prepare the SonarQube analysis
2017-12-19T14:47:51.7353647Z ==============================================================================
2017-12-19T14:47:51.7354146Z Task         : SonarQube  Scanner for MSBuild - Begin Analysis (new)
2017-12-19T14:47:51.7354696Z Description  : Prepare the SonarQube analysis of your solution
2017-12-19T14:47:51.7354860Z Version      : 2.0.0
2017-12-19T14:47:51.7355026Z Author       : sonarsource
2017-12-19T14:47:51.7355220Z Help         : Version: 2.0.0. [More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
2017-12-19T14:47:51.7355431Z ==============================================================================
2017-12-19T14:47:51.7628359Z Preparing task execution handler.
2017-12-19T14:47:57.6434164Z Executing the powershell script: d:\a\_tasks\SonarQubeScannerMsBuildBegin_15b84ca1-b62f-4a2a-a403-89b77a063157\2.0.0\SonarQubePreBuild.ps1
2017-12-19T14:47:58.3703010Z 
2017-12-19T14:47:58.3703167Z 
2017-12-19T14:48:00.4422238Z SonarQube Scanner for MSBuild 2.2
2017-12-19T14:48:00.4422634Z Default properties file was found at D:\a\_tasks\SonarQubeScannerMsBuildBegin_15b84ca1-b62f-4a2a-a403-89b77a063157\2.0.0\SonarQubeScannerMsBuild\SonarQube.Analysis.xml
2017-12-19T14:48:00.4423006Z Loading analysis properties from D:\a\_tasks\SonarQubeScannerMsBuildBegin_15b84ca1-b62f-4a2a-a403-89b77a063157\2.0.0\SonarQubeScannerMsBuild\SonarQube.Analysis.xml
2017-12-19T14:48:00.4423338Z sonar.verbose=true was specified - setting the log verbosity to 'Debug'
2017-12-19T14:48:00.4423542Z Pre-processing started.
2017-12-19T14:48:00.4424077Z Preparing working directories...
2017-12-19T14:48:00.4424265Z Using environment variables to determine the download directory...
2017-12-19T14:48:00.4424445Z Using environment variable 'AGENT_BUILDDIRECTORY', value 'd:\a\1'
2017-12-19T14:48:00.4424630Z Creating directory: d:\a\1\.sonarqube
2017-12-19T14:48:00.4424794Z SonarQube server URL: http://redacted.net:443/
2017-12-19T14:48:00.4424971Z SonarQube Scanner for MSBuild 2.2
2017-12-19T14:48:00.4425192Z 14:47:59.003  Loading analysis properties from D:\a\_tasks\SonarQubeScannerMsBuildBegin_15b84ca1-b62f-4a2a-a403-89b77a063157\2.0.0\SonarQubeScannerMsBuild\SonarQube.Analysis.xml
2017-12-19T14:48:00.4425445Z 14:47:59.009  sonar.verbose=true was specified - setting the log verbosity to 'Debug'
2017-12-19T14:48:00.4425633Z 14:47:59.062  Updating build integration targets...
2017-12-19T14:48:00.4426049Z 14:47:59.065  Installed SonarQube.Integration.ImportBefore.targets to C:\Users\buildguest\AppData\Local\Microsoft\MSBuild\14.0\Microsoft.Common.targets\ImportBefore
2017-12-19T14:48:00.4426656Z 14:47:59.065  Installed SonarQube.Integration.ImportBefore.targets to C:\Users\buildguest\AppData\Local\Microsoft\MSBuild\12.0\Microsoft.Common.targets\ImportBefore
2017-12-19T14:48:00.4427081Z 14:47:59.066  Installed SonarQube.Integration.targets to d:\a\1\.sonarqube\bin\targets
2017-12-19T14:48:00.4427645Z 14:47:59.067  Creating config and output folders...
2017-12-19T14:48:00.4427824Z 14:47:59.067  Creating directory: d:\a\1\.sonarqube\conf
2017-12-19T14:48:00.4427991Z 14:47:59.067  Creating directory: d:\a\1\.sonarqube\out
2017-12-19T14:48:00.4428155Z 14:47:59.1  Fetching analysis configuration settings...
2017-12-19T14:48:00.4428368Z 14:47:59.264  Fetching properties for project 'redacted' from http://redacted.net:443/api/properties?resource=redacted...
2017-12-19T14:48:00.4430680Z 14:47:59.264  Downloading from http://redacted.net:443/api/properties?resource=redacted...
2017-12-19T14:48:00.4430970Z 14:47:59.866  Downloading from http://redacted.net:443/api/updatecenter/installed_plugins...
2017-12-19T14:48:00.4431258Z 14:48:00.016  Fetching quality profile for project 'redacted' from http://redacted.net:443/api/qualityprofiles/search?projectKey=redacted...
2017-12-19T14:48:00.4431629Z 14:48:00.016  Downloading from http://redacted.net:443/api/qualityprofiles/search?projectKey=redacted...
2017-12-19T14:48:00.4431954Z 14:48:00.211  Downloading from http://redacted.net:443/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&activation=true&qprofile=cs-redacted-63418&p=1...
2017-12-19T14:48:00.7438998Z ##[error]
2017-12-19T14:48:00.9448180Z ##[error]Unhandled Exception: System.ArgumentNullException: Value cannot be null.
2017-12-19T14:48:00.9448811Z ##[error]Parameter name: source
2017-12-19T14:48:00.9449032Z ##[error]at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
2017-12-19T14:48:00.9449485Z ##[error]at SonarQube.TeamBuild.PreProcessor.SonarWebService.<>c__DisplayClass6_0.<GetActiveRules>b__0(JObject r)
2017-12-19T14:48:00.9449717Z ##[error]at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
2017-12-19T14:48:00.9449967Z ##[error]at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
2017-12-19T14:48:00.9450225Z ##[error]at SonarQube.TeamBuild.PreProcessor.SonarWebService.GetActiveRules(String qprofile)
2017-12-19T14:48:00.9450833Z ##[error]at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ISonarQubeServer server, ProcessedArgs args, TeamBuildSettings settings, IDictionary`2& serverSettings, List`1& analyzersSettings)
2017-12-19T14:48:00.9451189Z ##[error]at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs args)
2017-12-19T14:48:00.9451450Z ##[error]at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.Execute(String[] args)
2017-12-19T14:48:00.9451708Z ##[error]at SonarQube.Bootstrapper.BootstrapperClass.PreProcess()
2017-12-19T14:48:00.9451927Z ##[error]at SonarQube.Bootstrapper.BootstrapperClass.Execute()
2017-12-19T14:48:00.9452161Z ##[error]at SonarQube.Bootstrapper.Program.Main(String[] args)
2017-12-19T14:48:00.9452379Z ##[error]at SonarQube.Old.Bootstrapper.Program.Main(String[] args)
2017-12-19T14:48:06.4313573Z ##[error]System.Exception: Unexpected exit code received from batch file: -532462766
2017-12-19T14:48:06.4314025Z    at Microsoft.TeamFoundation.DistributedTask.Task.Internal.InvokeBatchScriptCmdlet.ProcessRecord()
2017-12-19T14:48:06.4314270Z    at System.Management.Automation.CommandProcessor.ProcessRecord()
2017-12-19T14:48:06.4976374Z ##[error]PowerShell script completed with 1 errors.
2017-12-19T14:48:06.4983562Z ##[section]Finishing: Prepare the SonarQube analysis

0 个答案:

没有答案