Failed to retrieve indices 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 fetch statistics for the indices due to issues like insufficient permissions, network connectivity problems, or the indices being unavailable. To resolve this, you can check the user permissions to ensure they have the right to access the indices stats. Also, verify the network connectivity between the Elasticsearch nodes. If the indices are unavailable, check their status and ensure they are active and healthy. If the problem persists, consider restarting the Elasticsearch service.

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

Log Context

Log “failed to retrieve indices 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 indices stats"; e);
                                } else {
                                    logger.warn("failed to retrieve indices stats"; e);
                                }
                                indicesStatsSummary = IndicesStatsSummary.EMPTY;
                            }
                        }; fetchRefs.acquire())
                    )

 

 [ratemypost]