Malformed json response

Versión used

  • SonarQube 7.4
  • SonarScanner for MSBuild 4.5
  • cshar 7.9.1

Everything was working fine unitll today (I just updated to SonarScanner for MSBuild 4.4.2 -> 4.5) and a crash its happening when the analysis starts:

Unpacking https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.5.0.1761/sonar-scanner-msbuild-4.5.0.1761-net46.zip to C:\Program Files (x86)\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarQube_Scanner_for_MSBuild on Jenkins
[api_develop] $ “C:\Program Files (x86)\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarQube_Scanner_for_MSBuild\SonarScanner.MSBuild.exe” begin /k:org.xxxx:rpcs-api /n:RPCS-Api /v:1.4-SNAPSHOT /d:sonar.host.url=http://10.247.64.7:9000 /d:sonar.cs.vscoveragexml.reportsPaths=rpcs-api\TestResults\vstest2.coveragexml /d:sonar.cs.vstest.reportsPaths=rpcs-api\TestResults\vstest.trx /d:sonar.exclusions=**/custom.css
SonarScanner for MSBuild 4.5
Using the .NET Framework version of the Scanner for MSBuild
Default properties file was found at C:\Program Files (x86)\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarQube_Scanner_for_MSBuild\SonarQube.Analysis.xml
Loading analysis properties from C:\Program Files (x86)\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SonarQube_Scanner_for_MSBuild\SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories…
13:23:53.642 Updating build integration targets…
13:23:53.657 Fetching analysis configuration settings…

Unhandled Exception: Newtonsoft.Json.JsonException: Malformed json response, “actives” field should contain rule ‘csharpsquid:S4529’
at SonarScanner.MSBuild.PreProcessor.SonarWebService.<>c__DisplayClass8_2.b__1(JObject r)
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection) at SonarScanner.MSBuild.PreProcessor.SonarWebService.GetActiveRules(String qprofile) at SonarScanner.MSBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ISonarQubeServer server, ProcessedArgs args, TeamBuildSettings settings, IDictionary2& 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)
ERROR: Execution of SonarScanner for MSBuild failed (exit code 255)

Trying to rollback to the previous version didn’t worked either

Hi @josefarinna,

Sorry for this really late answer. Are you still experiencing the issue?

Cheers,
Amaury

I “fixed” the issue removing that deprecated rule from the database. I dont think this is the correct way to fix this, but nothing else I tried worked.

Hello
some warning to all SonarQube users: applying changes directly at database level is very risky, do it at your own risks!!!
If you experience this same problem, please raise it as a bug (critical if confirmed) so that it can be fixed.

Best.
Sylvain