How can I resolve "The pullrequest could not be found"?

Template for a good new topic, formatted with Markdown:

  • ALM used: Github

  • CI system used: Github Action Selfhosted runner

  • Scanner command used when applicable (private details masked)

SONAR_HOST_URL=https://sonarcloud.io
SONAR_TOKEN="${SONAR_TOKEN}"
GITHUB_TOKEN="${GITHUB_TOKEN}"
sonar-scanner -Dsonar.pullrequest.branch="develop" -Dsonar.pullrequest.key=xxxxxxx
awk 'BEGIN { FS = "/" } ; { print $3 }') -Dsonar.pullrequest.base="develop"
  • Languages of the repository: Javascript

  • Error observed

INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /usr/src/sonar-project.properties
INFO: SonarScanner 4.7.0.2747
INFO: Java 11.0.15 Alpine (64-bit)
INFO: Linux 5.10.133+ amd64
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /usr/src/sonar-project.properties
INFO: Analyzing on SonarQube server 8.0.0.34579
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=1388ms
INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=1335ms
INFO: Load/download plugins (done) | time=26169ms
INFO: Loaded core extensions: developer-scanner
INFO: Load project settings for component key: 'xxxxxxxxx'
INFO: Load project settings for component key: 'xxxxxxxxx' (done) | time=1245ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=8ms
INFO: Project key: xxxxxxxxx
INFO: Base dir: /usr/src
INFO: Working dir: /usr/src/.scannerwork
INFO: Load project branches
INFO: Load project branches (done) | time=1268ms
INFO: Check ALM binding of project 'xxxxxxxxx'
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project 'xxxxxxxxx' (done) | time=1249ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=1399ms
INFO: Load branch configuration
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 51.656s
ERROR: Error during SonarScanner execution
ERROR: Could not find the pullrequest with key '1516'
ERROR: Caused by: Error 404 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=xxxxxxxxxxxxxxxxxx&pullrequestKey=1516 : {"errors":[{"msg":"The pullrequest could not be found"}]}
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
INFO: Final Memory: 19M/80M
INFO: ------------------------------------------------------------------------
  • Steps to reproduce
    It happens every time after October 30th.

Hi,

Welcome to the community!

You’re getting a 404 error which is how permissions errors manifest.

Since the problem started on a specific date, it makes me suspect that a permission token expired on that day. Can you double-check that the PAT you provided to SonarCloud is still valid?

 
Ann