Briefly, this error occurs when you try to delete a machine learning model in Elasticsearch that is still being used by ingest processors. The model cannot be deleted because it’s currently in use. To resolve this issue, you can either stop the ingest processors that are using the model or reconfigure them to use a different model. After doing so, you should be able to delete the model without encountering this error.
This guide will help you check for common problems that cause the log ” Cannot delete model [{}] as it is still referenced by ingest processors ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, delete.
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 still referenced by ingest processors” class name is TransportDeleteTrainedModelAction.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :
String id = request.getId(); IngestMetadata currentIngestMetadata = state.metadata().custom(IngestMetadata.TYPE); SetreferencedModels = getReferencedModelKeys(currentIngestMetadata; ingestService); if (referencedModels.contains(id)) { listener.onFailure(new ElasticsearchStatusException("Cannot delete model [{}] as it is still referenced by ingest processors"; RestStatus.CONFLICT; id)); return; }
[ratemypost]