我们正在使用Apache Flume将数据索引到Elasticsearch中。
最近我们正面临这个例外。
org.elasticsearch.common.jackson.core.JsonGenerationException: No current event to copy
at org.elasticsearch.common.jackson.core.JsonGenerator._reportError(JsonGenerator.java:1487)
at org.elasticsearch.common.jackson.core.JsonGenerator.copyCurrentStructure(JsonGenerator.java:1390)
at org.elasticsearch.common.xcontent.json.JsonXContentGenerator.copyCurrentStructure(JsonXContentGenerator.java:332)
at org.elasticsearch.common.xcontent.XContentBuilder.copyCurrentStructure(XContentBuilder.java:1105)
at org.apache.flume.sink.elasticsearch.ContentBuilderUtil.addComplexField(ContentBuilderUtil.java:63)
at org.apache.flume.sink.elasticsearch.ContentBuilderUtil.appendField(ContentBuilderUtil.java:47)
at org.jai.flume.sinks.elasticsearch.serializer.ElasticSearchJsonBodyEventSerializer.appendHeaders(ElasticSearchJsonBodyEventSerializer.java:48)
at org.jai.flume.sinks.elasticsearch.serializer.ElasticSearchJsonBodyEventSerializer.getContentBuilder(ElasticSearchJsonBodyEventSerializer.java:35)
at org.apache.flume.sink.elasticsearch.client.ElasticSearchTransportClient.addEvent(ElasticSearchTransportClient.java:164)
at org.css.cssElasticsearchSink.process(cssElasticsearchSink.java:121)
at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68)
at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147)
at java.lang.Thread.run(Thread.java:745)
2015-10-15 12:32:36,402 ERROR org.apache.flume.SinkRunner: Unable to deliver event. Exception follows.
org.apache.flume.EventDeliveryException: Failed to commit transaction. Transaction rolled back.
at org.css.cssElasticsearchSink.process(cssElasticsearchSink.java:166)
at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68)
at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.elasticsearch.common.jackson.core.JsonGenerationException: No current event to copy
at org.elasticsearch.common.jackson.core.JsonGenerator._reportError(JsonGenerator.java:1487)
at org.elasticsearch.common.jackson.core.JsonGenerator.copyCurrentStructure(JsonGenerator.java:1390)
at org.elasticsearch.common.xcontent.json.JsonXContentGenerator.copyCurrentStructure(JsonXContentGenerator.java:332)
at org.elasticsearch.common.xcontent.XContentBuilder.copyCurrentStructure(XContentBuilder.java:1105)
at org.apache.flume.sink.elasticsearch.ContentBuilderUtil.addComplexField(ContentBuilderUtil.java:63)
at org.apache.flume.sink.elasticsearch.ContentBuilderUtil.appendField(ContentBuilderUtil.java:47)
at org.jai.flume.sinks.elasticsearch.serializer.ElasticSearchJsonBodyEventSerializer.appendHeaders(ElasticSearchJsonBodyEventSerializer.java:48)
at org.jai.flume.sinks.elasticsearch.serializer.ElasticSearchJsonBodyEventSerializer.getContentBuilder(ElasticSearchJsonBodyEventSerializer.java:35)
at org.apache.flume.sink.elasticsearch.client.ElasticSearchTransportClient.addEvent(ElasticSearchTransportClient.java:164)
at org.css.cssElasticsearchSink.process(cssElasticsearchSink.java:121)
此异常的原因是什么?它是一个格式错误的JSON对象吗?
Flume版本:1.5.0-cdh5.3.2
Elasticsearch版本:“1.5.2”