Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-97878

NPE is produced in case sslKeystorePassword or sslTruststorePassword are not configured in XPack security

    Details

      Description

      Steps to reproduce

      1. Install a new Liferay instance
      2. Install a Elasticsearch server (see: https://portal.liferay.dev/docs/7-2/deploy/-/knowledge_base/d/installing-elasticsearch )
      3. Configure Liferay with REMOTE Elasticsearch configuration (see: https://portal.liferay.dev/docs/7-2/deploy/-/knowledge_base/d/configuring-the-liferay-elasticsearch-connector )
      4. Execute a full reindex and verify search is working
      5. Stop Liferay
      6. Copy attached com.liferay.portal.search.elasticsearch6.xpack.security.internal.configuration.XPackSecurityConfiguration.config to LIFERAY_HOME/osgi/config folder
      7. Start Liferay and check log files:
        • Expected behavior: NPE error in org.elasticsearch.node.InternalSettingsPreparer.replacePromptPlaceholders is not thrown
        • Wrong behavior: NPE error in org.elasticsearch.node.InternalSettingsPreparer.replacePromptPlaceholders is thrown
          2019-07-05 11:04:42.839 ERROR [Framework Event Dispatcher: Equinox Container: f57c3948-cd63-4a50-acf3-c038d0750e5e][Framework:93] FrameworkEvent ERROR
          java.lang.RuntimeException: Unable to initialize Elasticsearch engine
                  at com.liferay.portal.search.elasticsearch6.internal.ElasticsearchEngineConfigurator.initialize(ElasticsearchEngineConfigurator.java:108)
                  at com.liferay.portal.kernel.search.BaseSearchEngineConfigurator$1.dependenciesFulfilled(BaseSearchEngineConfigurator.java:79)
                  at com.liferay.registry.dependency.ServiceDependencyManager.verifyDependencies(ServiceDependencyManager.java:145)
                  at com.liferay.registry.dependency.ServiceDependencyManager$ServiceDependencyServiceTrackerCustomizer.addingService(ServiceDependencyManager.java:241)
                  at com.liferay.registry.internal.ServiceTrackerCustomizerAdapter.addingService(ServiceTrackerCustomizerAdapter.java:35)
          [...]
                  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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
                  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
          Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
                  at java.util.concurrent.FutureTask.report(FutureTask.java:122)
                  at java.util.concurrent.FutureTask.get(FutureTask.java:192)
                  at com.liferay.portal.search.elasticsearch6.internal.ElasticsearchEngineConfigurator.initialize(ElasticsearchEngineConfigurator.java:105)
                  ... 150 more
          Caused by: java.lang.NullPointerException
                  at org.elasticsearch.node.InternalSettingsPreparer.replacePromptPlaceholders(InternalSettingsPreparer.java:161)
                  at org.elasticsearch.node.InternalSettingsPreparer.finalizeSettings(InternalSettingsPreparer.java:154)
                  at org.elasticsearch.node.InternalSettingsPreparer.prepareSettings(InternalSettingsPreparer.java:53)
                  at org.elasticsearch.client.transport.TransportClient.newPluginService(TransportClient.java:105)
                  at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:133)
                  at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:284)
                  at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:128)
                  at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:47)
                  at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:42)
                  at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:38)
                  at com.liferay.portal.search.elasticsearch6.internal.connection.RemoteElasticsearchConnection.createTransportClient(RemoteElasticsearchConnection.java:156)
                  at com.liferay.portal.search.elasticsearch6.internal.connection.RemoteElasticsearchConnection.createClient(RemoteElasticsearchConnection.java:129)
                  at com.liferay.portal.search.elasticsearch6.internal.connection.BaseElasticsearchConnection.connect(BaseElasticsearchConnection.java:65)
                  at com.liferay.portal.search.elasticsearch6.internal.connection.ElasticsearchConnectionManager.connect(ElasticsearchConnectionManager.java:59)
                  at com.liferay.portal.search.elasticsearch6.internal.ElasticsearchEngineConfigurator.lambda$initialize$0(ElasticsearchEngineConfigurator.java:92)
                  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                  at java.lang.Thread.run(Thread.java:748)
          

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                linda.sui Linda Sui
                Reporter:
                jorge.diaz Jorge Diaz
                Participants of an Issue:
                Recent user:
                Enterprise Release HU
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 weeks, 1 day ago

                  Packages

                  Version Package
                  7.1.X
                  7.2.X
                  Master