- ALM used: Azure DevOps
- CI system used: Azure DevOps
- Scanner command used (if applicable): Standard SonarCloud tasks in Azure DevOps pipeline (SonarCloudPrepare@3, SonarCloudAnalyze@3, SonarCloudPublish@3)
- Languages of the repository: C# + others the issue is now on multiples repos
- SonarCloud project URL (if public): SonarQube Cloud
- Error observed:
##[error][ERROR] SonarQube Cloud: Error while executing task Publish: Task failed with status FAILED, Error message: This analysis will make your organization 'quartzx' to reach the maximum allowed lines limit (having 1747809 lines).
Description:
Since a few days ago, we’ve been experiencing recurring issues with the SonarCloud scanner in our Azure DevOps pipelines. Initially, the problem occurred only on larger projects when scanning branches other than main. However, it has become more frequent, affecting multiple projects and branches. The SonarCloudAnalyze task now often takes over 10 minutes (previously ~2 minutes), and the SonarCloudPublish task fails with the error above.
Our organization, ‘quartzx’, is on a plan with a 1M lines of code limit. According to the SonarCloud dashboard, our total analyzed lines across all projects are approximately 870k. The reported 1.74M lines in the error message seems incorrect, as it’s impossible for our account to have added ~1M lines suddenly.
Steps to Reproduce:
- Run an Azure DevOps pipeline with SonarCloud tasks (SonarCloudPrepare@3, SonarCloudAnalyze@3, SonarCloudPublish@3).
- The pipeline processes a branch (often non-main, but now also main in some cases).
- The SonarCloudAnalyze task runs for over 10 minutes.
- The SonarCloudPublish task fails with the error: “This analysis will make your organization ‘quartzx’ to reach the maximum allowed lines limit (having 1747809 lines).”
Additional Details:
- The issue started occurring around early April 2025.
- The issue is generally mitigated by deleting the build agent and forcing a new agent to run the analysis
- Our azure devops agent are running on ubuntu 20.04
- We’re using the latest SonarCloud Azure DevOps extension (v3 tasks).
- The pipelines are configured with standard SonarCloud tasks as per the official documentation.
- We’ve verified that our total lines of code in SonarCloud remain around 870k, far below the 1M limit.
- No significant changes were made to our pipeline configuration or codebase size before the issue began.
Questions:
- Could this be related to a bug in the SonarCloud scanner or Azure DevOps extension when calculating lines of code?
- Are there known issues with branch analysis causing inflated line counts?
- What steps can we take to diagnose or resolve this issue?
Any assistance or guidance would be greatly appreciated, as this is blocking our CI/CD pipelines. Thank you!