2017-07-03 43 views
1

是否有人熟悉這個錯誤以及如何解決它?我使用的是Sonarqube Scanner 2.3.1和msbuild 12.0。該項目是4.5框架。Gitlab CI管道SonarQube msbuild錯誤ArgumentNullException:值不能爲空

Time Elapsed 00:00:39.12 
$ SonarQube.Scanner.MSBuild.exe end 
SonarQube Scanner for MSBuild 2.3.1 
Default properties file was found at C:\SonarQube\bin\SonarQube.Analysis.xml 
Loading analysis properties from C:\SonarQube\bin\SonarQube.Analysis.xml 
sonar.verbose=true was specified - setting the log verbosity to 'Debug' 
Post-processing started. 
11:00:26.108 Using environment variables to determine the download directory... 
11:00:26.188 11:00:26.188 sonar.verbose=true was specified - setting the log verbosity to 'Debug' 
11:00:26.191 Loading the SonarQube analysis config from F:\Gitlab-Runner\builds\1d3a7e33\1\folder\folder\folder\.sonarqube\conf\SonarQubeAnalysisConfig.xml 
11:00:26.191 Not running under TeamBuild 
11:00:26.191 Analysis base directory: F:\Gitlab-Runner\builds\1d3a7e33\1\folder\folder\folder\.sonarqube 
Build directory: 
Bin directory: F:\Gitlab-Runner\builds\1d3a7e33\1\folder\folder\folder\.sonarqube\bin 
Config directory: F:\Gitlab-Runner\builds\1d3a7e33\1\folder\folder\folder\.sonarqube\conf 
Output directory: F:\Gitlab-Runner\builds\1d3a7e33\1\folder\folder\folder\.sonarqube\out 
Config file: F:\Gitlab-Runner\builds\1d3a7e33\1\folder\folder\folder\.sonarqube\conf\SonarQubeAnalysisConfig.xml 
Generating SonarQube project properties file to F:\Gitlab-Runner\builds\1d3a7e33\1\folder\folder\folder\.sonarqube\out\sonar-project.properties 

Unhandled Exception: System.ArgumentNullException: Value cannot be null. 
Parameter name: key 
    at SonarQube.Common.ListPropertiesProvider.TryGetProperty(String key, Property& property) 
    at SonarQube.Common.AggregatePropertiesProvider.TryGetProperty(String key, Property& property) 
    at SonarQube.Common.AggregatePropertiesProvider.GetAllProperties() 
    at SonarScanner.Shim.PropertiesFileGenerator.GetAnalysisProperties(AnalysisConfig config) 
    at SonarScanner.Shim.PropertiesFileGenerator.GenerateFile(AnalysisConfig config, ILogger logger, IRoslynV1SarifFixer fixer) 
    at SonarScanner.Shim.SonarScannerWrapper.Execute(AnalysisConfig config, IEnumerable`1 userCmdLineArguments, ILogger logger) 
    at SonarQube.TeamBuild.PostProcessor.MSBuildPostProcessor.InvokeSonarScanner(IAnalysisPropertyProvider cmdLineArgs, AnalysisConfig config) 
    at SonarQube.TeamBuild.PostProcessor.MSBuildPostProcessor.Execute(String[] args, AnalysisConfig config, ITeamBuildSettings settings) 
    at SonarQube.Bootstrapper.BootstrapperClass.PostProcess() 
    at SonarQube.Bootstrapper.BootstrapperClass.Execute() 
    at SonarQube.Bootstrapper.Program.Execute(String[] args, ILogger logger) 
    at SonarQube.Bootstrapper.Program.Main(String[] args) 
ERROR: Job failed: exit status 3762504530 

回答

0

該問題是由稱爲sonar.analysis.mode的屬性被設置爲等於「issues」引起的。

問題模式不應該手動使用,因爲它只能由工具使用。 設置你的sonar.analysis.mode = [預覽/發佈] (發佈是默認的,所以你不必設置屬性,如果這是你想要的。)