Elasticserach error

Jamie Sammons, modified 2 Years ago. Expert Posts: 327 Join Date: 12/20/10 Recent Posts

hi 

i am using liferay 7.4 ga31. now i backup db from prud and resotre to dev, after i restart server, basically, it work fine, but there has an error seems form elasticserach.

2023-03-10 08:24:01.737 ERROR [https-jsse-nio-443-exec-26][BulkDocumentRequestExecutorImpl:57] failure in bulk execution:_[0]: index [liferay-36339], type [LiferayDocumentType], id [com.liferay.portal.kernel.model.Layout_PORTLET_263], message [ElasticsearchException[Elasticsearch exception [type=unavailable_shards_exception, reason=[liferay-36339][0] primary shard is not active Timeout: [1m], request: [BulkShardRequest [[liferay-36339][0]] containing [2] requests and a refresh]]]]_[1]: index [liferay-36339], type [LiferayDocumentType], id [com.liferay.portal.kernel.model.Layout_PORTLET_263], message [ElasticsearchException[Elasticsearch exception [type=unavailable_shards_exception, reason=[liferay-36339][0] primary shard is not active Timeout: [1m], request: [BulkShardRequest [[liferay-36339][0]] containing [2] requests and a refresh]]]] [Sanitized]
2023-03-10 08:24:01.743 ERROR [https-jsse-nio-443-exec-26][ElasticsearchIndexWriter:361] Update failed

all funciton still work well.

why it's happen and how to fix it?

thumbnail
Jamie Sammons, modified 2 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts

I would first check if Elasticsearch is available. Is the server running, reachable and working? What does the Search page (In the Menu, Control Panel -> Search) say. Is it Green?

Second, I would check the logs on the Elasticsearch server. Maybe an error there gives some hints.

thumbnail
Scarletake Bwi, modified 2 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts

When you restored the prod db to dev, you restored the OSGi configuration.

Liferay uses the last updated source (file or UI), so even if you have a .config file that points to a dev ES, I'm sure if you check in the control panel that the prod ES is listed, and the failure points to the dev server not being able to connect to the prod instance.

Just update your configuration so it points at the dev instance of ES, reindex, then you should be right as rain.