Logstash 7.1.0 crashes occasionally (xml plugin) but v. 6.3.1 works fine

HI guys,

I've two instances of ELK stack grepping the same log files containing XML payloads.
Flow is : input-plugin-file -> filter-plugin-grok -> filter-plugin-xml.
Log lines from files are parsed using grok and one of extracted field is parsed by xml plugin.
For old instance (ver. 6.3.1 of Elastisearch/Logstash/Kibana) - everything works fine.
New instance (ver. 7.1.0 of Elastisearch/Logstash/Kibana) - Logstash crashes occasionally with error like below:
Any ideas why ?
Thanks in advance !

[2019-08-09T10:37:57,360][ERROR][org.logstash.execution.WorkerLoop] Exception in pipelineworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash.
org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
	at org.apache.xerces.dom.CoreDocumentImpl.checkQName(Unknown Source) ~[xercesImpl.jar:?]
	at org.apache.xerces.dom.AttrNSImpl.setName(Unknown Source) ~[xercesImpl.jar:?]
	at org.apache.xerces.dom.AttrNSImpl.rename(Unknown Source) ~[xercesImpl.jar:?]
	at org.apache.xerces.dom.CoreDocumentImpl.renameNode(Unknown Source) ~[xercesImpl.jar:?]
	at nokogiri.internals.NokogiriHelpers.renameNode(NokogiriHelpers.java:792) ~[nokogiri.jar:?]
	at nokogiri.XmlDocument.removeNamespceRecursively(XmlDocument.java:374) ~[nokogiri.jar:?]
	at nokogiri.XmlDocument.removeNamespceRecursively(XmlDocument.java:381) ~[nokogiri.jar:?]
	at nokogiri.XmlDocument.removeNamespceRecursively(XmlDocument.java:381) ~[nokogiri.jar:?]
	at nokogiri.XmlDocument.removeNamespceRecursively(XmlDocument.java:381) ~[nokogiri.jar:?]
	at nokogiri.XmlDocument.removeNamespceRecursively(XmlDocument.java:381) ~[nokogiri.jar:?]
	at nokogiri.XmlDocument.removeNamespceRecursively(XmlDocument.java:381) ~[nokogiri.jar:?]
	at nokogiri.XmlDocument.remove_namespaces(XmlDocument.java:356) ~[nokogiri.jar:?]
	at apps.elk.logstash_minus_7_dot_1_dot_0.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_filter_minus_xml_minus_4_dot_0_dot_7.lib.logstash.filters.xml.RUBY$method$filter$0(/apps/elk/logstash-7.1.0/vendor/bundle/jruby/2.5.0/gems/logstash-filter-xml-4.0.7/lib/logstash/filters/xml.rb:150) ~[?:?]
	at apps.elk.logstash_minus_7_dot_1_dot_0.logstash_minus_core.lib.logstash.filters.base.RUBY$method$do_filter$0(/apps/elk/logstash-7.1.0/logstash-core/lib/logstash/filters/base.rb:143) ~[?:?]
	at apps.elk.logstash_minus_7_dot_1_dot_0.logstash_minus_core.lib.logstash.filters.base.RUBY$block$multi_filter$1(/apps/elk/logstash-7.1.0/logstash-core/lib/logstash/filters/base.rb:162) ~[?:?]
	at org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:146) ~[jruby-complete-9.2.7.0.jar:?]
	at org.jruby.runtime.BlockBody.yield(BlockBody.java:114) ~[jruby-complete-9.2.7.0.jar:?]
	at org.jruby.runtime.Block.yield(Block.java:165) ~[jruby-complete-9.2.7.0.jar:?]
	at org.jruby.RubyArray.each(RubyArray.java:1792) ~[jruby-complete-9.2.7.0.jar:?]
	at apps.elk.logstash_minus_7_dot_1_dot_0.logstash_minus_core.lib.logstash.filters.base.RUBY$method$multi_filter$0(/apps/elk/logstash-7.1.0/logstash-core/lib/logstash/filters/base.rb:159) ~[?:?]
	at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117) ~[jruby-complete-9.2.7.0.jar:?]
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156) ~[jruby-complete-9.2.7.0.jar:?]
	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200) ~[jruby-complete-9.2.7.0.jar:?]
	at org.logstash.config.ir.compiler.FilterDelegatorExt.doMultiFilter(FilterDelegatorExt.java:99) ~[logstash-core.jar:?]
	at org.logstash.config.ir.compiler.AbstractFilterDelegatorExt.multiFilter(AbstractFilterDelegatorExt.java:115) ~[logstash-core.jar:?]
	at org.logstash.generated.CompiledDataset12.compute(Unknown Source) ~[?:?]
	at org.logstash.generated.CompiledDataset13.compute(Unknown Source) ~[?:?]
	at org.logstash.generated.CompiledDataset14.compute(Unknown Source) ~[?:?]
	at org.logstash.generated.CompiledDataset15.compute(Unknown Source) ~[?:?]
	at org.logstash.generated.CompiledDataset16.compute(Unknown Source) ~[?:?]
	at org.logstash.execution.WorkerLoop.run(WorkerLoop.java:64) [logstash-core.jar:?]
	at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]
	at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:440) [jruby-complete-9.2.7.0.jar:?]
	at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:304) [jruby-complete-9.2.7.0.jar:?]
	at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:36) [jruby-complete-9.2.7.0.jar:?]
	at apps.elk.logstash_minus_7_dot_1_dot_0.logstash_minus_core.lib.logstash.java_pipeline.RUBY$block$start_workers$2(/apps/elk/logstash-7.1.0/logstash-core/lib/logstash/java_pipeline.rb:235) [jruby-complete-9.2.7.0.jar:?]
	at org.jruby.runtime.CompiledIRBlockBody.callDirect(CompiledIRBlockBody.java:136) [jruby-complete-9.2.7.0.jar:?]
	at org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:77) [jruby-complete-9.2.7.0.jar:?]
	at org.jruby.runtime.Block.call(Block.java:124) [jruby-complete-9.2.7.0.jar:?]
	at org.jruby.RubyProc.call(RubyProc.java:295) [jruby-complete-9.2.7.0.jar:?]
	at org.jruby.RubyProc.call(RubyProc.java:274) [jruby-complete-9.2.7.0.jar:?]
	at org.jruby.RubyProc.call(RubyProc.java:270) [jruby-complete-9.2.7.0.jar:?]
	at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:105) [jruby-complete-9.2.7.0.jar:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_211]
[2019-08-09T10:37:57,497][FATAL][logstash.runner          ] An unexpected error occurred! {:error=>java.lang.IllegalStateException: org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified., :backtrace=>["org.logstash.execution.WorkerLoop.run(org/logstash/execution/WorkerLoop.java:85)", "java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)", "org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:440)", "org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:304)", "apps.elk.logstash_minus_7_dot_1_dot_0.logstash_minus_core.lib.logstash.java_pipeline.start_workers(/apps/elk/logstash-7.1.0/logstash-core/lib/logstash/java_pipeline.rb:235)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:295)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:274)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:270)", "java.lang.Thread.run(java/lang/Thread.java:748)"]}

In Logstash v. 6.3.1 logstash-filer-xml default is v.4.0.5
In Logstash v. 7.1.0 logstash-filer-xml default is v.4.0.7

So trying to use logstash-filer-xml v.4.0.5 in my current Logstash v. 7.1.0.
Will let you know of results soon.

Do the crashes go away if you add

pipeline.java_execution: false

to logstash.yml? If I remember correctly there is a known issue (that I cannot find) around some exceptions in filters not being handled correctly in the java execution engine, so that logstash crashes instead of restarting the pipeline.

1 Like

I'll try. Many thanks for your help Badger !

Ged

Unfortunately logstash (filter-plugin-xml v. 4.0.7) crashes even with:

pipeline.java_execution: false

I think i'll try revert to plugin version v. 4.0.5 again

[2019-08-27T02:16:13,007][FATAL][logstash.runner          ] An unexpected error occurred! {:error=>org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified., :backtrace=>["org.apache.xerces.dom.CoreDocumentImpl.checkQName(Unknown Source)", "org.apache.xerces.dom.AttrNSImpl.setName(Unknown Source)", "org.apache.xerces.dom.AttrNSImpl.rename(Unknown Source)", "org.apache.xerces.dom.CoreDocumentImpl.renameNode(Unknown Source)", "nokogiri.internals.NokogiriHelpers.renameNode(NokogiriHelpers.java:792)", "nokogiri.XmlDocument.removeNamespceRecursively(XmlDocument.java:374)", "nokogiri.XmlDocument.removeNamespceRecursively(XmlDocument.java:381)", "nokogiri.XmlDocument.removeNamespceRecursively(XmlDocument.java:381)", "nokogiri.XmlDocument.removeNamespceRecursively(XmlDocument.java:381)", "nokogiri.XmlDocument.removeNamespceRecursively(XmlDocument.java:381)", "nokogiri.XmlDocument.remove_namespaces(XmlDocument.java:356)", "apps.elk.logstash_minus_7_dot_1_dot_0.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_filter_minus_xml_minus_4_dot_0_dot_7.lib.logstash.filters.xml.RUBY$method$filter$0(/apps/elk/logstash-7.1.0/vendor/bundle/jruby/2.5.0/gems/logstash-filter-xml-4.0.7/lib/logstash/filters/xml.rb:150)", "org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)", "org.jruby.ir.targets.InvokeSite.fail(InvokeSite.java:253)", "apps.elk.logstash_minus_7_dot_1_dot_0.logstash_minus_core.lib.logstash.filters.base.RUBY$method$do_filter$0(/apps/elk/logstash-7.1.0/logstash-core/lib/logstash/filters/base.rb:143)", "org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)", "org.jruby.ir.targets.InvokeSite.fail(InvokeSite.java:253)", "apps.elk.logstash_minus_7_dot_1_dot_0.logstash_minus_core.lib.logstash.filters.base.RUBY$block$multi_filter$1(/apps/elk/logstash-7.1.0/logstash-core/lib/logstash/filters/base.rb:162)", "org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:146)", "org.jruby.runtime.BlockBody.yield(BlockBody.java:114)", "org.jruby.runtime.Block.yield(Block.java:165)", "org.jruby.RubyArray.each(RubyArray.java:1792)", "apps.elk.logstash_minus_7_dot_1_dot_0.logstash_minus_core.lib.logstash.filters.base.RUBY$method$multi_filter$0(/apps/elk/logstash-7.1.0/logstash-core/lib/logstash/filters/base.rb:159)", "org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)", "org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)", "org.logstash.config.ir.compiler.FilterDelegatorExt.doMultiFilter(FilterDelegatorExt.java:99)", "org.logstash.config.ir.compiler.AbstractFilterDelegatorExt.multiFilter(AbstractFilterDelegatorExt.java:115)", "org.logstash.config.ir.compiler.AbstractFilterDelegatorExt$INVOKER$i$1$0$multiFilter.call(AbstractFilterDelegatorExt$INVOKER$i$1$0$multiFilter.gen)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:317)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)", "org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)", "org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)", "org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:187)", "org.jruby.runtime.BlockBody.yield(BlockBody.java:116)", "org.jruby.runtime.Block.yield(Block.java:165)", "org.jruby.RubyArray.each(RubyArray.java:1792)", "org.jruby.RubyArray$INVOKER$i$0$0$each.call(RubyArray$INVOKER$i$0$0$each.gen)", "org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:555)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:80)", "org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:89)", "org.jruby.ir.instructions.CallBase.interpret(CallBase.java:537)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)", "org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)", "org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:79)", "org.jruby.runtime.Block.call(Block.java:124)", "org.jruby.RubyProc.call(RubyProc.java:295)", "org.jruby.RubyProc.call(RubyProc.java:274)", "org.jruby.RubyProc.call(RubyProc.java:266)", "org.jruby.RubyProc$INVOKER$i$0$0$call.call(RubyProc$INVOKER$i$0$0$call.gen)", "org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:204)", "org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:317)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)", "org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)", "org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:79)", "org.jruby.runtime.Block.call(Block.java:124)", "org.jruby.RubyProc.call(RubyProc.java:295)", "org.jruby.internal.runtime.methods.ProcMethod.call(ProcMethod.java:64)", "org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:204)", "org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)", "apps.elk.logstash_minus_7_dot_1_dot_0.logstash_minus_core.lib.logstash.pipeline.RUBY$method$filter_batch$0(/apps/elk/logstash-7.1.0/logstash-core/lib/logstash/pipeline.rb:358)", "apps.elk.logstash_minus_7_dot_1_dot_0.logstash_minus_core.lib.logstash.pipeline.RUBY$method$worker_loop$0(/apps/elk/logstash-7.1.0/logstash-core/lib/logstash/pipeline.rb:337)", "apps.elk.logstash_minus_7_dot_1_dot_0.logstash_minus_core.lib.logstash.pipeline.RUBY$block$start_workers$2(/apps/elk/logstash-7.1.0/logstash-core/lib/logstash/pipeline.rb:304)", "org.jruby.runtime.CompiledIRBlockBody.callDirect(CompiledIRBlockBody.java:136)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:77)", "org.jruby.runtime.Block.call(Block.java:124)", "org.jruby.RubyProc.call(RubyProc.java:295)", "org.jruby.RubyProc.call(RubyProc.java:274)", "org.jruby.RubyProc.call(RubyProc.java:270)", "org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:105)", "java.lang.Thread.run(Thread.java:748)"]}
[2019-08-27T02:16:13,714][ERROR][org.logstash.Logstash    ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.