java.lang.IllegalStateException: Unable to load component class org.sonar.api.config.Settings (During loading project Repositories)

3,810 views
Skip to first unread message

dreaminv...@gmail.com

unread,
Oct 16, 2017, 6:16:19 AM10/16/17
to SonarQube
Hi,
  When get ***/batch/project.protobuf?key=MY_PROJECT_KEY, sonar-scanner will Crash.

The concrete exception like this:

// [ sonar-scanner msg ]
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.api.config.Settings
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:69)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:272)
at org.sonar.batch.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:112)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:140)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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:233)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.batch.repository.ProjectRepositories
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:69)
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:67)
... 23 more
Caused by: org.sonarqube.ws.client.HttpException: Error 500 on http://it-ci.huawei.com/quality4/batch/project.protobuf?key=IncentiveEngine_key
at org.sonarqube.ws.client.BaseResponse.failIfNotSuccessful(BaseResponse.java:34)
at org.sonar.batch.bootstrap.BatchWsClient.failIfUnauthorized(BatchWsClient.java:99)
at org.sonar.batch.bootstrap.BatchWsClient.call(BatchWsClient.java:69)
at org.sonar.batch.repository.DefaultProjectRepositoriesLoader.load(DefaultProjectRepositoriesLoader.java:58)
at org.sonar.batch.repository.ProjectRepositoriesProvider.provide(ProjectRepositoriesProvider.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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:67)
... 37 more
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.

// sonarqube log:
2017.10.16 09:01:29 ERROR web[o.s.s.w.WebServiceEngine] Fail to process request http://it-ci.huawei.com/quality4/batch/project.protobuf?key=IncentiveEngine_key
java.lang.NullPointerException: null
        va.lang.NullPointerException: null
        at com.google.protobuf.ByteString.copyFromUtf8(ByteString.java:321) ~[protobuf-java-3.0.0-beta-2.jar:na]
        at com.google.protobuf.TextFormat.escapeText(TextFormat.java:1892) ~[protobuf-java-3.0.0-beta-2.jar:na]
        at com.google.protobuf.TextFormat$Printer.printFieldValue(TextFormat.java:428) ~[protobuf-java-3.0.0-beta-2.jar:na]
        at com.google.protobuf.TextFormat$Printer.printSingleField(TextFormat.java:368) ~[protobuf-java-3.0.0-beta-2.jar:na]
        at com.google.protobuf.TextFormat$Printer.printField(TextFormat.java:327) ~[protobuf-java-3.0.0-beta-2.jar:na]
        at com.google.protobuf.TextFormat$Printer.print(TextFormat.java:314) ~[protobuf-java-3.0.0-beta-2.jar:na]
        at com.google.protobuf.TextFormat$Printer.printFieldValue(TextFormat.java:450) ~[protobuf-java-3.0.0-beta-2.jar:na]
        at com.google.protobuf.TextFormat$Printer.printSingleField(TextFormat.java:368) ~[protobuf-java-3.0.0-beta-2.jar:na]
        at com.google.protobuf.TextFormat$Printer.printField(TextFormat.java:324) ~[protobuf-java-3.0.0-beta-2.jar:na]
        at com.google.protobuf.TextFormat$Printer.print(TextFormat.java:314) ~[protobuf-java-3.0.0-beta-2.jar:na]
        at com.google.protobuf.TextFormat$Printer.access$400(TextFormat.java:288) ~[protobuf-java-3.0.0-beta-2.jar:na]
        at com.google.protobuf.TextFormat.shortDebugString(TextFormat.java:113) ~[protobuf-java-3.0.0-beta-2.jar:na]
        at org.sonarqube.ws.MessageFormatter.print(MessageFormatter.java:32) ~[sonar-ws-5.6.1.jar:na]
        at org.sonar.server.ws.WsUtils.writeProtobuf(WsUtils.java:63) ~[sonar-server-5.6.1.jar:na]
        at org.sonar.server.batch.ProjectAction.handle(ProjectAction.java:83) ~[sonar-server-5.6.1.jar:na]

hmmm, what happened here, why yield 500 error?

G. Ann Campbell

unread,
Oct 16, 2017, 7:56:20 AM10/16/17
to SonarQube
Hi,

What version of SonarQube are you running?


Ann

dreaminv...@gmail.com

unread,
Oct 16, 2017, 10:40:20 PM10/16/17
to SonarQube
Hi,

Environment:
Centos + SonarQube 5.6 + Scanner 3.x

Centos
在 2017年10月16日星期一 UTC+8下午7:56:20,G. Ann Campbell写道:

Simon Brandhof

unread,
Oct 17, 2017, 7:41:50 AM10/17/17
to SonarQube
Hi,

Apparently scanner failed to load data from server. You should check the server logs (see logs/ directory).

Regards

Simon Brandhof

unread,
Oct 17, 2017, 7:43:48 AM10/17/17
to SonarQube
My bad, your log is provided in your first email !

Simon Brandhof

unread,
Oct 17, 2017, 7:47:59 AM10/17/17
to SonarQube
You face https://jira.sonarsource.com/browse/SONAR-9423, which is fixed in version 6.5.

sg.v...@gmail.com

unread,
Mar 22, 2018, 7:02:36 AM3/22/18
to SonarQube
Hello,
I'm facing the same issue with SonarQube 5.6 and I don't plan to migrate to 6.5 before end of the year.
The issue happens on my main projects (with more than 50 developers).
Is there a workaround for this issue in the version 5.6 ? I read in stackoverflow that one solution is to delete the project in SonarQube before a new analysis. But in my case I can't lose the history.

Thanks for your help because it becomes critical in my case as analysis fails.
Sebastien

G. Ann Campbell

unread,
Mar 22, 2018, 12:59:18 PM3/22/18
to SonarQube
Hi Sebastien,

Sorry, there's no workaround. 


Ann

sg.v...@gmail.com

unread,
Mar 23, 2018, 3:47:11 AM3/23/18
to SonarQube
Hi Ann,

Thanks for your reply (even if I hoped of another answer ;-) )

Do you know if the root is identified and manual action could be done in Sonar data to try to avoid the issue ? 
May be something like export a Sonar project and delete and recreate it from exported data.
Because a new analysis of the same project in a new Sonar project works well.

Thanks in advance.
Sebastien.

Nicolas Bontoux

unread,
Mar 23, 2018, 4:17:45 AM3/23/18
to sg.v...@gmail.com, SonarQube
Hi Sebastien,

Be sure that if we were aware of any workaround or manual trick to avoid SONAR-9423, then it would be mentioned directly in the ticket. This was quite a tricky one, the best approach to keep history really is to upgrade to fixed version (which is anyhow a good opportunity, since v5.6.x is now end-of-life).

Best regards,
Nicolas

--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/FAmhqAaGFJE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/68d0292a-4065-4d38-9987-9bf32ca2bff4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Nicolas Bontoux | SonarSource

Support Engineer

http://sonarsource.com

Reply all
Reply to author
Forward
0 new messages