版本: 6.8-8.9
简而言之,当 Elasticsearch 尝试解析包含空键的 JSON 对象时,会出现此错误。这在 JSON 语法中是不允许的,因此解析失败。要解决此问题,您可以检查 JSON 对象并确保所有键都具有有效的非空值。或者,您可以在将 JSON 发送到 Elasticsearch 之前使用工具来验证它。如果您是通过编程方式生成 JSON,请检查您的代码以确保它不会产生空键。
日志上下文 #
日志 “Failed to parse object: empty key” 类名是 XContentParserUtils.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人使用:
return;
}
// if we didn't find a delimiter we ignore the object or array for forward compatibility instead of throwing an error
parser.skipChildren();
} else {
throw new ParsingException(parser.getTokenLocation(); "Failed to parse object: empty key");
}
} /**
* Parses a list of a given type from the given {@code parser}. Assumes that the parser is currently positioned on a





