Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-24705

ES sequencer generates NPE when ES is disabled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 9.10, 10.1
    • Fix Version/s: 9.10-HF06, 10.2
    • Component/s: Core, Elasticsearch
    • Release Notes Summary:
      Disabling Elasticsearch also disables the Elasticsearch sequencer.
    • Tags:
    • Backlog priority:
      600
    • Sprint:
      nxAI Sprint 10.2.1, nxAI Sprint 10.2.2

      Description

      1. install Nuxeo 9.10
      2. set elasticsearch.enabled=false in nuxeo.conf
      3. start nuxeo
      4. observe the following in the logs:
        2018-03-26 15:10:42,678 ERROR [localhost-startStop-1] [org.nuxeo.runtime.model.impl.RegistrationInfoImpl] Component service:org.nuxeo.ecm.core.uidgen.UIDGeneratorService notification of application started failed: null
        java.lang.NullPointerException
        	at org.nuxeo.elasticsearch.ElasticSearchComponent.getClient(ElasticSearchComponent.java:240)
        	at org.nuxeo.elasticsearch.seqgen.ESUIDSequencer.init(ESUIDSequencer.java:57)
        	at org.nuxeo.ecm.core.uidgen.UIDGeneratorComponent.start(UIDGeneratorComponent.java:63)
        	at org.nuxeo.runtime.model.impl.RegistrationInfoImpl.start(RegistrationInfoImpl.java:382)
        	at org.nuxeo.runtime.model.impl.ComponentManagerImpl.startComponent(ComponentManagerImpl.java:710)
        	at org.nuxeo.runtime.model.impl.ComponentManagerImpl.startComponents(ComponentManagerImpl.java:690)
        	at org.nuxeo.runtime.model.impl.ComponentManagerImpl.start(ComponentManagerImpl.java:793)
        	at org.nuxeo.runtime.osgi.OSGiRuntimeService.startComponents(OSGiRuntimeService.java:460)
        	at org.nuxeo.runtime.osgi.OSGiRuntimeService.frameworkEvent(OSGiRuntimeService.java:475)
        	at org.nuxeo.osgi.OSGiAdapter.fireFrameworkEvent(OSGiAdapter.java:223)
        	at org.nuxeo.osgi.application.loader.FrameworkLoader.doStart(FrameworkLoader.java:226)
        	at org.nuxeo.osgi.application.loader.FrameworkLoader.start(FrameworkLoader.java:125)
        	at org.nuxeo.runtime.deployment.NuxeoStarter.start(NuxeoStarter.java:120)
        	at org.nuxeo.runtime.deployment.NuxeoStarter.contextInitialized(NuxeoStarter.java:93)
        	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
        	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
        	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
        	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
        	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
        	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
        	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1842)
        	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        	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:745)
        
      5. this does not prevent usage of Nuxeo but generates an error and cannot be circumvented through a parameter

      After further investigation, sequencers are all started even though their dependencies are not. For example in UIDGeneratorComponent :
      https://github.com/nuxeo/nuxeo/blob/9.10/nuxeo-core/nuxeo-core/src/main/java/org/nuxeo/ecm/core/uidgen/UIDGeneratorComponent.java#L61

          @Override
          public void start(ComponentContext context) {
              for (String name : sequencers.keySet()) {
                  sequencers.get(name).init();
              }
          }

      In the init method of ESUIDSequencer, it is presumed ESClient is available
      https://github.com/nuxeo/nuxeo/blob/9.10/nuxeo-features/nuxeo-elasticsearch/nuxeo-elasticsearch-seqgen/src/main/java/org/nuxeo/elasticsearch/seqgen/ESUIDSequencer.java#L57
      which is not due to elasticsearch.enabled=false thus leading to an NPE.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours
                6h