License error submitting analysis

:sob: :sob: :sob:

This now, I really dont get.

##[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.

Many thanks.

Simon

Hi Simon,

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.

 
HTH,
Ann

Hi Ann,

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

Below is the current task.

      # =============================================================================================
      # SONARQUBE ANALYSIS (PREPARE)
      # ============================================================================================
      # Prepare SonarQube analysis (sets up the scanner and configures analysis properties)
      - task: SonarQubePrepare@7
        displayName: 'Prepare SonarQube Analysis'
        env:
          SONAR_SCANNER_JAVA_OPTS: "-Xmx4096m"
          #SONAR_SCANNER_OPTS: "-Xmx4096m"
        inputs:
          SonarQube: 'SonarQube'
          scannerMode: 'dotnet'
          projectKey: 'cbs-ops_DriverWebsite_70eebacf-094b-4193-8cb9-4faa8dc61fc0'
          projectName: 'DriverWebsite'
          organization: 'Car Benefit Solutions Limited'
          extraProperties: |
            sonar.projectVersion=$(assemblyVersionNumber)
            #sonar.verbose=true
            sonar.branch.name=$(DriverWebsiteRepoRef)
            sonar.typescript.tsconfigPat= $(Build.SourcesDirectory)/$(ExtractRepoNames.CleanDriverWebsiteRepoName)/src/${{ parameters.applicationSourceFolderName }}/tsconfig.json
            sonar.scanner.scanAll=false
            sonar.scanner.excludeHiddenFiles=true 
            #sonar.text.inclusions.activate=false
            #sonar.scm.disabled=true
            sonar.text.activate=false

I have uploaded the logs as ususal.

Many thanks

Simon
logs_274989.zip (436.2 KB)

Hi Simon,

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.

Let’s try this:

          extraProperties: |
            sonar.projectVersion=$(assemblyVersionNumber)
            sonar.verbose=true
            sonar.branch.name=$(DriverWebsiteRepoRef)
            sonar.scanner.scanAll=false
            sonar.text.activate=false
            sonar.javascript.file.suffixes=-
            sonar.typescript.file.suffixes=_

BTW, sonar.typescript.tsconfigPat isn’t a valid property (missing h at the end).

 
Ann

Hi Ann,

No, this is the same issue.

I only referenced the other project in the other thread just in case it gave some insight into the issue and if there were a more overall thing.

My last post is still related to the project that I have been working with you over the last few days.

Simon

And you are right - I am a total wally. I am missing the “h”.

I have amended and am retrying now

Sorry Ann,

Still the same issue..

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.

      # =============================================================================================
      # SONARQUBE ANALYSIS (PREPARE)
      # ============================================================================================
      # Prepare SonarQube analysis (sets up the scanner and configures analysis properties)
      - task: SonarQubePrepare@7
        displayName: 'Prepare SonarQube Analysis'
        env:
          SONAR_SCANNER_JAVA_OPTS: "-Xmx4096m"
          #SONAR_SCANNER_OPTS: "-Xmx4096m"
        inputs:
          SonarQube: 'SonarQube'
          scannerMode: 'dotnet'
          projectKey: 'cbs-ops_DriverWebsite_70eebacf-094b-4193-8cb9-4faa8dc61fc0'
          projectName: 'DriverWebsite'
          organization: 'Car Benefit Solutions Limited'
          extraProperties: |
            #sonar.projectVersion=$(assemblyVersionNumber)
            ##sonar.verbose=true
            #sonar.branch.name=$(DriverWebsiteRepoRef)
            #sonar.typescript.tsconfigPath= $(Build.SourcesDirectory)/$(ExtractRepoNames.CleanDriverWebsiteRepoName)/src/${{ parameters.applicationSourceFolderName }}/tsconfig.json
            #sonar.scanner.scanAll=false
            #sonar.scanner.excludeHiddenFiles=true 
            ##sonar.text.inclusions.activate=false
            ##sonar.scm.disabled=true
            #sonar.text.activate=false
            sonar.projectVersion=$(assemblyVersionNumber)
            sonar.verbose=true
            sonar.branch.name=$(DriverWebsiteRepoRef)
            sonar.scanner.scanAll=false
            sonar.text.activate=false
            sonar.javascript.file.suffixes=-
            sonar.typescript.file.suffixes=_

I have attached the logs as usual.

Many thanks

Simon

logs_274993.zip (1.1 MB)

Hi,

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.

Try this please:

          extraProperties: |
            sonar.projectVersion=$(assemblyVersionNumber)
            sonar.verbose=true
            sonar.branch.name=$(DriverWebsiteRepoRef)
            sonar.scanner.scanAll=false
            sonar.text.activate=false
            sonar.inclusions=**/*.cs

 
Ann

Hi Ann,

That appears to have worked now, thank you.

Based on that file criteria, does that mean we are not doing a full analysis, and we are just analysing the charp files?

Many thanks

Simon

Good Morning Ann,

After much wrangling with YAML files over the weekend, I think I have finally found the set up that works for our ASP.NET MVC website analysis.

Below is the fine SonarQube Preparation task:-

      # =============================================================================================
      # SONARQUBE ANALYSIS (PREPARE)
      # ============================================================================================
      # Prepare SonarQube analysis (sets up the scanner and configures analysis properties)
      - task: SonarQubePrepare@7
        displayName: 'Prepare SonarQube Analysis'
        env:
          SONAR_SCANNER_JAVA_OPTS: "-Xmx4096m"
          #SONAR_SCANNER_OPTS: "-Xmx4096m"
        inputs:
          SonarQube: 'SonarQube'
          scannerMode: 'dotnet'
          projectKey: '$(DriverWebsiteProjectKey)'
          projectName: 'DriverWebsite'
          organization: 'Car Benefit Solutions Limited'
          extraProperties: |
            sonar.projectBaseDir=$(Build.SourcesDirectory)/$(ExtractRepoNames.CleanDriverWebsiteRepoName)/src
            sonar.typescript.tsconfigPath=$(Build.SourcesDirectory)/$(ExtractRepoNames.CleanDriverWebsiteRepoName)/src/${{ parameters.applicationSourceFolderName }}/tsconfig.json
            sonar.projectVersion=$(assemblyVersionNumber)
            sonar.verbose=true
            sonar.branch.name=$(DriverWebsiteRepoRef)
            sonar.scanner.excludeHiddenFiles=true 
            sonar.scanner.scanAll=false
            sonar.exclusions=${{ parameters.applicationSourceFolderName }}/wwwroot/**/*,${{ parameters.applicationSourceFolderName }}/node_modules/**/*

Please would you be able to check it and make sure I am not doing something blatantly stupid, or missed something critical out.

It seems to work perfectly, and I have also attached the full output logs.

Many thanks in advance.

Simon
logs_275012.zip (1.8 MB)

Hi,

Your new configuration looks sane and reasonable to me. :slight_smile:

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. :sweat_smile:

 
Ann

Hi Ann,

Yes, more than happy to keep engaging on this and supporting where ever I can.

Simon

Hi Simon,

Thanks for your willingness to continue engaging!

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?

 
Thx,
Ann

Hi Ann,

I am more than happy to send over the csproj file if I am able to do so privately. You will then be able to see all of our dependencies.

Simon

1 Like