Issue with sonar.branch.name in Azure DevOps Pipeline using SonarQube Community Edition v25.10.0.114

Hi Team,
I’m currently using SonarQube Community Build v25.10.0.114319, deployed as a pod in Kubernetes. I’m trying to integrate SonarQube scanning into my Azure DevOps pipeline, targeting a repository with the release branch set as default.
When the pipeline is triggered, I encounter the following error during the SonarQube Prepare Analysis task:
##[error]12:59:18.742 ERROR Validation of project failed:
o To use the property “sonar.branch.name” and analyze branches, Developer Edition or above is required. See Analysis parameters | Sonar Documentation for more information.
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘ClassRealm{iac}-org.sonar.iac.helm.HelmEvaluator’: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name ‘AnalysisTempFolder’ defined in org.sonar.scanner.analysis.AnalysisTempFolderProvider: Unsatisfied dependency expressed through method ‘provide’ parameter 0: Error creating bean with name ‘DefaultInputProject’ defined in org.sonar.scanner.scan.InputProjectProvider: Failed to instantiate [org.sonar.api.batch.fs.internal.DefaultInputProject]: Factory method ‘provide’ threw exception with message: Validation of project failed:

I also noticed that:

Sometimes the scan works for one repository.
But from the second repository onward, the same error appears.
I tried explicitly setting sonar.branch.name= in the prepare task, but the error still persists.

Could someone please help clarify:

Is there a workaround for scanning non-default branches in the Community Edition?
Why does the error appear inconsistently across repositories?

Thanks in advance for your support!

Hey there.

Here’s all the code for determining if the analysis is on a default branch or not.

Do you see any messages in your pipeline like: Unable to get default branch, defaulting to 'master'?

we also got that error in sonarqubeprepare@7 task

Unable to get default branch, defaulting to ‘master’

Yes this is the error I am getting in sonar prepare task when using version 7. Is there any solution for this?