SonarScanner for Azure DevOps fails with error ##[error]Cannot read property 'concat' of undefined

  • versions used: 1.8.0 (SonarCloudPrepare@1)
  • error observed
Task         : Prepare Analysis Configuration
Description  : Prepare SonarCloud analysis configuration
Version      : 1.8.0
Author       : sonarsource
Help         : [More Information](
##[error]Cannot read property 'concat' of undefined
##[section]Finishing: Prepare analysis on SonarCloud

Since yesterday, we have seen this error on multiple pipelines. The configuration was working previously, and no change has been made to project keys or any other Sonar related setup files. Has the task been changed to require different inputs recently?

Can provide further information if required, thanks.

Edit: Just saw the same issue reported here Error in SonarCloudPrepare in Azure DevOps when no SONAR_SCANNER_OPTS set in version 1.8.0 and ScannerMode is CLI

Also experiencing this.

We fixed this problem by setting the SONAR_SCANNER_OPTS to empty in our azure pipeline as seen here:

We notice the same problem with Prepare Analysis Configuration. It happened when VSTS update task definition version from 4.6.3 to 4.7.0

Task : Prepare Analysis Configuration
Description : Prepare SonarQube analysis configuration
Version : 4.7.0
Author : sonarsource
Help : More Information

In my yaml build I added an empty variable named “SONARY_SCANNER_OPTS” and that appears to have fixed things


Can also confirm this error, we’ve first noticed it yesterday.

We get the very same error.

Adding the variable “SONAR_SCANNER_OPTS” solved it for now.


Version 1.8.1 of the SonarCloud extension for Azure DevOps has been published, which should solve this problem.

Sorry for the inconvenience.



Same here, unfortunately. Setting SONAR_SCANNER_OPTS to empty string solved the problem as @lorang92 suggested.