SonarScanner issue with ProjectLock

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Developer Edition Version 8.9 (build 43852) on k8s single pod instance; SonarQube Scanner 4.2.0.1873
  • what are you trying to achieve
    identify issue with plugin
  • what have you tried so far to achieve this
    Digging down to check out correctness of sonar.properties. Quite new in Sonarqube. Pipeline is being triggered from jenkins.

Blockquote
14:39:48.334 INFO: Load plugins index (done) | time=186ms
14:39:50.479 INFO: Load/download plugins (done) | time=2332ms
14:39:52.135 DEBUG: Plugins:
14:39:52.135 DEBUG: * CSS Code Quality and Security 1.4.2.2002 (cssfamily)
14:39:52.135 DEBUG: * PL/SQL Code Quality and Security 3.6.1.3873 (plsql)
14:39:52.136 DEBUG: * Scala Code Quality and Security 1.8.3.2219 (sonarscala)
14:39:52.136 DEBUG: * C# Code Quality and Security 8.22.0.31243 (csharp)
14:39:52.136 DEBUG: * Vulnerability Analysis 8.9.0.11439 (security)
14:39:52.136 DEBUG: * Java Code Quality and Security 6.15.1.26025 (java)
14:39:52.136 DEBUG: * HTML Code Quality and Security 3.4.0.2754 (web)
14:39:52.136 DEBUG: * Flex Code Quality and Security 2.6.1.2564 (flex)
14:39:52.137 DEBUG: * XML Code Quality and Security 2.2.0.2973 (xml)
14:39:52.137 DEBUG: * VB.NET Code Quality and Security 8.22.0.31243 (vbnet)
14:39:52.137 DEBUG: * Community Branch Plugin 1.8.0 (communityBranchPlugin)
14:39:52.137 DEBUG: * Prometheus Exporter 1.0.0-SNAPSHOT (prometheusexporter)
14:39:52.137 DEBUG: * CFamily Code Quality and Security 6.20.0.31240 (cpp)
14:39:52.137 DEBUG: * Python Code Quality and Security 3.4.1.8066 (python)
14:39:52.137 DEBUG: * Go Code Quality and Security 1.8.3.2219 (go)
14:39:52.137 DEBUG: * JaCoCo 1.1.1.1157 (jacoco)
14:39:52.138 DEBUG: * Kotlin Code Quality and Security 1.8.3.2219 (kotlin)
14:39:52.138 DEBUG: * T-SQL Code Quality and Security 1.5.1.4340 (tsql)
14:39:52.138 DEBUG: * JavaScript/TypeScript Code Quality and Security 7.4.2.15501 (javascript)
14:39:52.138 DEBUG: * Ruby Code Quality and Security 1.8.3.2219 (ruby)
14:39:52.138 DEBUG: * Vulnerability Rules for C# 8.9.0.11439 (securitycsharpfrontend)
14:39:52.138 DEBUG: * Vulnerability Rules for Java 8.9.0.11439 (securityjavafrontend)
14:39:52.138 DEBUG: * License for SonarLint 8.9.0.43852 (license)
14:39:52.138 DEBUG: * Vulnerability Rules for JS 8.9.0.11439 (securityjsfrontend)
14:39:52.139 DEBUG: * Vulnerability Rules for Python 8.9.0.11439 (securitypythonfrontend)
14:39:52.139 DEBUG: * PHP Code Quality and Security 3.17.0.7439 (php)
14:39:52.139 DEBUG: * ABAP Code Quality and Security 3.9.1.3127 (abap)
14:39:52.139 DEBUG: * Vulnerability Rules for PHP 8.9.0.11439 (securityphpfrontend)
14:39:52.283 INFO: Loaded core extensions: developer-scanner
14:39:52.327 DEBUG: Installed core extension: developer-scanner
14:39:53.931 INFO: JavaScript/TypeScript frontend is enabled
14:39:54.646 INFO: ------------------------------------------------------------------------
14:39:54.646 INFO: EXECUTION FAILURE
14:39:54.646 INFO: ------------------------------------------------------------------------
14:39:54.647 INFO: Total time: 10.647s
14:39:54.711 INFO: Final Memory: 6M/68M
14:39:54.711 INFO: ------------------------------------------------------------------------
14:39:54.711 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ProjectLock
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:66)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:282)
at org.sonar.scanner.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:156)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.api.batch.fs.internal.DefaultInputProject
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:66)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:64)
… 22 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ProjectReactorValidator
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:66)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
at org.picocontainer.injectors.SingleMemberInjector.getMemberArguments(SingleMemberInjector.java:61)
at org.picocontainer.injectors.MethodInjector.getMemberArguments(MethodInjector.java:100)
at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:112)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:64)
… 36 more
Caused by: org.picocontainer.injectors.AbstractInjector$AmbiguousComponentResolutionException: ConstructorInjector-class org.sonar.scanner.scan.ProjectReactorValidator needs a ‘org.sonar.scanner.scan.branch.BranchParamsValidator’ injected via ‘public org.sonar.scanner.scan.ProjectReactorValidator(org.sonar.scanner.bootstrap.GlobalConfiguration,org.sonar.scanner.scan.branch.BranchParamsValidator)’, but there are too many choices to inject. These:[ConstructorInjector-class com.sonarsource.branch.BranchParamsValidatorImpl, ConstructorInjector-class com.github.mc1arke.sonarqube.plugin.scanner.CommunityBranchParamsValidator], refer http://picocontainer.org/ambiguous-injectable-help.html
at org.picocontainer.parameters.BasicComponentParameter.tooManyMatchingAdaptersFound(BasicComponentParameter.java:260)
at org.picocontainer.parameters.BasicComponentParameter.resolveAdapter(BasicComponentParameter.java:222)
at org.picocontainer.parameters.BasicComponentParameter.resolve(BasicComponentParameter.java:100)
at org.picocontainer.parameters.ComponentParameter.access$001(ComponentParameter.java:39)
at org.picocontainer.parameters.ComponentParameter$1.(ComponentParameter.java:120)
at org.picocontainer.parameters.ComponentParameter.resolve(ComponentParameter.java:119)
at org.picocontainer.injectors.ConstructorInjector.getGreediestSatisfiableConstructor(ConstructorInjector.java:152)
at org.picocontainer.injectors.ConstructorInjector.getGreediestSatisfiableConstructor(ConstructorInjector.java:110)
at org.picocontainer.injectors.ConstructorInjector.access$100(ConstructorInjector.java:51)
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:331)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:64)
… 51 more

Blockquote

If you’re running Developer edition, then the Community Branch Plugin is unnecessary, and will prevent Sonarqube launching.

Sonarqube is looking for an implementation of its branch features during start-up, and is finding one being provided directly by Sonarqube developer edition. as well as one from this plugin, and Sonarqube doesn’t know how to select which implementation to use.

If you remove the plugin, and any associated configuration you’ve added to get Sonarqube to use the plugin (e.g. the javagent args on Compute Engine and Web components), then you should be able to overcome this issue.

@mc1arke thx for help. solved

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.