Gradle build reports success but sonarcloud page is still in configuration state

  • ALM used: GitHub
  • CI system used: GitHub Actions / gradle
  • Scanner command used when applicable: ./gradlew clean build sonarqube -x test -x regressionTest -x integrationTest --info
  • Languages of the repository: Java, Groovy

In our Java project, we integrate sonarcloud with a gradle build. For the configuration, we followed the suggested path for github with gradle. After the github action ran successfully, the sonarcloud project page did not refresh. So we chose to run the manual configuration. On the dev machine, we ran

export SONAR_TOKEN=abcdef123456789
./gradlew build sonarqube -x test -x regressionTest -x integrationTest --info

All the tasks were run successfully, including the sonarqube task. The relevant parts of the output read as (full output can be made available privately):

Skipping task ':app:compileTestJava' as it is up-to-date.
:app:compileTestJava (Thread[Execution worker for ':',5,main]) completed. Took 0.01 secs.
:app:sonarqube (Thread[Execution worker for ':',5,main]) started.

> Task :app:sonarqube
JaCoCo report task detected, but XML report is not enabled or it was not produced. Coverage for this task will not be reported.
Caching disabled for task ':app:sonarqube' because:
  Build cache is disabled
Task ':app:sonarqube' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
JaCoCo report task detected, but XML report is not enabled or it was not produced. Coverage for this task will not be reported.
[...]
Analysis report uploaded in 596ms
ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=blahblah_privateProjectFoobar
Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
More about the report processing at https://sonarcloud.io/api/ce/task?id=blah
Analysis total time: x.336 s
:app:sonarqube (Thread[Execution worker for ':',5,main]) completed. Took y.155 secs.

However, when we go to the URL indicated by the console output, it still shows the project configuration page, and not the analysis dashboard.

Any insights or help regarding the issue is greatly appreciated.

Update: we know now were to look for the culprit. The last URL in the log output gives a JSON with an error message:

It is now clear what the next steps will be.

Hey there.

What is the error from the report processing? It’s not in the last reply.

Dear Colin, thank you for picking this up! It seems that we’ve hit a quota limit. The message is roughly as follows:

"errorMessage":"This analysis will make your organization \u0027foobar\u0027 to reach the maximum allowed lines limit (having 123456789 lines). \nPlease contact the administrator of the organization to resolve this issue."

I am already in touch with the person in our organization who manages the licences.

BTW I am really puzzled why hitting the quota limit does not fail the gradle build. After all, the build has no analysis results, and a pipeline which is green without passing the quality gate is no good. Maybe you can feed this back to the product development team.

By default, scans don’t wait for the Quality Gate status to be computed (it can take some time). And – there’s a longstanding debate about whether or not a failed Quality Gate should fail the build (is it worth holding up a deployment to a dev environment because of some code smells?)

In any case – you can still add -Dsonar.qualitygate.wait=true to your gradle command to wait for the Quality Gate status, and fail if it’s failed.

1 Like