Issue
- We are upgrading from 7.0 to quarterly release 2023.Q4.8
- During the upgrade step KaleoDefinitionVersionUpgradeProcess#_upgradeKaleoDefinitionVersion we are encountering an error trace related to Elasticsearch.
2024-08-27 23:20:12.703 INFO [main][LoggingTimer:74] Starting com.liferay.portal.workflow.kaleo.designer.web.internal.upgrade.v1_0_1.KaleoDefinitionVersionUpgradeProcess#_upgradeKaleoDefinitionVersion {upgrade.component=com.liferay.portal.workflow.kaleo.designer.web} 2024-08-27 23:20:16.531 ERROR [com.liferay.portal.workflow.metrics.internal.petra.executor.WorkflowMetricsPortalExecutor-2][BulkDocumentRequestExecutorImpl:48] failure in bulk execution:_[0]: index [liferay-20116-workflow-metrics-instances], type [_doc], id [WorkflowMetricsInstance054fadffff4241caa1d72ccbfc3206e14a8ed4dff007349a77d3fadbd8c1ea2c], message [[liferay-20116-workflow-metrics-instances] ElasticsearchException[Elasticsearch exception [type=index_not_found_exception, reason=no such index [liferay-20116-workflow-metrics-instances] and [action.auto_create_index] is [false]]]]_[1]: index [liferay-20116-workflow-metrics-sla-instance-results], type [_doc], id [WorkflowMetricsSLAInstanceResult05a5fa65928f275c1594260229e1e76928ce587aeaeada330945788474ed1420], message [[liferay-20116-workflow-metrics-sla-instance-results] ElasticsearchException[Elasticsearch exception [type=index_not_found_exception, reason=no such index [liferay-20116-workflow-metrics-sla-instance-results] and [action.auto_create_index] is [false]]]]_[2]: index [liferay-20116-workflow-metrics-processes], type [_doc], id [WorkflowMetricsProcess054fadffff4241caa1d72ccbfc3206e14a8ed4dff007349a77d3fadbd8c1ea2c], message [[liferay-20116-workflow-metrics-processes] ElasticsearchException[Elasticsearch exception [type=index_not_found_exception, reason=no such index [liferay-20116-workflow-metrics-processes] and [action.auto_create_index] is [false]]]] [Sanitized] {} 2024-08-27 23:20:35.697 INFO [main][LoggingTimer:35] Completed com.liferay.portal.workflow.kaleo.designer.web.internal.upgrade.v1_0_1.KaleoDefinitionVersionUpgradeProcess#_upgradeKaleoDefinitionVersion in 22993 ms {upgrade.component=com.liferay.portal.workflow.kaleo.designer.web} - The error message indicates that certain indices related to workflow metrics (liferay-20116-workflow-metrics-instances, liferay-20116-workflow-metrics-sla-instance-results, liferay-20116-workflow-metrics-processes) were not found.
- While this error is not preventing the upgrade from completing, we would like to clarify whether it can be safely ignored.
- Can we proceed by restarting the environment with the new version and performing a complete reindexation of the portal, or are there specific actions required during the upgrade process?
Environment
- Upgrade from Liferay 7.0 to 2023.Q4
Resolution
- You can safely ignore this specific Elasticsearch error trace.
- The error trace you have detected is produced because the indices for the "Workflows Metrics" functionality
liferay-{companyId}-workflow-metrics-{name}do not exist in Elasticsearch during the upgrade process:- It's expected that these indices won't exist during the upgrade, as Elasticsearch hasn't been populated with Liferay data yet.
- All "Workflows Metrics" indices are created and populated during Liferay startup if they don't exist.
- Therefore, after startup, you simply need to verify that the indices have been created correctly and that the workflows metrics functionality is working (if the index doesn't exist, an error message will be displayed).
- Additionally, please note that a complete portal full reindex operation does not regenerate these indices, as they are considered "application indices".
- To reindex the "Workflow Metrics" indices, you need to:
- Go to the Applications menu => Workflows => Metrics
- In the upper left corner, click on the three vertical dots menu "⋮" => Settings
- Now in the Workflow Index Actions screen, click Reindex All for the Workflow Indexes entry.
- This would only be necessary if you find that the indices have not been regenerated correctly after startup.
If you still have issues: Restore your ElasticSearch installation and reindex
- Stop the server.
-
Remove all indexes generated by Liferay
curl -X DELETE "http(s)://<es-host>:<es-port>/liferayindexes-*"- Depending ES version, you might need to execute this first too in order to be allowed to use wildcard when deleting indexes:
curl -X PUT "http(s)://<es-host>:<es-port>/_cluster/settings" -H "Content-Type: application/json" -d '{ "transient": {"action.destructive_requires_name":false}}'
- Depending ES version, you might need to execute this first too in order to be allowed to use wildcard when deleting indexes:
- Start the server again (you will see some index errors).
- Perform a Full Reindex and every index should be created.
Conclusion
- You can ignore this indexing error during the upgrade.
- The "Workflows Metrics" indices will be generated on the first startup and populated with data from the Liferay database.
- It's possible to manually reindex these indices, but from the specific option in Workflows => Metrics, as they are not reindexed with a normal Liferay reindexation.