Hello,
I'm trying to setup a new SonarQube project and connect it to a new Jenkins nightly build. Sadly, I'm getting an ArgumentNullException with not much information to go on. Whatever happens, in my opinion an ArgumentNullException should not surface. It should be handled inside and instead a useful error message should be written to the log.
11:33:24 Unpacking https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/3.0.2.656/sonar-scanner-msbuild-3.0.2.656.zip [^] to C:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\sonarqube.server.de on Jenkins
11:33:26 [workspace] $ C:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\sonarqube.server.de\MSBuild.SonarQube.Runner.exe begin /k:secretprojectkey "/n:MyProject" /v:trunk /d:sonar.host.url=http://sonarqube.server.de:9001 [^] /d:sonar.login=build ******** /d:sonar.resharper.cs.reportPath=resharper-results.xml /d:sonar.resharper.solutionFile=MyCompany\MyProject\MyCompany.MyProject.sln /d:sonar.cs.nunit.reportsPaths=NUnit-results.xml
11:33:27 SonarQube Scanner for MSBuild 3.0.2
11:33:27 Default properties file was found at C:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\sonarqube.server.de\SonarQube.Analysis.xml
11:33:27 Loading analysis properties from C:\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\sonarqube.server.de\SonarQube.Analysis.xml
11:33:27 Pre-processing started.
11:33:27 Preparing working directories...
11:33:27 11:33:27.198 Updating build integration targets...
11:33:27 11:33:27.276 Fetching analysis configuration settings...
11:33:28
11:33:28 Unhandled Exception: System.ArgumentNullException: Value cannot be null.
11:33:28 Parameter name: source
11:33:28 at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
11:33:28 at SonarQube.TeamBuild.PreProcessor.SonarWebService.<>c__DisplayClass8_2.<GetActiveRules>b__1(JObject r)
11:33:28 at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
11:33:28 at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
11:33:28 at SonarQube.TeamBuild.PreProcessor.SonarWebService.GetActiveRules(String qprofile)
11:33:28 at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ISonarQubeServer server, ProcessedArgs args, TeamBuildSettings settings, IDictionary`2& serverSettings, List`1& analyzersSettings)
11:33:28 at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs localSettings)
11:33:28 at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.Execute(String[] args)
11:33:28 at SonarQube.Bootstrapper.BootstrapperClass.PreProcess()
11:33:28 at SonarQube.Bootstrapper.BootstrapperClass.Execute()
11:33:28 at SonarQube.Bootstrapper.Program.Execute(String[] args, ILogger logger)
11:33:28 at SonarQube.Bootstrapper.Program.Main(String[] args)
11:33:28 at SonarQube.Old.Bootstrapper.Program.Main(String[] args)
11:33:29 ERROR: Execution of SonarQube Scanner for MSBuild failed (exit code -532.462.766)
I get the same exception when I execute this command line locally. We have two SonarQube instances, one "production" instance and one "playground" instance to test updates and new configurations. At the moment, they are identical (I've imported the database from production into the playground instance).
Interestingly, when I switch to the production instance, no exception.
It get this exception for any project right now. When running in "verbose" mode the exception seems to happen after downloading the quality profiles from the SonarQube instance (SonarQube is version 6.5 with C# plugin 6.3):
Fetching analysis configuration settings...
Downloading from http://sonarqube.server.de:9001/api/server/version...
Fetching properties for project 'myproject:core' from http://sonarqube.server.de:9001/api/settings/values?component=myproject%3Acore...
Downloading from http://sonarqube.server.de:9001/api/settings/values?component=myproject%3Acore...
Downloading from http://sonarqube.server.de:9001/api/languages/list...
Fetching quality profile for project 'myproject:core' from http://sonarqube.server.de:9001/api/qualityprofiles/search?projectKey=myproject%3Acore...
Downloading from http://sonarqube.server.de:9001/api/qualityprofiles/search?projectKey=myproject%3Acore...
Fetching active rules for quality profile 'cs-myproject-core-17443' from http://sonarqube.server.de:9001/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&activation=true&qprofile=cs-myproject-core-17443&p=1...
Downloading from http://sonarqube.server.de:9001/api/rules/search?f=repo,name,severity,lang,internalKey,templateKey,params,actives&ps=500&activation=true&qprofile=cs-myproject-core-17443&p=1...
-> callstack as shown above
Has anyone an idea what might be the problem? I'm at a loss right now.
Thanks,
Markus