Error while running Sonar analysis using MSbuild Scanner

css

(Nikitha Appana) #1

Version : SonarQube 7.3

Error ::
ERROR: Error during SonarQube Scanner execution*
java.lang.IllegalStateException: Failed to parse json result of external process execution 'node \.sonarqube\out\.sonar\Development_Solution_Development_Solution_29E453BF-3595-4DAC-9C46-24209A76A32D\css-bundle\node_modules\stylelint\bin\stylelint \WebApps\API\Valiant.Client.Web\**\*{.css,.less,.scss} --config \.sonarqube\out\.sonar\Development_Solution_Development_Solution_29E453BF-3595-4DAC-9C46-24209A76A32D\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:45)*
 at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:88)*
 at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:62)*
 at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:74)*
 at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:166)*
 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)*
 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)*
 at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:300)*
 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:295)*
 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:293)*
 at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:269)*
 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)*
 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)*
 at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)*
 at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:82)*
 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)*
 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)*
 at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:131)*
 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:*
 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.*
 The SonarQube Scanner did not complete successfully*
 00:38:49.823 Creating a summary markdown file...*
 00:38:49.837 Post-processing failed. Exit code: 1*
 Process exited with code 1*
 Process exited with code 1*
 Step End Sonar Analysis (Command Line) failed* 

I am in desperate need of a solution for this error.


(Elena Vilchik) #2

Try to update CSS plugin to the latest (1.0.2). I’m not sure that your problem will be fixed, but at least logging should be better.


(Nikitha Appana) #3

Upgrading the plugin to version 1.0.2 gave me a new error

**[Step 11/30]* ERROR: Error during SonarQube Scanner execution*

[16:40:01] **[Step 11/30]* INFO: ------------------------------------------------------------------------*

[16:40:01] **[Step 11/30]* java.lang.IllegalStateException: unexpected error while parsing protobuf file: C:\TG_Test\.sonarqube\out\179\output-cs\token-cpd.pb*

[16:40:01] **[Step 11/30]* at org.sonarsource.dotnet.shared.plugins.protobuf.RawProtobufImporter.accept(RawProtobufImporter.java:47)*

[16:40:01] **[Step 11/30]* at org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.parseProtobuf(ProtobufDataImporter.java:103)*

[16:40:01] **[Step 11/30]* at org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.importResults(ProtobufDataImporter.java:74)*

[16:40:01] **[Step 11/30]* at org.sonar.plugins.csharp.CSharpSensor.executeInternal(CSharpSensor.java:91)*

[16:40:01] **[Step 11/30]* at org.sonar.plugins.csharp.CSharpSensor.execute(CSharpSensor.java:69)*

[16:40:01] **[Step 11/30]* at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:45)*

[16:40:01] **[Step 11/30]* at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:88)*

[16:40:01] **[Step 11/30]* at org.sonar.scanner.phases.SensorsExecutor.lambda$execute$1(SensorsExecutor.java:65)*

[16:40:01] **[Step 11/30]* at org.sonar.scanner.phases.SensorsExecutor.withGlobalStrategy(SensorsExecutor.java:80)*

[16:40:01] **[Step 11/30]* at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:65)*

[16:40:01] **[Step 11/30]* at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:74)*

[16:40:01] **[Step 11/30]* at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:166)*

[16:40:01] **[Step 11/30]* at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)*

[16:40:01] **[Step 11/30]* at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)*

[16:40:01] **[Step 11/30]* at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:300)*

[16:40:01] **[Step 11/30]* at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:295)*

[16:40:01] **[Step 11/30]* at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:269)*

[16:40:01] **[Step 11/30]* at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)*

[16:40:01] **[Step 11/30]* at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)*

[16:40:01] **[Step 11/30]* at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)*

[16:40:01] **[Step 11/30]* at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:82)*

[16:40:01] **[Step 11/30]* at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)*

[16:40:01] **[Step 11/30]* at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)*

[16:40:01] **[Step 11/30]* at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:131)*

[16:40:01] **[Step 11/30]* at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)*

[16:40:01] **[Step 11/30]* at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:111)*

[16:40:01] **[Step 11/30]* at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)*

[16:40:01] **[Step 11/30]* at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)*

[16:40:01] **[Step 11/30]* at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)*

[16:40:01] **[Step 11/30]* at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)*

[16:40:01] **[Step 11/30]* at java.lang.reflect.Method.invoke(Method.java:498)*

[16:40:01] **[Step 11/30]* at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)*

[16:40:01] **[Step 11/30]* at com.sun.proxy.$Proxy0.execute(Unknown Source)*

[16:40:01] **[Step 11/30]* at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)*

[16:40:01] **[Step 11/30]* at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)*

[16:40:01] **[Step 11/30]* at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)*

[16:40:01] **[Step 11/30]* at org.sonarsource.scanner.cli.Main.execute(Main.java:77)*

[16:40:01] **[Step 11/30]* at org.sonarsource.scanner.cli.Main.main(Main.java:61)*

[16:40:01] **[Step 11/30]* Caused by: com.google.protobuf.InvalidProtocolBufferException: Protocol message was too large. May be malicious. Use CodedInputStream.setSizeLimit() to increase the size limit.*

[16:40:01] **[Step 11/30]* at com.google.protobuf.InvalidProtocolBufferException.sizeLimitExceeded(InvalidProtocolBufferException.java:134)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.CodedInputStream$StreamDecoder.tryRefillBuffer(CodedInputStream.java:2725)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.CodedInputStream$StreamDecoder.refillBuffer(CodedInputStream.java:2676)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.CodedInputStream$StreamDecoder.readRawByte(CodedInputStream.java:2737)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.CodedInputStream$StreamDecoder.readRawVarint64SlowPath(CodedInputStream.java:2547)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.CodedInputStream$StreamDecoder.readRawVarint32(CodedInputStream.java:2441)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.CodedInputStream$StreamDecoder.readStringRequireUtf8(CodedInputStream.java:2220)*

[16:40:01] **[Step 11/30]* at org.sonarsource.dotnet.protobuf.SonarAnalyzer$CopyPasteTokenInfo$TokenInfo.dynamicMethod(SonarAnalyzer.java:3178)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.GeneratedMessageLite.parsePartialFrom(GeneratedMessageLite.java:1355)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.GeneratedMessageLite$DefaultInstanceBasedParser.parsePartialFrom(GeneratedMessageLite.java:1340)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.GeneratedMessageLite$DefaultInstanceBasedParser.parsePartialFrom(GeneratedMessageLite.java:1328)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.CodedInputStream$StreamDecoder.readMessage(CodedInputStream.java:2314)*

[16:40:01] **[Step 11/30]* at org.sonarsource.dotnet.protobuf.SonarAnalyzer$CopyPasteTokenInfo.dynamicMethod(SonarAnalyzer.java:3721)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.GeneratedMessageLite.parsePartialFrom(GeneratedMessageLite.java:1355)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.GeneratedMessageLite$DefaultInstanceBasedParser.parsePartialFrom(GeneratedMessageLite.java:1340)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.GeneratedMessageLite$DefaultInstanceBasedParser.parsePartialFrom(GeneratedMessageLite.java:1328)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:197)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.AbstractParser.parsePartialDelimitedFrom(AbstractParser.java:238)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.AbstractParser.parseDelimitedFrom(AbstractParser.java:251)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.AbstractParser.parseDelimitedFrom(AbstractParser.java:256)*

[16:40:01] **[Step 11/30]* at com.google.protobuf.AbstractParser.parseDelimitedFrom(AbstractParser.java:49)*

[16:40:01] **[Step 11/30]* at org.sonarsource.dotnet.shared.plugins.protobuf.RawProtobufImporter.accept(RawProtobufImporter.java:40)*

[16:40:01] **[Step 11/30]* ... 37 more*

[16:40:01] **[Step 11/30]* ERROR:*

[16:40:01] **[Step 11/30]* ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.*

[16:40:03] **[Step 11/30]* The SonarQube Scanner did not complete successfully*

[16:40:03] **[Step 11/30]* 16:40:03.163 Creating a summary markdown file...*

[16:40:03] **[Step 11/30]* 16:40:03.178 Post-processing failed. Exit code: 1*

[16:40:03] **[Step 11/30]* Process exited with code 1*

(Nikitha Appana) #4

@ [Lena] I am constantly getting this error on the solution scan. COuld you please provide guidance on the issue.

ERROR: unexpected error while parsing protobuf file: C:\TG_Test.sonarqube\out\239\output-cs\token-cpd.pb
ERROR: Caused by: Protocol message was too large. May be malicious. Use CodedInputStream.setSizeLimit() to increase the size limit.