NullPointerException in Background Task after update to SonarJava 5.8.0.15699

java

(Torsten Walter) #1

SonarQube Version: 6.7.3 (build 38370)

After updating SonarQube plugins analysis failed.

The last analysis has failed. More details available on the Background Tasks page.

Error Details

java.lang.NullPointerException: at index 0
	at com.google.common.collect.ObjectArrays.checkElementNotNull(ObjectArrays.java:240)
	at com.google.common.collect.ImmutableSet.construct(ImmutableSet.java:195)
	at com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:375)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:503)
	at org.sonar.core.metric.ScannerMetrics.<init>(ScannerMetrics.java:131)
	at sun.reflect.GeneratedConstructorAccessor266.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145)
	at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:342)
	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.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.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.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.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
	at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:265)
	at org.sonar.server.computation.task.projectanalysis.step.AbstractComputationSteps.lambda$instances$0(AbstractComputationSteps.java:43)
	at com.google.common.collect.Iterators$8.transform(Iterators.java:799)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at org.sonar.server.computation.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:62)
	at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52)
	at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:73)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.executeTask(CeWorkerImpl.java:134)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:97)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.withCustomizedThreadName(CeWorkerImpl.java:81)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:73)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:43)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

Sonar scanner context:

SonarQube plugins:
  - SonarCSS 1.0.2.611 (cssfamily)
  - Branch 1.0.0.507 (branch)
  - SonarPLSQL 3.3.0.2273 (plsql)
  - German Pack 1.2 (l10nde)
  - SonarC# 7.7.0.7192 (csharp)
  - SonarJava 5.8.0.15699 (java)
  - Sonargraph Integration 2.1.5 (sonargraphintegration)
  - LDAP 2.2.0.608 (ldap)
  - SonarHTML 3.0.1.1444 (web)
  - SonarXML 1.5.1.1452 (xml)
  - SonarTS 1.8.0.3332 (typescript)
  - SonarVB 7.7.0.7192 (vbnet)
  - SonarSwift 4.0.0.2853 (swift)
  - GitHub 1.4.2.1027 (github)
  - SonarCFamily 5.1.1.10386 (cpp)
  - SonarPython 1.10.0.2131 (python)
  - JaCoCo 1.0.1.143 (jacoco)
  - SonarGo 1.1.0.1612 (go)
  - SonarKotlin 1.2.1.2009 (kotlin)
  - SonarRPG 2.3.0.1187 (rpg)
  - Sonargraph 3.5 (Sonargraph)
  - SonarPLI 1.9.0.1349 (pli)
  - SonarTSQL 1.3.0.2899 (tsql)
  - SonarVB6 2.4.0.1305 (vb)
  - SonarJS 5.0.0.6962 (javascript)
  - License 3.3.0.1341 (license)
  - Groovy 1.5 (groovy)
  - SonarCOBOL 4.3.0.3019 (cobol)
  - Git 1.4.1.1128 (scmgit)
  - SonarPHP 2.15.0.4060 (php)
  - Timeline 1.5 (timeline)
  - Developer 1.0.0.240 (developer)
  - SonarABAP 3.7.0.1603 (abap)
  - Governance 2.0.3 (governance)
Global properties:
  - sonar.core.id=1494c6de152bd59
  - sonar.core.startTime=2018-11-01T14:27:24+0100
  - sonar.lf.enableGravatar=true
  - sonar.webhooks.global=1
  - sonar.webhooks.global.1.name=jenkins
  - sonar.java.source=1.8
  - sonar.java.target=1.8

After downgrading SonarJava to 5.5.0.14655 it worked again.
This issue might be related to: https://jira.sonarsource.com/browse/SONAR-11279
Difference is that that one is reported against SonarQube itself and not the plugin.


(SĂ©bastien Lesaint) #3

Hi,

The issue can’t relate to the ticket you mentioned.

We dig a bit into SQ and sonar-java with the information you provided, we couldn’t find anything to explain the error.
It’s more likely the error comes from another plugin, triggered by the installation of a newer version of sonar-java.

At this point, I would advise you do the following experiments to narrow down the search:

  • check whether the error also comes when updating to a sonar-java between 5.5.0 and 5.8.0
  • check whether the error disappears when removing non SonarSource plugins one by one
  • same with removing sonarsource plugins one by one

Cheers


(Torsten Walter) #4

Hi,

Thanks for the fast reply. You said:

It’s more likely the error comes from another plugin, triggered by the installation of a newer version of sonar-java.

But why is it solved then, by only reverting sonar-java back to 5.5.0.
We did this by downloading the old version of the plugin and putting it to $SONARQUBE_HOME/extensions/plugins.

Regards


(G Ann Campbell) #5

Hi,

That would be because the other plugin was relying on a behavior (exploiting a bug?) in SonarJava that changed in the new version.

Regardless, I would start by uninstalling the Timeline plugin, which is long-since deprecated & of no practical value since SonarQube v6.2, which dropped dashboards. Sonargraph Integration is the other possibly suspect (non-SonarSource) plugin I see in your list. (We don’t own l10n-de either, but the likelihood of that being involved in your problem is minute).

 
Ann