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

Multiple issues with Elasticsearch 7 upgrade process



      This ticket will address several issues with the Elasticsearch 7 config upgrade process. All steps below assume Elasticsearch 7 was deployed into a clean bundle.

      Issue 1 - Fields within the ElasticsearchConnectionConfiguration-default.config are not updated if there is no ElasticsearchConfiguration.config file present in bundle

      Steps to reproduce:

      1. Delete any ElasticsearchConfiguration.config from osgi/config if present
      2. Take note of the fields within ElasticsearchConnectionConfiguration-default.config (e.g. active=true)
      3. Start Portal

      Expected result: The "active" field within ElasticsearchConnectionConfiguration-default.config should be changed from true to false since Portal is starting in embedded mode. No remote connection appears in Search Admin.
      Actual result: The content within ElasticsearchConnectionConfiguration-default.config are unchanged. Within Search Admin a "Error java.net.ConnectException: Connection refused" appears.

      Issue 2 - When ElasticsearchConfiguration.config is present in the bundle and using embedded mode,  the absence of the ElasticsearchConnectionConfiguration-default.config file causes startup errors

      Steps to reproduce:

      1. Create / Modify the ElasticsearchConfiguration.config within osgi/config and delete operationMode="REMOTE" if present (use embedded mode).
      2. Delete ElasticsearchConnectionConfiguration-default.config if present
      3. Start Portal

      Expected result: No startup errors and embedded Elasticsearch functions normally.
      Actual result: The following error appears in the console:

      ERROR [main][UpgradeStepRegistratorTracker:179] Failed upgrade process for module com.liferay.portal.search.elasticsearch7.impl
      com.liferay.portal.kernel.upgrade.UpgradeException: java.lang.NullPointerException

      Note: If ElasticsearchConfiguration.config is not present in the bundle, no startup errors occur.


      Issue 3 - When ElasticsearchConfiguration.config is using a connection ID other than "remote", the "active" field within ElasticsearchConnectionConfiguration-default.config is not changed to false on startup . This may lead to an unused connection process running.

      Steps to reproduce:

      1. Download and set up an Elasticsearch 7 remote server
      2. Within ElasticsearchConfiguration.config set the following properties:
      1. Copy the ElasticsearchConnectionConfiguration-default.config file and in the name replace the -default with -remote. Then within the file, change the connectionId from "remote" to "test"
      2. Leave the ElasticsearchConnectionConfiguration-default.config within the bundle keep the default values.
      3. Start Portal

      Expected result: The active field within ElasticsearchConnectionConfiguration-default.config is changed from true to false.
      Actual result: The fields within ElasticsearchConnectionConfiguration-default.config remain unchanged. In Search Admin, both the "test" and "remote" connections are both active. The "remote" connection seemingly points to the same node as the "test" connection.

      Note: With the fix for this issue above, users will no longer be able to use the ElasticsearchConnectionConfiguration-default.config to set up a custom connection with a connection ID other than "remote".

      Reproduced on:
      Portal master git commit: e07e3a8b4857d0680ee5dcef2f05cd8d96a9c780


          Issue Links



              • Assignee:
                joshua.chong Joshua Chong
                joshua.chong Joshua Chong
                Participants of an Issue:
                Recent user:
                Joshua Chong
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created:
                  Days since last comment:
                  18 weeks, 2 days ago


                  Version Package