##[error][ERROR] SonarQube Server: Error while executing task Publish: Task failed with status FAILED, Error message: The last analysis failed because it would have caused your server-wide lines of code total to exceed your 2000000 limit.
##[error]Task failed with status FAILED, Error message: The last analysis failed because it would have caused your server-wide lines of code total to exceed your 2000000 limit.
We are analysing one of our smaller projects.
So, is this because the total lines across this and the other project is exceeding this limit.
I am sure when I had my discussions with Elin, there wasnt a hard stop as such, but a review.
I will pick up with Elin anyway, but I would just like clarification as well please.
I guess that’s the error from the other project? This is where you want to use the sonar.scanner.scanAll=false to narrow your analysis to just the .NET files.
So I have now added in the sonar.scanner.scanAll=false line but I am now getting:-
During the analyse stage (although DevOps does show it as completing successfully)
INFO: TypeScript configuration file /home/vsts/work/1/s/DriverWebsite/src/Cbs.Website.MVC/bin/Release/net8.0-windows7.0/tsconfig.json
##[error]ERROR: Error: No inputs were found in config file '/home/vsts/work/1/s/DriverWebsite/src/Cbs.Website.MVC/bin/Release/net8.0-windows7.0/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["node_modules","obj","bin","wwwroot"
##[error],"**/*.d.ts"]'.
ERROR: at int (/home/vsts/work/1/.sonarqube/out/.sonar/.sonartmp/bridge-bundle/package/bin/server.cjs:2104:46564)
During the sonar publish stage (Which is erroring in DevOps)
**Starting: Publish SonarQube Quality Gate Result**
==============================================================================
Task : Publish Quality Gate Result
Description : Publish SonarQube Server's Quality Gate result on the Azure DevOps build result, to be used after the actual analysis.
Version : 7.3.0
Author : sonarsource
Help : [More Information](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarqube-extension-for-azure-devops/)
==============================================================================
[INFO] SonarQube Server: Server version: 2025.3.0.108892
##[error][ERROR] SonarQube Server: Error while executing task Publish: Task failed with status FAILED, Error message: The last analysis failed because it would have caused your server-wide lines of code total to exceed your 2000000 limit.
##[error]Task failed with status FAILED, Error message: The last analysis failed because it would have caused your server-wide lines of code total to exceed your 2000000 limit.
Finishing: Publish SonarQube Quality Gate Result
I’ve moved this to a different thread since it’s a different topic.
And at this point I’m starting to wonder if those extraProperties are being picked up. Because sonar.scanner.scanAll=false should have excluded JavaScript from analysis, but based on your log, it was picked up.
Starting: Publish SonarQube Quality Gate Result
==============================================================================
Task : Publish Quality Gate Result
Description : Publish SonarQube Server's Quality Gate result on the Azure DevOps build result, to be used after the actual analysis.
Version : 7.3.0
Author : sonarsource
Help : [More Information](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarqube-extension-for-azure-devops/)
==============================================================================
[INFO] SonarQube Server: Server version: 2025.3.0.108892
##[error][ERROR] SonarQube Server: Error while executing task Publish: Task failed with status FAILED, Error message: The last analysis failed because it would have caused your server-wide lines of code total to exceed your 2000000 limit.
##[error]Task failed with status FAILED, Error message: The last analysis failed because it would have caused your server-wide lines of code total to exceed your 2000000 limit.
Finishing: Publish SonarQube Quality Gate Result
Here is the script, updated following your last suggestion.
I’ve re-split this, since we really have moved on to a different problem, whether or not it’s the same project.
You’re past the CI-side problem of the Secrets detection breaking analysis, and have now moved on to the server rejecting the completed analysis report.
What I’m seeing in the log is that apparently every single file in the project is indexed by the scanner, including .png, .jpg, .pdf, and quite a large number of .scss files. With scanAll set to false, I don’t understand that behavior.
Your new configuration looks sane and reasonable to me.
And I’ve flagged this thread for more expert eyes to take a look at why we couldn’t get the scanAll behavior to turn off. I hope you’re up for a little more interaction, as needed.
It’s been suggested to me that we couldn’t use sonar.scanner.scanAll=false to turn off analysis of the non-C# files because they were cited/listed in the .NET project. I’m skeptical because of your experience with the @5 version of the task, but could you double check your project files for that?