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

The "Network Bind Host" setting of Elasticsearch 7 doesn't work

    Details

      Description

      The "Network Bind Host" setting of Elasticsearch 7 doesn't work.

      This setting is useful in case you want to connect to the embedded http port of a Liferay installation that you are executing in a VM or in a docker container.

      Root cause of the issue
      In the ElasticsearchInstanceSettingsBuilder class we are setting the network.bind.host configuration parameter of Elasticsearch, but it doesn't exist, it seems it is a typo, the correct parameter is network.bind_host, with a "_" between bind and host, see: https://www.elastic.co/guide/en/elasticsearch/reference/7.9/modules-network.html#advanced-network-settings

      Steps to reproduce

      1. Go to Control Panel => System Setting => Search => Elasticsearch 7 **
      2. Configure the "Network Bind Host" setting to "0.0.0.0"
      3. Save the changes and check the log file:
        • Expected behavior: There are no ERROR traces in the log file
        • Wrong behavior: Following ERROR traces are written in the log file
          2021-06-24 06:25:23.686 ERROR [CM Event Dispatcher (Fire ConfigurationEvent: pid=com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration)][ElasticsearchConnectionManager:81] Elasticsearch sidecar could not be started. Search will be unavailable. Manual installation of Elasticsearch and activation of remote mode is recommended.
          java.lang.RuntimeException: com.liferay.petra.process.ProcessException: Unable to start elasticsearch server
             at com.liferay.portal.search.elasticsearch7.internal.sidecar.Sidecar.startElasticsearch(Sidecar.java:360)
             at com.liferay.portal.search.elasticsearch7.internal.sidecar.Sidecar.start(Sidecar.java:116)
             at com.liferay.portal.search.elasticsearch7.internal.sidecar.SidecarManager.lambda$applyConfigurations$0(SidecarManager.java:135)
             at com.liferay.portal.search.elasticsearch7.internal.connection.ElasticsearchConnection.connect(ElasticsearchConnection.java:61)
             at com.liferay.portal.search.elasticsearch7.internal.connection.ElasticsearchConnectionManager.addElasticsearchConnection(ElasticsearchConnectionManager.java:75)
             at com.liferay.portal.search.elasticsearch7.internal.sidecar.SidecarManager.applyConfigurations(SidecarManager.java:142)
             at com.liferay.portal.search.elasticsearch7.internal.sidecar.SidecarManager.onElasticsearchConfigurationUpdate(SidecarManager.java:70)
             at java.lang.Iterable.forEach(Iterable.java:75)
             at com.liferay.portal.search.elasticsearch7.internal.configuration.ElasticsearchConfigurationWrapper.activate(ElasticsearchConfigurationWrapper.java:279)
             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.felix.scr.impl.inject.methods.BaseMethod.invokeMethod(BaseMethod.java:228)
             at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41)
             at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:664)
             at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:510)
             at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:310)
             at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:300)
             at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeModifiedMethod(SingleComponentManager.java:837)
             at org.apache.felix.scr.impl.manager.SingleComponentManager.modify(SingleComponentManager.java:792)
             at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:710)
             at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:674)
             at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.configurationUpdated(ConfigurableComponentHolder.java:435)
             at org.apache.felix.scr.impl.manager.RegionConfigurationSupport.configurationEvent(RegionConfigurationSupport.java:317)
             at org.apache.felix.scr.impl.manager.RegionConfigurationSupport$2.configurationEvent(RegionConfigurationSupport.java:119)
             at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.sendEvent(ConfigurationManager.java:1685)
             at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1637)
             at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138)
             at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105)
             at java.lang.Thread.run(Thread.java:748)
          Caused by: com.liferay.petra.process.ProcessException: Unable to start elasticsearch server
             at com.liferay.portal.search.elasticsearch7.internal.sidecar.ElasticsearchServerUtil.start(ElasticsearchServerUtil.java:65)
             at com.liferay.portal.search.elasticsearch7.internal.sidecar.StartSidecarProcessCallable.call(StartSidecarProcessCallable.java:37)
             at com.liferay.portal.search.elasticsearch7.internal.sidecar.StartSidecarProcessCallable.call(StartSidecarProcessCallable.java:29)
             at com.liferay.petra.process.local.RequestProcessCallable.call(RequestProcessCallable.java:40)
             at java.util.concurrent.FutureTask.run(FutureTask.java:266)
             at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
             ... 1 more
          Caused by: java.lang.reflect.InvocationTargetException
             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 com.liferay.portal.search.elasticsearch7.internal.sidecar.ElasticsearchServerUtil.start(ElasticsearchServerUtil.java:56)
             ... 7 more
          Caused by: org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [network.bind.host] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
             at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:174)
             at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161)
             at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
             at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
             at org.elasticsearch.cli.Command.main(Command.java:90)
             at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126)
             at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
             ... 12 more
          Caused by: java.lang.IllegalArgumentException: unknown setting [network.bind.host] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
             at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:544)
             at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:489)
             at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:460)
             at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:431)
             at org.elasticsearch.common.settings.SettingsModule.<init>(SettingsModule.java:149)
             at org.elasticsearch.node.Node.<init>(Node.java:385)
             at org.elasticsearch.node.Node.<init>(Node.java:277)
             at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:227)
             at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:227)
             at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393)
             at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170)
             ... 18 more
          

        Attachments

          Activity

            People

            Assignee:
            brooke.dalton Brooke Dalton
            Reporter:
            jorge.diaz Jorge Diaz
            Participants of an Issue:
            Recent user:
            Rafaela Nascimento
            Engineering Assignee:
            Tibor Lipusz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              12 weeks, 1 day ago
              Development End Date:
              Development Start Date:

                Packages

                Version Package
                7.4.2 CE GA3 DXP 7,4
                Master