版本: 6.8-7.15
简要来说,当 Elasticsearch 无法解析计划表达式时会发生此错误,因为它期望一个数值或时间字符串,但收到了不同格式的内容。这通常发生在 Elasticsearch 中设置 cron 作业或计划任务时。要解决此问题,请确保计划格式正确。如果是 cron 作业,它应该是由空格分隔的五个字段的字符串。如果是简单的时间间隔,它应该是一个数值后跟时间单位,例如 “10m” 表示 10 分钟。
日志上下文 #
日志 “could not parse [{}] schedule. expected either a numeric value” 的类名是 IntervalSchedule.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入背景的人参考:
return new IntervalSchedule(Interval.parse(value));
}
} catch (Exception e) {
throw new ElasticsearchParseException("could not parse schedule: {}", e, e.getMessage());
}
throw new ElasticsearchParseException("could not parse [{}] schedule. expected either a numeric value " +
"(millis) or a string value representing time value (e.g. '5s'), but found [{}]", TYPE, token);
}





