Legacy Knowledge Base
Published Jul. 2, 2025

Liferay DXP cannot be started correctly due to "Unable to initialize Elasticsearch cluster" errors

Written By

Emma Liu

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • The server can not be started correctly with ES errors like the following:
2020-06-05 06:45:41.596 ERROR [Framework Event Dispatcher: Equinox Container: 2a6f419e-c609-4e73-a180-4e901fcc9b18][Framework:93] FrameworkEvent ERROR 
java.lang.IllegalStateException: Unable to initialize Elasticsearch cluster: {_clusterHealthStatus=RED, _healthStatusMessage='{"cluster_name":"REALCANPORTALES","status":"red","timed_out":true,"number_of_nodes":1,"number_of_data_nodes":1,"active_primary_shards":4,"active_shards":4,"relocating_shards":0,"initializing_shards":0,"unassigned_shards":6,"delayed_unassigned_shards":0,"number_of_pending_tasks":0,"number_of_in_flight_fetch":0,"task_max_waiting_in_queue_millis":0,"active_shards_percent_as_number":40.0}'}
 at com.liferay.portal.search.elasticsearch6.internal.ElasticsearchSearchEngine.waitForYellowStatus(ElasticsearchSearchEngine.java:321)
2020-06-05 06:46:41.760 ERROR [main][PortletLocalServiceImpl:334] Unable to register remote portlet for company 20101 because it does not exist
2020-06-05 06:46:46.513 ERROR [https-jsse-nio-8843-exec-30][PortalInstances:166] com.liferay.portal.kernel.exception.NoSuchGroupException: No Group exists with the key {companyId=0, groupKey=Guest}

 

On DXP 7.3, the error will look like this:

2020-10-26 16:14:00.685 ERROR [main][ElasticsearchEngineConfigurator:93] bundle com.liferay.portal.search.elasticsearch7.impl:6.0.0 (254)[com.liferay.portal.search.elasticsearch7.internal.ElasticsearchEngineConfigurator(749)] : The activate method has thrown an exception 
java.lang.RuntimeException: org.elasticsearch.ElasticsearchStatusException: ElasticsearchStatusException[Elasticsearch exception [type=security_exception, reason=unable to authenticate user [elastic] for REST request [/_cluster/health?master_timeout=30000ms&level=cluster&timeout=30000ms&wait_for_status=yellow]]]
at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:187)
at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:1892)
at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:1869)
at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1626)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1583)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1553)
at org.elasticsearch.client.ClusterClient.health(ClusterClient.java:130)
at com.liferay.portal.search.elasticsearch7.internal.search.engine.adapter.cluster.HealthClusterRequestExecutorImpl.getClusterHealthResponse(HealthClusterRequestExecutorImpl.java:98)

Environment

  • Liferay DXP 7.2
  • Liferay DXP 7.3
  • Liferay DXP 7.4

Resolution

  • The issue is mainly caused by Elastic Search cluster status. As we can see in the log, the Elastic search cluster status is RED ( _clusterHealthStatus=RED) which causes Liferay failed to initialize correctly.
  • Please resolve the Elastic Search Cluster issue first, then restart the Liferay server.

Related

 

 

Did this article resolve your issue ?

Legacy Knowledge Base