Error when using sonar-scanner with new SonarQube server

Must-share information

  • which versions are you using: Community Editionv9.9.7 (build 96285), plugins(Community Branch Plugin 1.22.0, Crowd 2.2.0, YAML Analyzer 1.9.1, creedengo - Java language 2.1.0)
  • how is SonarQube deployed: Docker(nginx,SonarQube,PostgreSQL)
  • what are you trying to achieve: I want to fix an error if I use a sonar scanner
  • what have you tried so far to achieve this: I checked logs, and tried to use sonar-scanner-6.2.1.4610 and sonar-scanner-4.2.0.1873 with different options

Hello
I will try to describe the problem briefly
I installed a new SonarQube server but faced a problem. unfortunately, I can’t find the solution

  • Sonarqube server:
    I can see the web interface and use it without any problems - it works fine
    I don’t see any errors in the logs

  • Soner scanner:
    If I try to run some task, I get an error

  • Result after run(Soner scaner side):

		ERROR Error during SonarScanner CLI execution
		org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.sonarsource.scanner.lib.internal.IsolatedClassloader@26ceffa8-org.sonar.scanner.scan.ModuleIndexer': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creatia sonar scannername 'org.sonarsource.scanner.lib.internal.IsolI atedClassloader@26ceffa8-org.sonar.scanner.scan.filesystem.InputComponentStore': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'BranchConfiguration' defined in org.sonar.scanner.scan.branch.BranchConfigurationProvider: Unsatisfied dependency expressed through method 'provide' parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ProjectBranches' defined in org.sonar.scanner.scan.branch.ProjectBranchesProvider: Unsatisfied dependency expressed through method 'provide' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'java.net.FactoryURLClassLoader@5a237731-com.github.mc1arke.sonarqube.plugin.scanner.CommunityProjectBranchesLoader': Resolution of declared constructors on bean Class [com.github.mc1arke.sonarqube.plugin.scanner.CommunityProjectBranchesLoader] from ClassLoader [java.net.FactoryURLClassLoader@5a237731] failed; nested exception is java.lang.NoClassDefFoundError: org/sonar/scanner/http/ScannerWsClient
...

aceess.los(SonarQube side)

10.252.37.1 - - [29/Jan/2025:07:55:47 +0000] "GET /api/v2/analysis/version HTTP/1.0" 404 - "-" "ScannerCLI/6.2.1.4610" "AZSt>
		10.252.37.1 - - [29/Jan/2025:07:55:47 +0000] "GET /api/server/version HTTP/1.0" 200 - "-" "ScannerCLI/6.2.1.4610" "AZStxoeEj>
		10.252.37.1 - - [29/Jan/2025:07:55:47 +0000] "GET /batch/index HTTP/1.0" 200 - "-" "ScannerCLI/6.2.1.4610" "AZStxoeEjdKAn2Hb>
		10.252.37.1 - - [29/Jan/2025:07:55:48 +0000] "GET /api/settings/values.protobuf HTTP/1.0" 200 - "-" "ScannerCLI/6.2.1.4610" >
		10.252.37.1 - - [29/Jan/2025:07:55:48 +0000] "GET /api/plugins/installed HTTP/1.0" 200 - "-" "ScannerCLI/6.2.1.4610" "AZStxo>
		10.252.37.1 - - [29/Jan/2025:07:55:49 +0000] "GET /api/settings/values.protobuf?component=STEST HTTP/1.0" 200 - "-" "Scanner>
  • I ran sonar-scanner with different options, but it didn’t work.
    Now I run sonar-scanner like this:
bin/sonar-scanner -Dsonar.host.url=https://sonardemo...com -X
		bin/sonar-scanner -Dproject.settings=conf/sonar-project.properties

I can’t find a solution to the problem, maybe someone from the community knows why the problem appears. Please help.
If you need additional information to understand the problem please tell my

Thanks!

If I remove Community Branch Plugin 1.2.2 the problems are solved
Maybe someone knows which version of the plugin works fine?
or can recommend how to configure it to work with this plugin