Failed to parse json result of external process execution in sonar analysis

css
jenkins
scanner
sonarqube

(Mahesh Gohil) #1

#bug:fault

  • SonarQubeScanner version:- 2.8.1. Jenkins version:- 2.145 SonarQube server :- 7.1 (build 11001
  • Today we face issue in sonar analysis. Below are the logs.We are using SonarQube Scanner for jenkins plugins in jenkins. Earlier its works and able to see the sonar projects with anlysis in Sonar server
java.lang.IllegalStateException: Failed to parse json result of external process execution 'node /mnt/jenkins/builds/workspace/pse-e5/feature_2.4.3/.scannerwork/css-bundle/node_modules/stylelint/bin/stylelint /mnt/jenkins/builds/workspace/pse-e5/feature_2.4.3/**/*{.css,.less,.scss} --config /mnt/jenkins/builds/workspace/pse-e5/feature_2.4.3/.scannerwork/css-bundle/stylelintconfig.json -f json'. To diagnose, try to run it manually.
    at org.sonar.css.plugin.CssRuleSensor.execute(CssRuleSensor.java:104)
    at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
    at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:88)
    at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:82)
    at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:68)
    at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:88)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:180)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
    at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:302)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:297)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:271)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
    at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
    at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
    at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121)
    at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:111)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy0.execute(Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
    at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
    at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
    at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
    at com.google.gson.Gson.fromJson(Gson.java:891)
    at com.google.gson.Gson.fromJson(Gson.java:817)
    at org.sonar.css.plugin.CssRuleSensor.execute(CssRuleSensor.java:96)
    ... 32 more
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
    at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:351)
    at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:70)
    at com.google.gson.Gson.fromJson(Gson.java:879)
    ... 34 more
ERROR: 

(Tibor Blenessy) #2

Hello,

which version of SonarCSS plugin is installed on your SQ server? We fixed similar issue in the latest version of SonarCSS 1.0.2 , you can update it from marketplace page in SonarQube.