SonarScanner com.google.protobuf.InvalidProtocolBufferException with no more info

  • Sonar version: Version 8.5
  • SonarScanne:r 4.5.0.2216
  • JDK 11
INFO: Scanner configuration file: /tmp/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 4.0.0.1744
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Linux 4.15.0-1077-aws amd64
INFO: User cache: /root/.sonar/cache
INFO: SonarQube server 8.5.0
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=326ms
INFO: Server id: 02F7F878-AXVEQb_fcWa2vTBRruS4
INFO: User cache: /root/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=187ms
INFO: Load/download plugins (done) | time=6193ms
INFO: Process project properties
INFO: Process project properties (done) | time=7ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=1ms
INFO: Project key: coverages
INFO: Base dir: /root/project
INFO: Working dir: /root/project/.scannerwork
INFO: Load project settings for component key: 'coverages'
INFO: Load project settings for component key: 'coverages' (done) | time=155ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=217ms
INFO: Auto-configuring with CI 'CircleCI'
INFO: Load active rules
INFO: Load active rules (done) | time=2687ms
INFO: Indexing files...
INFO: Project configuration:
INFO: Load project repositories
INFO: Load project repositories (done) | time=134ms
INFO: 26 files indexed
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for js: Sonar way
INFO: ------------- Run sensors on module coverages
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=148ms
INFO: Sensor CSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [cssfamily] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
INFO: Sensor JavaScript analysis [javascript]
INFO: 26 source files to be analyzed
INFO: 26/26 source files have been analyzed
INFO: Java-based frontend sensor [javascript]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/root/.sonar/cache/2fab92be44e07f1d367f891a55258736/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: 26 source files to be analyzed
INFO: Java-based frontend sensor [javascript] (done) | time=525ms
INFO: 26/26 source files have been analyzed
INFO: Sensor JavaScript analysis [javascript] (done) | time=3089ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=1ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=0ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=3ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=8ms
INFO: CPD Executor 8 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 18 files
INFO: CPD Executor CPD calculation finished (done) | time=15ms
INFO: Analysis report generated in 47ms, dir size=120 KB
INFO: Analysis report compressed in 54ms, zip size=55 KB
INFO: Analysis report uploaded in 73ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 17.334s
INFO: Final Memory: 14M/57M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.RuntimeException: com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.
	at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:213)
	at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:142)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:366)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:144)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	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:185)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either that the input has been truncated or that an embedded message misreported its own length.
	at com.google.protobuf.InvalidProtocolBufferException.truncatedMessage(InvalidProtocolBufferException.java:84)
	at com.google.protobuf.CodedInputStream$StreamDecoder.readRawBytesSlowPathOneChunk(CodedInputStream.java:2923)
	at com.google.protobuf.CodedInputStream$StreamDecoder.readBytesSlowPath(CodedInputStream.java:2974)
	at com.google.protobuf.CodedInputStream$StreamDecoder.readBytes(CodedInputStream.java:2386)
	at com.google.protobuf.UnknownFieldSet$Builder.mergeFieldFrom(UnknownFieldSet.java:544)
	at com.google.protobuf.UnknownFieldSet$Builder.mergeFrom(UnknownFieldSet.java:521)
	at com.google.protobuf.UnknownFieldSet$Builder.mergeFrom(UnknownFieldSet.java:634)
	at com.google.protobuf.UnknownFieldSet$Builder.mergeFrom(UnknownFieldSet.java:308)
	at com.google.protobuf.CodedInputStream$StreamDecoder.readGroup(CodedInputStream.java:2311)
	at com.google.protobuf.UnknownFieldSet$Builder.mergeFieldFrom(UnknownFieldSet.java:548)
	at com.google.protobuf.GeneratedMessageV3.parseUnknownField(GeneratedMessageV3.java:320)
	at org.sonarqube.ws.Ce$SubmitResponse.<init>(Ce.java:348)
	at org.sonarqube.ws.Ce$SubmitResponse.<init>(Ce.java:290)
	at org.sonarqube.ws.Ce$SubmitResponse$1.parsePartialFrom(Ce.java:1015)
	at org.sonarqube.ws.Ce$SubmitResponse$1.parsePartialFrom(Ce.java:1009)
	at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:215)
	at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:232)
	at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:237)
	at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:48)
	at org.sonar.scanner.report.ReportPublisher.upload(ReportPublisher.java:211)
	... 21 more

Hi,

Welcome to the community!

At a guess your network proxy (IIS?) interfered with the upload to the server of the analysis report. We see this from time to time when the proxy isn’t configured to allow a large enough payload to accommodate the analysis report for a large project.

 
HTH,
Ann