Briefly, this error occurs when you attempt to delete a machine learning model in Elasticsearch that is currently in use or deployed. The system prevents deletion to avoid disrupting ongoing processes. To resolve this issue, you can either wait until the model is no longer in use or manually undeploy the model. After ensuring the model is not in use, you can proceed with the deletion. Always ensure to check the deployment status of a model before attempting to delete it.
This guide will help you check for common problems that cause the log ” Cannot delete model [{}] as it is currently deployed ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: delete, plugin.
Overview
DELETE is an Elasticsearch API which removes a document from a specific index. This API requires an index name and _id document to delete the document.
Delete a document
DELETE /my_index/_doc/1
Notes
- A delete request throws 404 error code if the document does not already exist in the index.
- If you want to delete a set of documents that matches a query, you need to use delete by query API.
Log Context
Log “Cannot delete model [{}] as it is currently deployed” class name is TransportDeleteTrainedModelAction.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :
return; } } if (TrainedModelAllocationMetadata.fromState(state).isAllocated(request.getId())) { listener.onFailure( new ElasticsearchStatusException("Cannot delete model [{}] as it is currently deployed"; RestStatus.CONFLICT; id) ); return; } ActionListenernameDeletionListener = ActionListener.wrap(
[ratemypost]