Sonar Load BranchConfiguration error

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    7.9.3
  • how is SonarQube deployed: zip, Docker, Helm
    Docker
  • what are you trying to achieve
    Run sonar analysis from local docker image
  • what have you tried so far to achieve this
    This is the error log
13:46:53.196 ERROR: Error during SonarScanner execution

java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.filesystem.InputComponentStore

at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)

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.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034)

at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026)

at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003)

at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)

at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)

at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)

at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)

at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)

at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)

at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)

at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)

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 interface org.sonar.scanner.scan.branch.BranchConfiguration

at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)

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:63)

... 34 more

Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.branch.ProjectPullRequests

at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)

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:63)

... 48 more

Caused by: java.lang.NullPointerException

at com.github.mc1arke.sonarqube.plugin.scanner.CommunityProjectPullRequestsLoader.lambda$createPullRequestInfoJsonDeserialiser$0(CommunityProjectPullRequestsLoader.java:74)

at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)

at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)

at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:82)

at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)

at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:131)

at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:222)

at com.google.gson.Gson.fromJson(Gson.java:922)

at com.google.gson.Gson.fromJson(Gson.java:860)

at com.github.mc1arke.sonarqube.plugin.scanner.CommunityProjectPullRequestsLoader.load(CommunityProjectPullRequestsLoader.java:93)

at org.sonar.scanner.scan.branch.ProjectPullRequestsProvider.provide(ProjectPullRequestsProvider.java:47)

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.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)

at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39)

at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113)

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:63)

**Do not share screenshots of logs -- share the text itself (bonus points for being well-formatted)!**

Found out the issue

Problem with the mc1arke library used in the Community Sonar version.

Null Pointer Exception is not handled properly.

Reference :

There were some Branches in Sonar Project which didn’t have ‘analysisDate’ field.
So the deserialization of the GET pull_request_list API response was failing.

Resolution : Deleted those Branches from the sonar UI.

Further runs started working properly.

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