[error]ERROR: Could not find the pullrequest with key

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

Hi,

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?

 
Ann

It didn’t even happen on every run of a PR within the same project.

Hi,

Are you still experiencing this, currently? Because this sounds like an intermittent connectivity problem.

 
Ann

I experienced it on Monday and on Tuesday. However, it didn’t happen anymore at the moment.

Hi,

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.

 
Thx,
Ann

Hi,

it just happened again in another project. This morning it worked, now it doesn’t anymore.

Last run which succeeded logged in prepare analysis task the following version.

[INFO]  SonarQube Cloud: Server version: 8.0.0.87945

Since then it’s failing and versions is:

[INFO]  SonarQube Cloud: Server version: 8.0.0.88086

Hi,

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?

 
Thx,
Ann

Yes.

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: 

Hi,

Could I have the full analysis log, starting from the analysis command itself?

 
Thx,
Ann

I sent it to you via private message.

Btw it seems to work again.

This is the version it works again.

[INFO]  SonarQube Cloud: Server version: 8.0.0.88170

@ganncamp it just happened again with the following SonarQube Cloud version…

SonarQube Cloud: Server version: 8.0.0.88170

Hi,

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.

 
Ann