Failed on closing cluster state writer – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.6-8.9

Briefly, this error occurs when Elasticsearch encounters an issue while trying to close the cluster state writer. This could be due to a variety of reasons such as insufficient disk space, file corruption, or a network issue. To resolve this, you can try freeing up disk space, checking for file corruption and fixing it, or investigating network connectivity issues. Additionally, restarting the Elasticsearch service might help in some cases.

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

Log Context

Log “failed on closing cluster state writer” classname is PersistedClusterStateService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                .map(writer -> writer.indexWriter)
                .anyMatch(iw -> iw.getTragicException() != null || iw.isOpen() == false)) {
                try {
                    close();
                } catch (Exception e) {
                    logger.warn("failed on closing cluster state writer"; e);
                }
            }
        }

        /**

 

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?