404 errors when performing code analysis

  • ALM used: Azure DevOps
  • CI system used: Azure DevOps
  • Scanner command used when applicable: SonarCloudAnalyze@2 task
  • Languages of the repository: python, C#
  • Only if the SonarCloud project is public, the URL
    • And if you need help with pull request decoration, then the URL to the PR too
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
  • Steps to reproduce
  • Potential workaround
    When performing sonar analysis for our private sonar instance, sometimes we get the following error: Could not find the pullrequest with key .....
    The explanation for the error is as follows: Caused by: Error 404 on [https://sonarcloud.io/api/alm_integration/show_pullrequest?project=](https://sonarcloud.io/api/alm_integration/show_pullrequest?project=-----)

It looks like the PR cannot be found in Sonar. The behavior seems to be intermittent. Sometimes it works, sometimes it fails.

Any help would be great.

Hey there.

Can you check to see if you have a valid token set in the organization-level Administration > Organization settings > Azure DevOps connectivity management?

Hi Colin, thanks for your response. Could it be that token? If the behavior seems to be intermittent, the token should work, no?
In any case, I’ll ask the admin to check it.

The token ultimately gets used only for PR analyses, not for branch analyses, so that could explain why some fail, and some don’t. I definitely recommend having your admin check out the token.