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(SpringComponentContainer.java:139)
  at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:352)
  at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
  at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
  at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:135)
  at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
  at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
  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(NativeMethodAccessorImpl.java:62)
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.base/java.lang.reflect.Method.invoke(Method.java:567)
  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:189)
  at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
  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)

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

Hi,

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

HttpException: Error 504 on https://simcorpsonarqubetest.azurewebsites.net/batch/project.protobuf?key=IMS-CSharp&branch=MG-IMS/master : 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.

 
HTH,
Ann

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?

Hi,

I doubt it.

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

 
FWIW,
Ann

@ganncamp
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?

Hi,

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?

 
Ann