版本: 7.3-8.9
简而言之,当Elasticsearch尝试遍历一个不是数组或集合的对象时,会出现此错误。这通常发生在摄取管道(ingest pipeline)中使用"foreach"处理器时,而您试图遍历的字段不是数组。要解决此问题,您可以在使用"foreach"处理器之前确保该字段是数组或集合,或者可以在管道中添加条件检查,如果该字段不是数组则跳过"foreach"处理器。
日志上下文 #
日志"specified foreach object was not a an array/collection: [{}]“的类名是 ActionWrapper.java。 我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入了解的人参考:
}
}
} else if (object == null) {
throw new ElasticsearchException("specified foreach object was null: [{}]"; path);
} else {
throw new ElasticsearchException("specified foreach object was not a an array/collection: [{}]"; path);
} // check if we have mixed results; then set to partial failure
final Setstatuses = results.stream().map(Action.Result::status).collect(Collectors.toSet());
Action.Result.Status status;





