Error during SonarScanner execution when trying to run the analysis from the PR pipeline

Hi,

I’m getting this error on Azure DevOps pipeline for all the project. It works fine when I run the pipeline from the branch itself but gives me an error when it after creating the PR or after the code merge.

INFO: Working dir: /home/vsts/work/1/s/.scannerwork
INFO: Load project branches
INFO: Load project branches (done) | time=632ms
INFO: Check ALM binding of project 'XXXXXXXXXXXX'
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project 'XXXXXXXXXXXX' (done) | time=638ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=693ms
INFO: Load branch configuration
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 33.410s
INFO: Final Memory: 20M/70M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarScanner execution
ERROR: Could not find the pullrequest with key '8021'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=XXXXXXXXXXXXXX&pullrequestKey=8021 : {"errors":[{"msg":"Unable to find the pullrequest with key \u00278021\u0027"}]}
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
ERROR: Error during SonarScanner execution
ERROR: Could not find the pullrequest with key '8021'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=XXXXXXXXXXXX&pullrequestKey=8021 : {"errors":[{"msg":"Unable to find the pullrequest with key \u00278021\u0027"}]}
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.38.0/sonar-scanner/bin/sonar-scanner' failed with exit code 2
Finishing: Sonar Cloud Analysis

Hey there.

Please have an organization administrator check the status of your Azure DevOps PAT configured under organization-level Administration > Organization settings > Azure DevOps connectivity management

1 Like

Hi Colin,

Thanks for the reply. Issuing a new PAT did fix the problem. So it looks like I have a issue a new PAT every year since DevOps only allows to create a PAT with one year of expiry.

Thanks for the help.

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