Have to regularly perform branch cleanup (deletion) on the SonarQube portal

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server:- Developer Edition v2025.1 (102418))
  • how is SonarQube deployed:- Helm
  • what are you trying to achieve:- Just usual, Static Code Analysis
  • what have you tried so far to achieve this:- It’s in place and working as expected. I’m facing an issue, on top of it.

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

We’re currently using the Developer Edition, v2025.1 (102418).

I’m writing to highlight an issue we frequently encounter, where we are required to manually perform branch cleanup (deletion) from the SonarQube portal in order to avoid pipeline(Gitlab) failures. Without this cleanup, the Sonar job (triggered from the GitLab pipeline) consistently fails for the affected branches.

Once the branch is deleted from the SonarQube portal and the pipeline is re-executed, the job succeeds. However, the situation becomes critical when this issue occurs on main or other default branches, as performing the cleanup leads to loss of historic Sonar analysis data, which is undesirable.

This issue has been occurring quite frequently and is becoming increasingly frustrating to manage manually. We would appreciate your guidance or a potential resolution to prevent these repetitive manual cleanups.

Please let us know if you need any additional details from our side.

Regards

Kshitij Arora

What is the failure?

It’s just a usual failure that disappears when I perform the manual branch cleanup from the Sonar Portal(UI).

I’m sharing here the snippet of the pipeline logs

> Task :Package-name:sonarqube FAILED

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ‘:Package-name:sonarqube’.

> QUALITY GATE STATUS: FAILED - View details on https:///dashboard?id=&branch=

* Try:

> Run with --stacktrace option to get the stack trace.

> Run with --info or --debug option to get more log output.

> Run with --scan to get full insights.

> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.14.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 2m 35s

95 actionable tasks: 95 executed

I’ll also share the error from the Sonar UI, once I encounter it again.

Hello,

Based on these logs, it appears that you have enabled sonar.qualitygate.wait=true. The ‘failure’ message simply means that the Quality Gate for this branch did not pass. This behavior is expected since you’ve chosen to wait for the Quality Gate result as part of your configuration, and fail if the quality of that branch doesn’t meet certain conditions.

It seems to me like what you need to do is either fix the issues failing the Quality Gate (present in your SonarQube dashboard), and/or adjust your Quality Gate conditions.