Illegal state from Sonar when scanning sprint boot application

This is a very strange issue, it looks like Sonar which we have integrated into our CI/CD is throwing an exception every other build. NOT every build. But can find no other reports or source that would explain why. Is this a bug in Sonar? OR is it a problem in my code?

    Analyzing 13059 functions to detect bugs.
    Failed to analyze;ILjava/util/concurrent/atomic/AtomicInteger;Ljava/util/Set;Lroot/to/another/class;)Ljava/util/Optional; due to an exception; skipping.
    java.lang.IllegalStateException: Incompatible type constraints were ANDed - this should be impossible because the corresponding paths should be eliminated
    	at com.sonarsource.A.A.G.C$_B.A(na:874)
    	at com.sonarsource.A.A.B.F.A(na:2546)
    	at com.sonarsource.A.A.R.C(na:297)
    	at com.sonarsource.A.A.V.A(na:3143)
    	at com.sonarsource.A.A.V.A(na:1340)
    	at com.sonarsource.A.A.V.A(na:920)
    	at com.sonarsource.A.A.V.A(na:12)
    	at com.sonarsource.A.A.V.E(na:2983)
    	at com.sonarsource.A.A.V.A(na:932)
    	at com.sonarsource.A.A.V.B(na:3509)
    	at com.sonarsource.A.A.V.A(na:1908)
    	at com.sonarsource.A.C.executeChecksOnFunction(na:479)
    	at com.sonarsource.A.C.executeChecks(na:1032)
    	at com.sonarsource.A.C.execute(na:3562)
    	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(
    	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
    	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(
    	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(
    	at org.sonar.core.platform.ComponentContainer.startComponents(
using org.sonarqube  version ""


Welcome to the community!

Can you give us the version string that appears in your SonarQube page footer, please?


Hi, We run Sonar from gradle and capture the files, so not sure what SonarQube page you are talking about, From gradle:
plugins {
id “org.sonarqube” version “”

Hi Gavin,

When you analyze… where do your results go?


The results are published on
But that works fine, its the gradle build thats failing

If you are able to message me a Zoom link I could maybe show you exactly what I mean?

Hi Gavin,

You filed this in the SonarQube category, which is why I was asking you for your SonarQube version. I’ll move it to the appropriate category.

Now that I know you’re on a current product version (by definition, SonarCloud is always current)…

Since this problem happens only every other build, I suspect some build agent-side caching is part of what’s going on, but I’m going to flag this for more expert eyes.


Thank you! Sorry I mis-spoke when I say every other, I would say MOST of them but not every build!

Hi @gavin_fitzpatrick ,

Thank you for reporting this problem!

Is this a bug in Sonar?

Yes, this looks like there is a bug in our analyzer!

If your project is open source, please put a link to it so that we can directly reproduce the bug.

Otherwise, if your project is private, you could share with us privately the content of ir/java generated folder ( you should see the full path from the analysis logs, something like Reading IR files from /agent/_work/53/s/target/sonar/ir/java).