Long-lived branches have no other branches except the main branch

Hi all,
I have two branch, first is stage-uat and second is master, stage-uat is main branch, then i want add master into Long-lived branches, but i can’t find master in Long-lived branches.
Long-lived branches pattern:(master|uat-stage)

Our flow:

  1. develop-branch merge PR into stage-uat, this time GitHub will trigger SonarCloud, i look report in SonarCloud Push Requests.
  2. stage-uat merge PR into master, this time GitHub will trigger SonarCloud i look report in SonarCloud Push Requests.


Hey there.

Are you using Automatic Analysis? In this case:

  • Branch analysis (analysis of non-pull request branches other than the main branch) is not supported.

If you need analysis of these other branches, you might want to switch to CI-based analysis.

i switch to CI-based analysis.
but there has some mistake.

there is circleci step report

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 44.9M  100 44.9M    0     0   237M      0 --:--:-- --:--:-- --:--:--  237M
INFO: Scanner configuration file: /tmp/cache/scanner/sonar-scanner-
INFO: Project root configuration file: /tmp/workspace/project/sonar-project.properties
INFO: SonarScanner
INFO: Java 17.0.7 Eclipse Adoptium (64-bit)
INFO: Linux 5.15.0-1050-aws amd64
INFO: User cache: /tmp/cache/scanner/.sonar/cache
INFO: Analyzing on SonarCloud
INFO: Default locale: "en_US", source code encoding: "US-ASCII" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=276ms
INFO: Server id: =============filter===============
INFO: User cache: /tmp/cache/scanner/.sonar/cache
INFO: Loading required plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=258ms
INFO: Load/download plugins
INFO: Load/download plugins (done) | time=824ms
INFO: Found an active CI vendor: 'CircleCI'
INFO: Load project settings for component key: 'FILTER_BUT_THERE_IS_SAME_STRING'
INFO: Process project properties
INFO: Base dir: /tmp/workspace/project
INFO: Working dir: /tmp/workspace/project/.scannerwork
INFO: Load project branches
INFO: Load project branches (done) | time=207ms
INFO: Check ALM binding of project 'FILTER_BUT_THERE_IS_SAME_STRING'
WARN: Failed to check if project 'FILTER_BUT_THERE_IS_SAME_STRING' is bound
INFO: Detected project binding: ERROR
INFO: Check ALM binding of project 'FILTER_BUT_THERE_IS_SAME_STRING' (done) | time=209ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=204ms
INFO: Load branch configuration
INFO: Auto-configuring branch 20240117-change-sonarcloud-from-auto-to-manual
INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
INFO: Total time: 5.721s
INFO: Final Memory: 9M/37M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: Could not find a default branch for project with key 'FILTER_BUT_THERE_IS_SAME_STRING'. Make sure project exists.
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Exited with code exit status 2



i have no idea how to fix this mistake.

I think the first issue to work out here is this.

Can you turn on DEBUG level logging? sonar-scanner -X – it should show the exact API being queried, and what query parameters are used. You’ll also be able to make this call in the browser, which should help debug what values are wrong.