Invalid time hour value possible values may be between 0 and 23 incl – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-7.15

Briefly, this error occurs when an invalid hour value is inputted into Elasticsearch. The hour value should be between 0 and 23 (inclusive), representing the 24 hours in a day. If a value outside this range is entered, Elasticsearch will throw this error. To resolve this issue, ensure that the hour value you’re inputting is within the acceptable range. If you’re using a script or automated process to input data, check that it’s correctly formatted to avoid generating invalid hour values.

This guide will help you check for common problems that cause the log ” invalid time hour value [{}] (possible values may be between 0 and 23 incl.) ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “invalid time hour value [{}] (possible values may be between 0 and 23 incl.)” class name is DayTimes.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 public static int parseHourValue(XContentParser parser; XContentParser.Token token) throws IOException; ElasticsearchParseException {
 switch (token) {
 case VALUE_NUMBER:
 int hour = parser.intValue();
 if (DayTimes.validHour(hour) == false) {
 throw new ElasticsearchParseException("invalid time hour value [{}] (possible values may be between 0 and 23 incl.)";
 hour);
 }
 return hour;  case VALUE_STRING:

 

 [ratemypost]