Property value on field ” + n + ” must be a number or a string; but got ” + o + ” – How to solve this Elasticsearch error

Opster Team

March-22, Version: 1.7-8.0

Before you begin reading this guide, we recommend you try running the Elasticsearch Error Check-Up which analyzes 2 JSON files to detect many configuration errors.

To easily locate the root cause and resolve this issue try AutoOps for Elasticsearch & OpenSearch. It diagnoses problems by analyzing hundreds of metrics collected by a lightweight agent and offers guidance for resolving them.

Take a self-guided product tour to see for yourself (no registration required).

This guide will help you check for common problems that cause the log ” Property value on field ” + n + ” must be a number or a string; but got ” + o + ” ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “Property [value] on field [” + n + “] must be a number or a string; but got [” + o + “]”classname  is ConstantKeywordFieldMapper.java We extracted the following from Elasticsearch source code for those seeking an in-depth context :

// This is defined as updateable because it can be updated once; from [null] to any value;
 // by a dynamic mapping update. Once it has been set; however; the value cannot be changed.
 private final Parameter value = new Parameter<>("value"; true; () -> null; (n; c; o) -> {
 if (o instanceof Number == false && o instanceof CharSequence == false) {
 throw new MapperParsingException("Property [value] on field [" + n + "] must be a number or a string; but got [" + o + "]");
 }
 return o.toString();
 }; m -> toType(m).fieldType().value; XContentBuilder::field; Objects::toString);
 private final Parameter> meta = Parameter.metaParam();

 

Watch product tour

Try AutoOps to find & fix Elasticsearch problems

Analyze Your Cluster
Skip to content