Intermittent HTTP 500 from api/alm_integration/show_pullrequest on Bitbucket Cloud PR analysis

Hi,

We are seeing the same error as in Something went wrong while trying to get the pullrequest with key '130', but with Bitbucket Cloud.

ALM: Bitbucket Cloud (project is bound, “Detected project binding: BOUND”)

CI system: Bitbucket Pipelines, image sonarsource/sonar-scanner-cli (SonarScanner CLI 8.1.0.6389, engine 13.16.0.6705, Java 21)

Languages: TypeScript (Node.js)

Project visibility: private, so no URL

Scanner command (secrets masked):

sonar-scanner \
  -Dsonar.host.url=https://sonarcloud.io \
  -Dsonar.organization=${SONAR_ORGANIZATION} \
  -Dsonar.projectKey=${SONAR_PROJECT_KEY} \
  -Dsonar.token=${SONAR_TOKEN} \
  -Dsonar.sources=src \
  -Dsonar.pullrequest.key=${BITBUCKET_PR_ID} \
  -Dsonar.pullrequest.branch=${BITBUCKET_BRANCH} \
  -Dsonar.pullrequest.base=${BITBUCKET_PR_DESTINATION_BRANCH} \
  -Dsonar.qualitygate.wait=true \
  -Dsonar.qualitygate.timeout=600 \
  -Dsonar.verbose=true

Error observed:

ERROR Something went wrong while trying to get the pullrequest with key '<PR_KEY>': An unexpected error occurred. Please try again later.

Relevant part of the verbose log (2026-10-26, ~12:52 UTC):

GET /api/alm_integration/show_project?almId=bitbucketcloud&almRepoId=... -> 200
GET /api/alm_integration/is_project_bound?project=<PROJECT_KEY> -> 200
GET /api/alm_integration/show_pullrequest?project=<PROJECT_KEY>&pullrequestKey=<PR_KEY> -> 500 (401ms)
Caused by: org.sonar.scanner.http.service.HttpResponseException: GET https://sonarcloud.io/api/alm_integration/show_pullrequest failed with HTTP 500: An unexpected error occurred. Please try again later.

The same token and binding succeed on the two earlier calls in the same run, only show_pullrequest returns 500. The response has no request ID.

Steps to reproduce:

  1. Open a pull request on Bitbucket Cloud targeting staging
  2. Bitbucket Pipelines runs the scanner command above on the PR
  3. About 5 out of 10 recent runs fail in “Load branch configuration”, before any analysis starts
  4. The same failure also occurs on more than one project in our organization, so it does not look project-specific

Potential workaround: re-running the same pipeline on the same PR usually succeeds. We currently retry manually.

Is this a known issue on the SonarQube Cloud side, and is there anything we can do besides retrying? I can share the organization and project keys privately if needed.

Thanks.

Hello @burakdeniz, welcome to the Community!

This was a known issue in our integration with Bitbucket, and it’s now resolved. On Oct 26th, Bitbucket Cloud was rate-limiting SonarQube Cloud’s calls to its API with HTTP 429. When that happened during the pull request lookup (api/alm_integration/show_pullrequest), we returned HTTP 500 instead. Atlassian reverted the change that caused it, and we’ve seen no 429s since about 19:30 UTC on 2026-10-26. Sorry for the trouble!