Using Azure devops (see pipelines) we have SonarCloud performing the analysis, we are using the following Azure pipelines tasks:
- ${{ if eq(parameters.runSonarqubeAnalysis, true) }}:
- task: SonarCloudPrepare@1
displayName: 'Prepare SonarCloud Analysis'
inputs:
SonarCloud: ${{ parameters.sonarCloudEndpoint }}
organization: ${{ parameters.sonarCloudOrg }}
scannerMode: ${{ parameters.sonarCloudScannerMode }}
configMode: ${{ parameters.sonarCloudConfigMode }}
- ${{ if eq(parameters.runSonarqubeAnalysis, true) }}:
- task: SonarCloudAnalyze@1
displayName: 'SonarCloud Analysis'
- ${{ if eq(parameters.runSonarqubeAnalysis, true) }}:
- task: SonarCloudPublish@1
displayName: 'SonarCloud Quality Gate'
inputs:
pollingTimeoutSec: ${{ parameters.sonarCloudQGTimeout }}
We are observing that it works on feature branch analysis but fails on PR analysis. Worked on both PR’s and feature branches before today and has done for months.
Error observed in a PR analysis:
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 23.398s
INFO: Final Memory: 7M/27M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarScanner execution
ERROR: Not authorized. Please check the properties sonar.login and sonar.password.
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
ERROR: Error during SonarScanner execution
ERROR: Not authorized. Please check the properties sonar.login and sonar.password.
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
##[error]The process '/home/vsts/work/_tasks/SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1/1.23.0/sonar-scanner/bin/sonar-scanner' failed with exit code 2
We use gated commits so having this broke at a PR level is preventing any code merges from occurring.
Thanks,
Neil