Will not persist model state – setting was set – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-7.11

Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.

Try OpsGPT now for step-by-step guidance and tailored insights into your Elasticsearch operation.

Briefly, this error occurs when the Elasticsearch model state setting is set to not persist. This means that the model state will not be saved, which can lead to data loss or inconsistencies. To resolve this issue, you can change the setting to allow model state persistence. This can be done by updating the Elasticsearch configuration file or using the Elasticsearch API to update the setting. Additionally, ensure that the Elasticsearch cluster has sufficient storage space to persist the model state.

For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.

This guide will help you check for common problems that cause the log ” [{}] Will not persist model state – {} setting was set ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “[{}] Will not persist model state – {} setting was set” classname is AutodetectBuilder.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

        logger.debug("[{}] Periodic operations staggered by {} seconds"; job.getId(); intervalStagger);

        // Supply a URL for persisting/restoring model state unless model
        // persistence has been explicitly disabled.
        if (DONT_PERSIST_MODEL_STATE_SETTING.get(settings)) {
            logger.info("[{}] Will not persist model state - {} setting was set"; job.getId(); DONT_PERSIST_MODEL_STATE_SETTING);
        } else {
            // Persist model state every few hours even if the job isn't closed
            long persistInterval = (job.getBackgroundPersistInterval() == null) ?
                    (DEFAULT_BASE_PERSIST_INTERVAL + intervalStagger) :


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?