- ALM used - Azure DevOps
- CI system used - Azure DevOps
- Languages of the repository - TypeScript
I am trying to integrate a SonarCloud analysis into my CI pipeline.
When kicking the pipeline in manual mode for a short-living branch, everything is working just fine, I am seeing the short-living branch being analyzed properly and all the statistics is being shown in sonarcloud dashboard.
But when I create a PR and the same exact pipeline is starting to run, I am getting the following errors during the Code Analysis step of the PR:
==============================================================================
Task : Run Code Analysis
Description : Run scanner and upload the results to the SonarCloud server.
Version : 1.23.0
Author : sonarsource
Help : Version: 1.23.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.
[More Information](https://sonarcloud.io/documentation/analysis/scan/sonarscanner-for-azure-devops/)
==============================================================================
/home/vsts/work/_tasks/SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1/1.23.0/sonar-scanner/bin/sonar-scanner
INFO: Scanner configuration file: /home/vsts/work/_tasks/SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1/1.23.0/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.6.1.2450
INFO: Java 11.0.11 AdoptOpenJDK (64-bit)
INFO: Linux 5.8.0-1039-azure amd64
INFO: User cache: /home/vsts/.sonar/cache
INFO: Scanner configuration file: /home/vsts/work/_tasks/SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1/1.23.0/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarCloud
INFO: Default locale: "en", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=671ms
INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
INFO: User cache: /home/vsts/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=155ms
INFO: Load/download plugins (done) | time=26493ms
INFO: Loaded core extensions: developer-scanner
INFO: Found an active CI vendor: 'Azure DevOps'
INFO: Load project settings for component key: 'XXXXXXXXX'
INFO: Load project settings for component key: 'XXXXXXXXX' (done) | time=138ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=1ms
INFO: Project key: XXXXXXXXXX
INFO: Base dir: /home/vsts/work/1/s
INFO: Working dir: /home/vsts/work/1/s/.scannerwork
INFO: Load project branches
INFO: Load project branches (done) | time=129ms
INFO: Check ALM binding of project 'XXXXXXXX'
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project 'XXXXXXXXXX' (done) | time=121ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=122ms
INFO: Load branch configuration
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 32.797s
INFO: Final Memory: 7M/24M
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
Finishing: Run SonarCloud Code Analysis
Any help would be appreciated since I have no idea how to continue - the Azure DevOps Run Code Analysis
task does not accept any parameters and the same exact pipeline while being kicked manually, works just fine
Thanks