Briefly, this error occurs when Elasticsearch is unable to communicate with a specific node in the cluster, identified by the nodeId. This could be due to network issues, the node being down, or the node being overloaded. To resolve this issue, you can check the status of the node and ensure it’s running properly. If it’s overloaded, consider adding more nodes to your cluster or optimizing your queries. If it’s a network issue, check your network configuration and connectivity.
This guide will help you check for common problems that cause the log ” Failed to query node [” + failure.nodeId() + “] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: dangling, delete, query, admin, indices, 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 node [” + failure.nodeId() + “]” classname is TransportDeleteDanglingIndexAction.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :
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); } l.onFailure(e); return;