Intermittent "Error 500" in api/alm_integration calls using SonarCloud

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps): Github
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI): Github Actions
  • Scanner command used when applicable (private details masked):
* ./.sonar/scanner/dotnet-sonarscanner begin /project /o:company /d:sonar.token="***" /d:sonar.host.url=*** /d:sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml /d:sonar.cs.vstest.reportsPaths=*.trx /d:sonar.qualitygate.wait=true
  • Languages of the repository: C#(.net)
  • 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)
ERROR: Something went wrong while trying to get the pullrequest with key '116'
ERROR: Caused by: Error 500 on ***api/alm_integration/show_pullrequest?project=project*&pullrequestKey=116 : {"errors":[{"msg":"An unexpected error occurred. Please try again later."}]}
  • Steps to reproduce
    It’s an intermittent error. Sometimes it returns right data and sometimes returns status code 500. Are there any performance problem with this SonarCloud Api?
    Status 200 OK:
{
    "branchName": "feat/retry",
    "baseBranchName": "main"
}

Status 500 (using exactly same call above):

{
    "errors": [
        {
            "msg": "An unexpected error occurred. Please try again later."
        }
    ]
}
  • Potential workaround

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
It’s an intermittent error. The PullRequest and project exists, when we search by SonarCloud UI. Sometimes it returns right data and sometimes returns status code 500. Are there any performance problem with this SonarCloud Api?
It’s began nearly 4 days ago.

Hey @Bruno_Tanoue

There’s no sign in the logs that there’s a widespread issue here.

Digging into the logs, I do see a 403 being returned by GitHub while calling https://api.github.com/app/installations/<Install_ID>/access_tokens (GET api/alm_integration/show_pullrequest sends a request to GitHub).

I can’t find any difference between the “good” requests that return data, and the bad ones returning a 500 (because of the 403).

I’ve passed my investigation onto the responsible team. Maybe they have a better idea!

Hey Colin! How are you?
If you want, I can record my calls on Postman and send you, because I can reproduce the Github error locally.
Is there any place that I can send you a video or something else?
Thank you for the quick response.

Hello!
Any news?
We are receiving an intermittent error yet.
It’s breaking our pipeline many times and we need to rebuild.
Can we send X-Amz-Cf-Id for your analysis and debug?

X-Amz-Cf-Id: sMxLmaMOUQIMJS8ELRB3zbomM0RrGjLq3y6DaPMSlFyf0GmPLEz0Qg==

Att,