Azure DevOps Pipeline error

We are experiencing something similar from the beginning of December 2023. The runner image (Ubuntu 22.04) and the pipelines have not changed, but suddenly SonarQubePrepare@5 started failing with the following error:

2024-01-04T07:43:24.4330037Z ##[section]Starting: Prepare SonarQube analysis
2024-01-04T07:43:24.4332948Z ==============================================================================
2024-01-04T07:43:24.4333035Z Task         : Prepare Analysis Configuration
2024-01-04T07:43:24.4333087Z Description  : Prepare SonarQube analysis configuration
2024-01-04T07:43:24.4333143Z Version      : 5.18.4
2024-01-04T07:43:24.4333179Z Author       : sonarsource
2024-01-04T07:43:24.4333232Z Help         : Version: 5.18.4. [More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
2024-01-04T07:43:24.4333323Z ==============================================================================
2024-01-04T07:43:24.8150812Z ##[error]Cannot read property 'format' of null
2024-01-04T07:43:24.8169394Z ##[section]Finishing: Prepare SonarQube analysis

Hey there.

Can you share how you’ve configured your Azure DevOps Pipeline? Feel free to share the YAML here.

Hi Colin.

Here is how we use the SonarQubePrepare@5 task:

  - task: SonarQubePrepare@5
    displayName: Prepare SonarQube analysis    
    condition: eq('${{ parameters.runSonarQubeAnalysis }}', true)
    inputs:
      SonarQube: 'ProjectNameHere-SonarQube'
      scannerMode: 'MSBuild'
      projectKey: ${{ parameters.sonarQubeProjectKey }}
      extraProperties: |
        sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/TestResults/**/coverage.opencover.xml
        sonar.cs.vstest.reportsPaths=$(Build.SourcesDirectory)/TestResults/**/*.trx
        sonar.log.level=DEBUG
        sonar.verbose=true

Thanks.

This is the line of code the issue is ultimately coming from:

If we want to get DEBUG info out of the task, try setting this in your pipeline variables (not your extraProperties block of the prepare analysis step):

system.debug = true

Thanks for the hint, Colin!

For anyone facing this: after checking the code deeper, we found out, that the issue was on SQ server side.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.