Failed to set for index maximum value is neither nor a number – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 2.3-2.3

Briefly, this error occurs when Elasticsearch tries to set a value for an index that is not a number or null. This could be due to incorrect data types or invalid values in the configuration. To resolve this issue, you can check the value you’re trying to set and ensure it’s a valid number or null. If it’s a configuration file, ensure the syntax is correct. Also, check if the field you’re trying to set is actually designed to accept the value you’re providing.

This guide will help you check for common problems that cause the log ” failed to set [{}] for index [{}]; maximum value is neither [{}] nor a number [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: cluster, index, metadata and settings.

Log Context

Log “failed to set [{}] for index [{}]; maximum value is neither [{}] nor a number [{}]” classname is MetaDataUpdateSettingsService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

max = dataNodeCount - 1;
                    } else {
                        try {
                            max = Integer.parseInt(sMax);
                        } catch (NumberFormatException e) {
                            logger.warn("failed to set [{}] for index [{}]; maximum value is neither [{}] nor a number [{}]";
                                    e; IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS; indexMetaData.getIndex(); ALL_NODES_VALUE; sMax);
                            continue;
                        }
                    }

 

 [ratemypost]

Opster
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.