Byte-sized index setting with value is missing units assuming default units b but in future versions this will be a hard error – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 2-2

Briefly, this error occurs when the Elasticsearch index setting for byte size is missing a unit of measurement. Elasticsearch assumes the default unit as bytes (b), but future versions will not allow this ambiguity. To resolve this, specify the unit when setting the byte size, such as “10mb” for 10 megabytes or “5gb” for 5 gigabytes. This will ensure clarity and prevent future errors.

This guide will help you check for common problems that cause the log ” byte-sized index setting [{}] with value [{}] is missing units; assuming default units (b) but in future versions this will be a hard error ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: cluster, index, metadata and upgrade.

Log Context

Log “byte-sized index setting [{}] with value [{}] is missing units; assuming default units (b) but in future versions this will be a hard error” classname is MetaDataIndexUpgradeService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                         Long.parseLong(value);
                    } catch (NumberFormatException nfe) {
                        continue;
                    }
                    // It's a naked number that previously would be interpreted as default unit (bytes); now we add it:
                    logger.warn("byte-sized index setting [{}] with value [{}] is missing units; assuming default units (b) but in future versions this will be a hard error"; byteSizeSetting; value);
                    if (newSettings == null) {
                        newSettings = Settings.builder();
                        newSettings.put(settings);
                    }
                    newSettings.put(byteSizeSetting; value + "b");




 

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?