本文主要是介绍ES elasticsearch 异常报错:Invalid UTF-8 middle byte,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
ES elasticsearch 异常报错:Invalid UTF-8 middle byte
报错
Invalid UTF-8 middle byte 0x74\n at
[Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@714a2900; line: 1, column: 4]
{"error": {"root_cause": [{"type": "mapper_parsing_exception","reason": "failed to parse [content]"}],"type": "mapper_parsing_exception","reason": "failed to parse [content]","caused_by": {"type": "json_parse_exception","reason": "Invalid UTF-8 middle byte 0xc0\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@3807cda; line: 1, column: 4]"}},"status": 400
}
问题
文件的字符集不是UTF-8的格式
解决
把这个文件用记事本打开,
【另存为】,
选择【字符集】为UTF-8,
保存后,把后缀修改为需要的后缀。
万事大吉
这篇关于ES elasticsearch 异常报错:Invalid UTF-8 middle byte的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!