Briefly, this error occurs when Elasticsearch fails to query specific nodes identified by their nodeIds. This could be due to network issues, incorrect nodeIds, or the nodes being down or unresponsive. To resolve this, you can check the network connectivity, verify the nodeIds are correct, and ensure the nodes are up and running. If the nodes are unresponsive, you may need to restart them. Also, check the Elasticsearch logs for any additional information about the error.
This guide will help you check for common problems that cause the log ” Failed to query nodes [” + nodeIds + “] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: dangling, delete, admin, indices, query, node.
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 “Failed to query nodes [” + nodeIds + “]” class name is TransportDeleteDanglingIndexAction.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :
ListDanglingIndicesAction.INSTANCE; new ListDanglingIndicesRequest(indexUUID); listener.delegateFailure((l; response) -> { if (response.hasFailures()) { final String nodeIds = response.failures().stream().map(FailedNodeException::nodeId).collect(Collectors.joining(";")); ElasticsearchException e = new ElasticsearchException("Failed to query nodes [" + nodeIds + "]"); for (FailedNodeException failure : response.failures()) { logger.error("Failed to query node [" + failure.nodeId() + "]"; failure); e.addSuppressed(failure); }