You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AbstractElasticsearchPublisher is implemented in so shitty way that internals of JsonGenerator is stuck in broken state and can't heal.
JsonGenerator uses WriterBasedJsonGenerator and on
private void serializeIndexString(JsonGenerator gen, T event) throws IOException {
gen.writeStartObject();
writeStartObject() fail on internal check _verifyValueWrite("start an object"); as we are JsonWriteContext is at type == 2 and gotName == false so check fails:
public int writeValue() {
// Most likely, object:
if (_type == TYPE_OBJECT) {
if (!_gotName) {
return STATUS_EXPECT_NAME;
In case of serialization errors JsonGenerator should be completely reinitialized or reset instead of reusing with broken intermediate state.
Following stacktrace is from a bit edited sources, ClassicElasticsearchPublisher is in original form:
java.lang.NullPointerException: null
at com.internetitem.logback.elasticsearch.ClassicElasticsearchPublisher.serializeCommonFields(ClassicElasticsearchPublisher.java:37)
at com.internetitem.logback.elasticsearch.ClassicElasticsearchPublisher.serializeCommonFields(ClassicElasticsearchPublisher.java:17)
at com.internetitem.logback.elasticsearch.AbstractElasticsearchPublisher.serializeEvent(AbstractElasticsearchPublisher.java:211)
at com.internetitem.logback.elasticsearch.AbstractElasticsearchPublisher.serializeEvents(AbstractElasticsearchPublisher.java:190)
at com.internetitem.logback.elasticsearch.AbstractElasticsearchPublisher.run(AbstractElasticsearchPublisher.java:154)
at java.base/java.lang.Thread.run(Thread.java:834)
The text was updated successfully, but these errors were encountered:
Just do:
and forget about delivering messages to ES until you reboot app ))
The problem is in:
formattedMessage.length()
generates NPE.AbstractElasticsearchPublisher
is implemented in so shitty way that internals ofJsonGenerator
is stuck in broken state and can't heal.JsonGenerator
usesWriterBasedJsonGenerator
and onwriteStartObject()
fail on internal check_verifyValueWrite("start an object");
as we areJsonWriteContext
is at type == 2 and gotName == false so check fails:In case of serialization errors
JsonGenerator
should be completely reinitialized or reset instead of reusing with broken intermediate state.Following stacktrace is from a bit edited sources,
ClassicElasticsearchPublisher
is in original form:The text was updated successfully, but these errors were encountered: