SonarCloud code scan stopped working all of a sudden

  • 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)
    We used the template workflow which SonarCloud provided through the Analysis Method settings.

  • Languages of the repository
    C++

Hi there,

We are on a paid plan with SonarQube Cloud and had a private repository (mainly C++) scanned for the past few months with the Automatic Analysis. But it stopped working as of Jan 6th all of a sudden. – We did not change anything in GitHub or SonarQube Cloud though.

After checking that everything is fine, I tried to switch to CI triggered Analysis Method upon PR open/sync but still no luck. It was able to trigger the scan but it failed at the step when trying to “configure” the PR. I did check that the SONAR_TOKEN is correctly set and retrieved in GitHub, the PR is open and the PR number correct, the project key and names matches the one in SonarQube Cloud.

I even have the GitHub Actions permissions set for id-token to be able to read contents and write to checks just in case. We also have the SonarCloud GitHub App installed for the repo with the correct Read permissions.

As the log shown below, error towards the end of the log saying:

23:13:31.506 ERROR Something went wrong while trying to get the pullrequest with key '247' 

Begin of the log

+ mkdir -p /__w/_temp/sonarscanner
+ cd /__w/_temp/sonarscanner
+ SCANNER_FILE_NAME=sonar-scanner-cli-6.2.1.4610-linux-aarch64.zip
+ SCANNER_URI=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610-linux-aarch64.zip
+ command -v wget
+ wget --no-verbose --user-agent=sonarqube-scan-action https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610-linux-aarch64.zip
2025-01-21 23:13:23 URL:https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610-linux-aarch64.zip [57311313/57311313] -> "sonar-scanner-cli-6.2.1.4610-linux-aarch64.zip" [1]
+ unzip -q -o sonar-scanner-cli-6.2.1.4610-linux-aarch64.zip
+ SCANNER_UNZIP_FOLDER=sonar-scanner-6.2.1.4610-linux-aarch64
+ SCANNER_LOCAL_FOLDER=/__w/_temp/sonar-scanner-cli-6.2.1.4610-Linux-ARM64
+ '[' -d /__w/_temp/sonar-scanner-cli-6.2.1.4610-Linux-ARM64 ']'
+ mv -f sonar-scanner-6.2.1.4610-linux-aarch64 /__w/_temp/sonar-scanner-cli-6.2.1.4610-Linux-ARM64
Run echo "${RUNNER_TEMP}/sonar-scanner-cli-6.2.1.4610-Linux-ARM64/bin" >> $GITHUB_PATH
Run ${GITHUB_ACTION_PATH}/scripts/run-sonar-scanner-cli.sh --define sonar.cfamily.compile-commands="build_wrapper_output_directory/compile_commands.json"
  ${GITHUB_ACTION_PATH}/scripts/run-sonar-scanner-cli.sh --define sonar.cfamily.compile-commands="build_wrapper_output_directory/compile_commands.json"
  shell: bash --noprofile --norc -e -o pipefail {0}
  env:
	BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory VCPKG_ROOT: 
	/home/dev/external/vcpkg ZIC: true VCPKG_FORCE_SYSTEM_BINARIES: 1 
	SONAR_HOST_URL: https://sonarcloud.io SONAR_TOKEN: *** 
	INPUT_PROJECTBASEDIR: SONAR_SCANNER_JRE: 
	/runner/_work/_temp/sonar-scanner-cli-6.2.1.4610-Linux-ARM64/jre
+ sonar-scanner --define sonar.cfamily.compile-commands=build_wrapper_output_directory/compile_commands.json
23:13:24.580 INFO  Scanner configuration file: /__w/_temp/sonar-scanner-cli-6.2.1.4610-Linux-ARM64/conf/sonar-scanner.properties
23:13:24.584 INFO  Project root configuration file: /__w/*****/*****/sonar-project.properties
23:13:24.597 INFO  SonarScanner CLI 6.2.1.4610
23:13:24.598 INFO  Java 17.0.12 Eclipse Adoptium (64-bit)
23:13:24.599 INFO  Linux 6.8.0-1021-aws aarch64
23:13:24.624 INFO  User cache: /root/.sonar/cache
23:13:25.023 INFO  JRE provisioning: os[linux], arch[aarch64]
23:13:27.620 INFO  Communicating with SonarCloud
23:13:27.866 INFO  Starting SonarScanner Engine...
23:13:27.867 INFO  Java 17.0.11 Eclipse Adoptium (64-bit)
23:13:28.486 INFO  Load global settings
23:13:29.011 INFO  Load global settings (done) | time=526ms
23:13:29.015 INFO  Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
23:13:29.130 INFO  Loading required plugins
23:13:29.131 INFO  Load plugins index
23:13:29.271 INFO  Load plugins index (done) | time=141ms
23:13:29.272 INFO  Load/download plugins
23:13:29.821 INFO  Load/download plugins (done) | time=550ms
23:13:30.199 INFO  Found an active CI vendor: 'Github Actions'
23:13:30.207 INFO  Load project settings for component key: '*****'
23:13:30.352 INFO  Load project settings for component key: '*****' (done) | time=145ms
23:13:30.361 INFO  Process project properties
23:13:30.363 INFO  Project key: ******
23:13:30.364 INFO  Base dir: /__w/*****/*****/
23:13:30.365 INFO  Working dir: /__w/*****/*****/.scannerwork
23:13:30.367 INFO  Load project branches
23:13:30.562 INFO  Load project branches (done) | time=194ms
23:13:30.564 INFO  Check ALM binding of project '*****'
23:13:30.701 INFO  Detected project binding: BOUND
23:13:30.701 INFO  Check ALM binding of project '*****' (done) | time=137ms
23:13:30.702 INFO  Load project pull requests
23:13:31.152 INFO  Load project pull requests (done) | time=450ms
23:13:31.154 INFO  Load branch configuration
23:13:31.155 INFO  Github event: pull_request
23:13:31.161 INFO  Auto-configuring pull request 247
23:13:31.506 ERROR Something went wrong while trying to get the pullrequest with key '247' 
23:13:31.835 INFO  EXECUTION FAILURE
23:13:31.836 INFO  Total time: 7.259s

End of the log

I have been pulling my hairs to get this working again for the past few hours. Really appreciate if you have input on this!

Thanks!

Hey @Jeffrey_Bian!

My first instinct is that there’s something amiss with the GitHub Application that connects SonarQube Cloud to your GitHub organization. There are two things that I think could be happening:

  1. The SonarQube Cloud GitHub Application has somehow become uninstalled from your GitHub org. You can check this by going to your org-level Administration > Organization settings > Organization Binding
  2. GitHub is properly bound to your SonarQube Cloud Organization, but lacks permissions on this repo (if you have not granted permissions to all repositories).

Can you check on these points?

Hi Colin,

Thank you so much for the quick response. I checked GitHub, and it shows the permission is good. You are right about the Organization Binding. I re-bound the Repo with GitHub and now everything works.

1 Like