Invalid month day value expected a string or a number value but found – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-8.9

Briefly, this error occurs when Elasticsearch encounters an invalid date format, specifically an incorrect day of the month. This could be due to a wrong data type or an out-of-range value. To resolve this, ensure that the date format in your data matches the format expected by Elasticsearch. Also, check that the day value is within the valid range of 1-31. If you’re using a script or application to input data, verify that it’s correctly formatting the date values.

This guide will help you check for common problems that cause the log ” invalid month day value. expected a string or a number value; but found [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “invalid month day value. expected a string or a number value; but found [{}]” class name is MonthTimes.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 }
 }
 if (token == XContentParser.Token.VALUE_NUMBER) {
 return parser.intValue();
 }
 throw new ElasticsearchParseException("invalid month day value. expected a string or a number value; but found [{}]"; token);
 }  public static class Builder {  private final Set days = new HashSet<>();

 

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?