Can t apply illegal value using instead use one of – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 2.3-2.3

Briefly, this error occurs when an invalid value is being used in an Elasticsearch operation. Elasticsearch has certain predefined acceptable values for its operations. If a value outside this range is used, it throws this error. To resolve this issue, you should check the Elasticsearch documentation for the correct values that can be used for the operation you are trying to perform. Ensure that the values you are using are within the acceptable range. Also, check your code for any typos or syntax errors that might be causing the problem.

This guide will help you check for common problems that cause the log ” Can’t apply {} illegal value: {} using {} instead; use one of: {} ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index and shard.

Log Context

Log “Can’t apply {} illegal value: {} using {} instead; use one of: {}” classname is IndexShard.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

     private static Translog.Durabilty getFromSettings(ESLogger logger; Settings settings; Translog.Durabilty defaultValue) {
        final String value = settings.get(TranslogConfig.INDEX_TRANSLOG_DURABILITY; defaultValue.name());
        try {
            return Translog.Durabilty.valueOf(value.toUpperCase(Locale.ROOT));
        } catch (IllegalArgumentException ex) {
            logger.warn("Can't apply {} illegal value: {} using {} instead; use one of: {}"; TranslogConfig.INDEX_TRANSLOG_DURABILITY;
                    value; defaultValue; Arrays.toString(Translog.Durabilty.values()));
            return defaultValue;
        }
    }
}




 

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?