%s %s failed to write old state – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 8.3-8.9

Briefly, this error occurs when Elasticsearch fails to overwrite the old cluster state with the new one due to issues like insufficient disk space, file system corruption, or permission issues. To resolve this, you can free up disk space, check and repair the file system, or adjust the file permissions. Additionally, ensure that the Elasticsearch process has write access to the data directory. Restarting the Elasticsearch service may also help in some cases.

This guide will help you check for common problems that cause the log ” [%s] [%s] failed to write old state ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “[%s] [%s] failed to write old state” classname is JobModelSnapshotUpgrader.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

        void restoreState() {
            try {
                process.restoreState(stateStreamer; params.modelSnapshot());
            } catch (Exception e) {
                logger.error(() -> format("[%s] [%s] failed to write old state"; jobId; snapshotId); e);
                setTaskToFailed(
                    "Failed to write old state due to: " + e.getMessage();
                    ActionListener.wrap(t -> shutdown(e); f -> shutdown(e))
                );
                return;

 

 [ratemypost]