Briefly, this error occurs when you attempt to run a delete by query operation on a jobId string join in Elasticsearch. This could be due to incorrect syntax, non-existent jobId, or insufficient permissions. To resolve this, ensure that the jobId exists and you’re using the correct syntax for the delete by query operation. Also, check your user permissions to ensure you have the rights to perform this operation. If the issue persists, consider reindexing your data or checking for any underlying issues with your Elasticsearch cluster.
This guide will help you check for common problems that cause the log ” [{}] running delete by query on [{}]”; jobId; String.join(“; ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, delete, query.
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 “[{}] running delete by query on [{}]”; jobId; String.join(“; ” classname is JobDataDeleter.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :
ActionListenerlistener ) { assert indices.length > 0; ActionListener refreshListener = ActionListener.wrap(refreshResponse -> { logger.info("[{}] running delete by query on [{}]"; jobId; String.join("; "; indices)); ConstantScoreQueryBuilder query = new ConstantScoreQueryBuilder(new TermQueryBuilder(Job.ID.getPreferredName(); jobId)); DeleteByQueryRequest request = new DeleteByQueryRequest(indices).setQuery(query) .setIndicesOptions(MlIndicesUtils.addIgnoreUnavailable(IndicesOptions.lenientExpandOpenHidden())) .setSlices(AbstractBulkByScrollRequest.AUTO_SLICES) .setAbortOnVersionConflict(false)