We are currently getting the following error in the Azure DevOps YAML pipeline logs of step SonarCloudAnalyze@3. However, not in every run of the pipeline which is super strange.
[error]ERROR: Could not find the pullrequest with key
The PAT for PR decoration is specified on organization level, got refreshed last week and is still valid.
Any idea why this happens? May a caching issue on SonarQube Cloud side?
Detailed information
Azure DevOps Services
SonarCloudAnalyze@3 task
.NET
...
INFO: Load branch configuration
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 6.837s
INFO: Final Memory: 14M/50M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarScanner execution
ERROR: Error during SonarScanner execution
##[error]ERROR: Could not find the pullrequest with key '123'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=PROJECT_HERE&pullrequestKey=123 : {"errors":[{"msg":"You don\u0027t have permission, or the provided pullrequest with key \u002737687\u0027 doesn\u0027t exist."}]}
ERROR:
ERROR: Could not find the pullrequest with key '123'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=PROJECT_HERE&pullrequestKey=123 : {"errors":[{"msg":"You don\u0027t have permission, or the provided pullrequest with key \u002737687\u0027 doesn\u0027t exist."}]}
ERROR:
##[error]The SonarScanner did not complete successfully
The SonarScanner did not complete successfully
##[error]11:39:20.241 Post-processing failed. Exit code: 1
11:39:20.241 Post-processing failed. Exit code: 1
You say this doesn’t happen on every PR. Is the behavior consistent within a given product or do some PRs for a given project work and others don’t?
Looking back (I was off) I don’t see any problems declared internally Monday or Tuesday. If this happens again, come back as soon as you can and we’ll look from our end.
You’re getting exactly that same error? We had an incident last night & earlier this morning where a 401 was returned with the use of an org-level SOT. Were/are you getting a 404 or a 401?
ERROR: Error during SonarScanner execution
##[error]ERROR: Could not find the pullrequest with key '123'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=PROJECT&pullrequestKey=123 : {"errors":[{"msg":"You don\u0027t have permission, or the provided pullrequest with key \u0027123\u0027 doesn\u0027t exist."}]}
ERROR:
ERROR: Could not find the pullrequest with key '123'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=PROJECT&pullrequestKey=123 : {"errors":[{"msg":"You don\u0027t have permission, or the provided pullrequest with key \u0027123\u0027 doesn\u0027t exist."}]}
ERROR:
Sorry for the delay in responding. The fact that this is intermittent, suggests a problem on our side rather than on yours. I’ve flagged this for the team.