Have build --force comand in Run build task but still sonarqube is giving error

Must-share information (formatted with Markdown):

I am just integrating Sonarqube in build pipeline (some UI project build pipeline created by some one else),I have created the Tasks as per the screenshot(disabled the tasks as was getting error)

There is already a Task, Run build commandline as shown in the image which has build–force ,but running the pipeline I am getting error Sonarqube was unable to collect the required info about your project.


The sonarqube is not able to get info about the project ,since there is already biuld --force i don’t know what else to try ,I am already configured sonarqube task for MSBUILD ,and if i disable the task related to sonarqube(first one and the last two) there are no errors.
Any help will be appreciated

Hi and welcome to the community!

Is this a .NET solution or a JavaScript project? The reason I ask this is because the build command you are showing seems to be calling Grunt (JS tool) but the Scanner you seem to be using is the SonarScanner for MSBuild. For a JavaScript project, you will want the SonarScanner CLI configured in your “Prepare Analysis” task. To ensure this, when configuring the pipeline task you should choose “Use standalone scanner”.

I realise the official documentation has a mistake on this (it says you should select “Integrate with MSBuild” for a JS project) and we will make sure to correct it.

Thanks, regards,

Thanks a lot Daniel,will try this option.

Hi Daniel ,Followed the steps but I am getting a different error, sonar project key missing


This is because you must define the Project Key for your project. There are two ways to do this:

  • You create a sonar-project.properties file in the root folder of your project and declare the parameter sonar.projectKey=<your_unique_project_key>. In your Azure “Prepare Analysis” task, you will need to select “Store configuration with my source code (sonar-project.properties)” when configuring it. In your .YML file, this looks like:

      -task: SonarQubePrepare@4
          scannerMode: 'CLI'
          configMode: 'file'
  • You pass the project key on your .yml pipeline file manually. In your Azure “Prepare Analysis” task, you will need to select “Manually provide configuration”. In the .YML file, this looks like:

      -task: SonarQubePrepare@4
          scannerMode: 'CLI'
          configMode: 'manual'
          cliProjectKey: 'yourKeyHere'
          cliSources: '.'

This is the task configuration panel as shown in Azure:

Please make sure to read the official docs on this link, as this is explained there.


Some respite as Sonarqube was able to start the scan process,but i am getting NEW ERROR

ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.


Please make sure to share the full logs in text format (you can zip them and upload them here) and not a screenshot of the logs, so that myself or anyone else can help you.

I will be glad to have a look at it when you share the full logs.


1 Like

errorlog.zip (1.1 MB)

uploaded the error log, Thanks!! Daniel for your help and suggestion.

i think it is related to out of memory exception


Indeed, your analysis fails due to not enough memory available in the system. How large (lines of code) is the project you are trying to scan? This will help answering the question of what should be the required memory for the scanner.

2021-01-19T14:49:22.3574202Z INFO: ------------------------------------------------------------------------
2021-01-19T14:49:22.3575087Z INFO: EXECUTION FAILURE
2021-01-19T14:49:22.3577267Z INFO: ------------------------------------------------------------------------
2021-01-19T14:49:22.3577729Z INFO: Total time: 15:29.719s
2021-01-19T14:49:22.8534301Z INFO: Final Memory: 13M/54M
2021-01-19T14:49:22.8535331Z INFO: ------------------------------------------------------------------------

Can you try adding this environment variable : SONAR_SCANNER_OPTS with this kind of value :
-Xmx512M (or higher)

in order to increase your heap space, which appears to be 54MB. Look at this thread in the community.