Sonar execution failure with java.lang.RuntimeException

I am facing the following issue:
ERROR: Error during SonarScanner 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

Hey there.

The template post asks a bunch of questions.

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • how is SonarQube deployed: zip, Docker, Helm
  • what are you trying to achieve
  • what have you tried so far to achieve this

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

They aren’t just for show!

What version of SonarQube are you using? Can you include the full logs of failing analysis? Right now, it’s impossible to know at which point during the analysis something failed, or which component it came from (usually obvious from the full stacktrace).

Hey Colin,
which versions are you using
SonarQube: 10.4.1, Scanner: 5.0.1.3006
how is SonarQube deployed: Docker
what are you trying to achieve: I’m trying to run sonarqube analysis on github repository source code.

Here is the detailed logs about the error, I can’t provide more information as my companies information may be exposed:

ERROR: Error during SonarScanner 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:250)
	at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:163)
	at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:174)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:223)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:202)
	at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:351)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:223)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:202)
	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:138)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:223)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:202)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:71)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:65)
	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(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at jdk.proxy1/jdk.proxy1.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:126)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:81)
	at org.sonarsource.scanner.cli.Main.main(Main.java:62)
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:115)
	at com.google.protobuf.CodedInputStream$StreamDecoder.readRawBytesSlowPathOneChunk(CodedInputStream.java:2958)
	at com.google.protobuf.CodedInputStream$StreamDecoder.readBytesSlowPath(CodedInputStream.java:3009)
	at com.google.protobuf.CodedInputStream$StreamDecoder.readBytes(CodedInputStream.java:2420)
	at com.google.protobuf.UnknownFieldSet$Builder.mergeFieldFrom(UnknownFieldSet.java:513)
	at com.google.protobuf.UnknownFieldSet$Builder.mergeFrom(UnknownFieldSet.java:490)
	at com.google.protobuf.UnknownFieldSet$Builder.mergeFrom(UnknownFieldSet.java:603)
	at com.google.protobuf.UnknownFieldSet$Builder.mergeFrom(UnknownFieldSet.java:303)
	at com.google.protobuf.CodedInputStream$StreamDecoder.readGroup(CodedInputStream.java:2347)
	at com.google.protobuf.UnknownFieldSet$Builder.mergeFieldFrom(UnknownFieldSet.java:517)
	at com.google.protobuf.GeneratedMessageV3$Builder.parseUnknownField(GeneratedMessageV3.java:887)
	at org.sonarqube.ws.Ce$SubmitResponse$Builder.mergeFrom(Ce.java:775)
	at org.sonarqube.ws.Ce$SubmitResponse$1.parsePartialFrom(Ce.java:985)
	at org.sonarqube.ws.Ce$SubmitResponse$1.parsePartialFrom(Ce.java:977)
	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:248)
	... 24 more

Are you running the scanner locally? In a CI/CD environment (GitHub Actions)?

I’m running scanner from CI/CD github actions ( runs on ubuntu Github hosted runner)

Thanks. I’ll quote my colleague Ann who responded to your post:

1 Like