elastic / logstash

Logstash - transport and process your logs, events, or other data
https://www.elastic.co/products/logstash
Other
68 stars 3.5k forks source link

NamespacedMetricExt cannot be cast to NullMetricExt #10004

Open duylong opened 6 years ago

duylong commented 6 years ago

Hi,

I'm trying to upgrade from 6.3.2 to 6.4.1 and I have a error:

[2018-09-19T11:17:35,465][ERROR][logstash.agent           ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:forward, :exception=>"Java::JavaLang::ClassCastException", :message=>"org.logstash.instrument.metrics.NamespacedMetricExt cannot be cast to org.logstash.instrument.metrics.NullMetricExt", :backtrace=>["org.logstash.instrument.metrics.NullNamespacedMetricExt.initialize(NullNamespacedMetricExt.java:40)", "org.logstash.instrument.metrics.NullNamespacedMetricExt$INVOKER$i$0$2$initialize.call(NullNamespacedMetricExt$INVOKER$i$0$2$initialize.gen)", "org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:725)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:368)", "org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:205)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:209)", "org.jruby.RubyClass.newInstance(RubyClass.java:1008)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)", "org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:358)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:195)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:323)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)", "org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:77)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)", "org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:339)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)", "org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:77)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)", "org.jruby.RubyClass.newInstance(RubyClass.java:1022)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)", "org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:174)", "org.jruby.RubyClass.finvoke(RubyClass.java:899)", "org.jruby.runtime.Helpers.invoke(Helpers.java:411)", "org.jruby.RubyBasicObject.callMethod(RubyBasicObject.java:372)", "org.logstash.plugins.PluginFactoryExt$Plugins.filterDelegator(PluginFactoryExt.java:65)", "org.logstash.plugins.PluginFactoryExt$Plugins.plugin(PluginFactoryExt.java:226)", "org.logstash.plugins.PluginFactoryExt$Plugins.plugin(PluginFactoryExt.java:166)", "org.logstash.plugins.PluginFactoryExt$Plugins$INVOKER$i$0$1$plugin.call(PluginFactoryExt$Plugins$INVOKER$i$0$1$plugin.gen)", "org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:743)", "org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:77)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)", "org.jruby.ir.instructions.CallBase.interpret(CallBase.java:428)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:355)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)", "org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)", "org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)", "org.jruby.ir.instructions.CallBase.interpret(CallBase.java:428)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:355)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)", "org.jruby.ir.interpreter.Interpreter.INTERPRET_EVAL(Interpreter.java:122)", "org.jruby.ir.interpreter.Interpreter.evalCommon(Interpreter.java:176)", "org.jruby.ir.interpreter.Interpreter.evalWithBinding(Interpreter.java:200)", "org.jruby.RubyKernel.evalCommon(RubyKernel.java:1027)", "org.jruby.RubyKernel.eval19(RubyKernel.java:994)", "org.jruby.RubyKernel$INVOKER$s$0$3$eval19.call(RubyKernel$INVOKER$s$0$3$eval19.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.cacheAndCall(CachingCallSite.java:338)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:314)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)", "org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:983)", "org.jruby.ir.instructions.InstanceSuperInstr.interpret(InstanceSuperInstr.java:69)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:355)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)", "org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:77)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)", "org.jruby.RubyClass.newInstance(RubyClass.java:1022)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)", "org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:77)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)", "org.jruby.ir.instructions.CallBase.interpret(CallBase.java:428)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:355)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)", "org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:89)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:214)", "org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:200)", "org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)", "org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:193)", "org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:323)", "org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)", "org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)", "org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)", "org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:73)", "org.jruby.runtime.Block.call(Block.java:124)", "org.jruby.RubyProc.call(RubyProc.java:289)", "org.jruby.RubyProc.call(RubyProc.java:246)", "org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:104)", "java.lang.Thread.run(Unknown Source)"]}
[2018-09-19T11:17:35,601][FATAL][logstash.runner          ] An unexpected error occurred! {:error=>#<LogStash::Error: Don't know how to handle `Java::JavaLang::ClassCastException` for `PipelineAction::Create<forward>`>, :backtrace=>["org/logstash/execution/ConvergeResultExt.java:103:in `create'", "org/logstash/execution/ConvergeResultExt.java:34:in `add'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:321:in `block in converge_state'"]}

Do you know this issue?

java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
lruslan commented 6 years ago

Hi, we also experience same issue with docker.elastic.co/logstash/logstash-oss:6.4.1: "message":"org.logstash.instrument.metrics.NamespacedMetricExt cannot be cast to org.logstash.instrument.metrics.NullMetricExt"

Error message:

{"level":"ERROR","loggerName":"logstash.agent","timeMillis":1538059726916,"thread":"Converge PipelineAction::Create

","logEvent":{"message":"Failed to execute action","action":{"metaClass":{"metaClass":{"metaClass":{"action":"PipelineAction::Create
","exception":"Java::JavaLang::ClassCastException","message":"org.logstash.instrument.metrics.NamespacedMetricExt cannot be cast to org.logstash.instrument.metrics.NullMetricExt","backtrace":["org.logstash.instrument.metrics.NullNamespacedMetricExt.initialize(NullNamespacedMetricExt.java:40)","org.logstash.instrument.metrics.NullNamespacedMetricExt$INVOKER$i$0$2$initialize.call(NullNamespacedMetricExt$INVOKER$i$0$2$initialize.gen)","org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:725)","org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)","org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:741)","org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)","org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)","org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)","org.jruby.RubyClass.newInstance(RubyClass.java:1022)","org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)","org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:145)","usr.share.logstash.logstash_minus_core.lib.logstash.plugin.RUBY$method$metric$0(/usr/share/logstash/logstash-core/lib/logstash/plugin.rb:120)","usr.share.logstash.logstash_minus_core.lib.logstash.plugin.RUBY$method$metric$0$VARARGS(/usr/share/logstash/logstash-core/lib/logstash/plugin.rb)","org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:77)","org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:93)","org.jruby.ir.targets.InvokeSite.fail(InvokeSite.java:168)","org.jruby.ir.targets.InvokeSite.fail(InvokeSite.java:175)","usr.share.logstash.logstash_minus_core.lib.logstash.filter_delegator.RUBY$method$initialize$0(/usr/share/logstash/logstash-core/lib/logstash/filter_delegator.rb:25)","usr.share.logstash.logstash_minus_core.lib.logstash.filter_delegator.RUBY$method$initialize$0$VARARGS(/usr/share/logstash/logstash-core/lib/logstash/filter_delegator.rb)","org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:77)","org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:93)","org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:77)","org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)","org.jruby.RubyClass.newInstance(RubyClass.java:1022)","org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)","org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:174)","org.jruby.RubyClass.finvoke(RubyClass.java:899)","org.jruby.runtime.Helpers.invoke(Helpers.java:411)","org.jruby.RubyBasicObject.callMethod(RubyBasicObject.java:372)","org.logstash.plugins.PluginFactoryExt$Plugins.filterDelegator(PluginFactoryExt.java:65)","org.logstash.plugins.PluginFactoryExt$Plugins.plugin(PluginFactoryExt.java:226)","org.logstash.plugins.PluginFactoryExt$Plugins.plugin(PluginFactoryExt.java:166)","usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.RUBY$method$plugin$0(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:71)","org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:77)","org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:93)","org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)","org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)","org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)","org.jruby.ir.instructions.CallBase.interpret(CallBase.java:428)","org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:355)","org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)","org.jruby.ir.interpreter.Interpreter.INTERPRET_EVAL(Interpreter.java:122)","org.jruby.ir.interpreter.Interpreter.evalCommon(Interpreter.java:176)","org.jruby.ir.interpreter.Interpreter.evalWithBinding(Interpreter.java:200)","org.jruby.RubyKernel.evalCommon(RubyKernel.java:1027)","org.jruby.RubyKernel.eval19(RubyKernel.java:994)","org.jruby.RubyKernel$INVOKER$s$0$3$eval19.call(RubyKernel$INVOKER$s$0$3$eval19.gen)","org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:145)","usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.RUBY$method$initialize$0(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:49)","org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:77)","org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:93)","org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:983)","org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuperSplatArgs(IRRuntimeHelpers.java:974)","org.jruby.ir.targets.InstanceSuperInvokeSite.invoke(InstanceSuperInvokeSite.java:39)","usr.share.logstash.logstash_minus_core.lib.logstash.pipeline.RUBY$method$initialize$0(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:90)","org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:77)","org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:93)","org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)","org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)","org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)","org.jruby.RubyClass.newInstance(RubyClass.java:1022)","org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)","org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:145)","usr.share.logstash.logstash_minus_core.lib.logstash.pipeline_action.create.RUBY$method$execute$0(/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:38)","usr.share.logstash.logstash_minus_core.lib.logstash.pipeline_action.create.RUBY$method$execute$0$VARARGS(/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb)","org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:77)","org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:93)","org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:145)","usr.share.logstash.logstash_minus_core.lib.logstash.agent.RUBY$block$converge_state$2(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:309)","org.jruby.runtime.CompiledIRBlockBody.callDirect(CompiledIRBlockBody.java:145)","org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:71)","org.jruby.runtime.Block.call(Block.java:124)","org.jruby.RubyProc.call(RubyProc.java:289)","org.jruby.RubyProc.call(RubyProc.java:246)","org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:104)","java.lang.Thread.run(Thread.java:748)"]}}}}}}

ldrolez commented 5 years ago

I managed to fix this by removing 'enable_metric => false' in my beats input config

duylong commented 5 years ago

Good solution, I disabled all "enable_metric" and now I can start Logstash :)