Issue
- In case of large web contents executing the
reindex all search indexes
operation can throw the following warnings:
2021-07-27 06:46:39.595 WARN [liferay/search_writer/SYSTEM_ENGINE-2][ProxyMessageListener:86] java.lang.RuntimeException: org.elasticsearch.ElasticsearchStatusException: ElasticsearchStatusException[Unable to parse response body]; nested: ResponseException[method [POST], host [http://127.0.0.1:9201], URI [/_bulk?refresh=true&timeout=1m], status line [HTTP/1.1 413 Request Entity Too Large]_]; [Sanitized]
java.lang.RuntimeException: org.elasticsearch.ElasticsearchStatusException: ElasticsearchStatusException[Unable to parse response body]; nested: ResponseException[method [POST], host [http://127.0.0.1:9201], URI [/_bulk?refresh=true&timeout=1m], status line [HTTP/1.1 413 Request Entity Too Large]_];
WARN [liferay/search_writer/SYSTEM_ENGINE-4][ProxyMessageListener:86] java.lang.RuntimeException: org.elasticsearch.ElasticsearchStatusException: ElasticsearchStatusException[Elasticsearch exception [type=es_rejected_execution_exception, reason=rejected execution of coordinating operation [coordinating_and_primary_bytes=0, replica_bytes=0, all_bytes=0, coordinating_operation_bytes=120110686, max_coordinating_and_primary_bytes=102917734]]]
java.lang.RuntimeException: org.elasticsearch.ElasticsearchStatusException: ElasticsearchStatusException[Elasticsearch exception [type=es_rejected_execution_exception, reason=rejected execution of coordinating operation [coordinating_and_primary_bytes=0, replica_bytes=0, all_bytes=0, coordinating_operation_bytes=120110686, max_coordinating_and_primary_bytes=102917734]]]
- These will not necessarily cause the operation to fail but will prevent you from accessing these web contents through headless API
Resolution
- Our recommended out-of-the-box solution for this is to reduce the bulk size for journal articles.
- This option can be found under System Settings -> Search -> Reindex -> Indexing Batch Sizes.
- Add the
com.liferay.journal.model.JournalArticle=500
property to the Indexing Batch Sizes field
- If the above solution does not fit your use case you can increase the value of the
http.max_content_length
configuration in elasticsearch.yml file. This might cause an issue where the default 1g Xmx value (Elastic)
is too low for reindexing the data. Therefore you will need to increase that value as well.