Failed to retrieve node stats – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.12-8.9

Briefly, this error occurs when Elasticsearch is unable to gather statistics about the nodes in the cluster. This could be due to network issues, insufficient permissions, or problems with the nodes themselves. To resolve this issue, you can check the network connectivity between the nodes, ensure that the user has the necessary permissions to retrieve node stats, and verify the health of the nodes. If a node is down or unresponsive, you may need to restart it or check its logs for any issues.

This guide will help you check for common problems that cause the log ” failed to retrieve node stats ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: cluster, node.

Log Context

Log “failed to retrieve node stats” classname is InternalClusterInfoService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                @Override
                public void onFailure(Exception e) {
                    if (e instanceof ClusterBlockException) {
                        logger.trace("failed to retrieve node stats"; e);
                    } else {
                        logger.warn("failed to retrieve node stats"; e);
                    }
                    leastAvailableSpaceUsages = Map.of();
                    mostAvailableSpaceUsages = Map.of();
                }
            }; fetchRefs.acquire()));

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?