From time to time Sonar END process fail with java.lang.IllegalStateException

  • SonarQube server - Enterprise Edition Version 9.5 (build 56709)
    sonar-scanner-msbuild - 5.0.4

Build fails from time to time, but more often it fails than finish successfully.

ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.filesystem.ProjectFileIndexer
  at org.sonar.core.platform.SpringComponentContainer.getComponentByType(
  at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(
  at org.sonar.core.platform.SpringComponentContainer.startComponents(
  at org.sonar.core.platform.SpringComponentContainer.execute(
  at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(
  at org.sonar.core.platform.SpringComponentContainer.startComponents(
  at org.sonar.core.platform.SpringComponentContainer.execute(
  at org.sonar.batch.bootstrapper.Batch.doExecute(
  at org.sonar.batch.bootstrapper.Batch.execute(
  at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
  at java.base/java.lang.reflect.Method.invoke(
  at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(
  at com.sun.proxy.$Proxy0.execute(Unknown Source)
  at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(
  at org.sonarsource.scanner.api.EmbeddedScanner.execute(
  at org.sonarsource.scanner.cli.Main.execute(
  at org.sonarsource.scanner.cli.Main.execute(
  at org.sonarsource.scanner.cli.Main.main(

Check detailed stack trace in attached file
filed stacktrace.txt (36.3 KB)

  • I thougth there where a problem with memory lack on agent\sonar server machine\sonar-scanner process


The underlying problem (you have to scroll right about 3 miles to find it) is:

HttpException: Error 504 on : 504.0 GatewayTimeout

There is likely something on your network, e.g. a proxy, that’s blocking the analysis report submission.

Because this is intermittent, I’m going to guess that it’s related to the size of the analysis report crossing some arbitrary threshold set in the corporate proxy/firewall/etc.

You should check with your network folks.


1 Like

Each time when the build fail rules loading takes pretty long time
Is it possible that there is something wrong with current rules set?


I doubt it.

Instead, I’d suspect that your network conditions are headed south and the slow rule loading is an early indicator.


Can you explain me about such a requst(project.protobuf)?
What is the reason of the request and what SQ server generate here?
what depends on the server’s response time?
Is it possible that problem will disappear if we increase timeout?


That URL doesn’t resolve for me. I guess it’s something you picked out of an analysis log? In general, analysis starts with a number of requests to the server to get the resources needed to run analysis. Then it uses those resources locally to compile an analysis report. It finishes by submitting that report to the server.

I know that’s pretty generic. Does it help at all?