Sonar alaysis on Azure devops PR fails with error Could not find the pullrequest with key '48979'

  • ALM used (Azure DevOps)

  • CI system used (Azure DevOps)

  • This issue started happening from yesterday evening. There has not been any issues before that and no pipeline or configuration changes were made before this. We have this pipeline running when a PR is raised. And manual run of that branch in same pipeline succeeds in Sonarcloud. The analysis runs on Ubuntu self hosted agents on Azure. Any help is appreciated.

  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)

08:18:42.461 INFO Load project pull requests

08:18:42.582 INFO Load project pull requests (done) | time=122ms

08:18:42.584 INFO Load branch configuration

##[error]08:18:42.690 ERROR Could not find the pullrequest with key '48979'

08:18:42.690 ERROR Could not find the pullrequest with key '48979'

08:18:43.017 INFO EXECUTION FAILURE

08:18:43.018 INFO Total time: 11.417s

##[warning]Can't find loc string for key: LIB_ProcessExitCode

##[warning]Error while executing SonarCloud:Analyze task: LIB_ProcessExitCode /agent/_work/_tasks/SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1/2.3.2/sonar-scanner/bin/sonar-scanner 3

##[error]LIB_ProcessExitCode /agent/_work/_tasks/SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1/2.3.2/sonar-scanner/bin/sonar-scanner 3

Hey there.

Have you configured a valid token at either the project-level Administration > General Settings > Pull Requests) or at the organiztion-level (Administration > Organization settings > Azure DevOps connectivity management)?

Colin

Thank you for responding Colin. I noticed that there was no token added before (but it was all working fine until yesterday) and I created a new personal token from Azure devops with full access and added that to project-level Administration > General Settings > Pull Requests. But even after that I am getting this same error as before.

It seems similar to what a lot of users reported last year SonarCloud Pull Request Run not working - #25 by aura

Colin, I removed the token from sonar project and added it to sonar organisation and it seems to be working now. I am validating with more PRs and shall update here if there is an issue.