OpenNMS fails to start, when more than one active listener is referencing the same parser

Description

After upgrading to 27.0.1 OpenNMS refused to start. The file output.log shows exceptions like this:

An error occurred while attempting to start the "OpenNMS:Name=Telemetryd" service (class org.opennms.netmgt.daemon.SimpleSpringContextJmxServiceDaemon).  Shutting down and exiting. javax.management.RuntimeMBeanException: java.lang.IllegalArgumentException: A metric named parsers.Netflow-9-Parser.sessionCount already exists         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:839)         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBeanException(DefaultMBeanServerInterceptor.java:852)         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:821)         at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)         at org.opennms.netmgt.vmmgr.Invoker.invoke(Invoker.java:277)         at org.opennms.netmgt.vmmgr.Invoker.invokeMethods(Invoker.java:206)         at org.opennms.netmgt.vmmgr.Starter.start(Starter.java:154)         at org.opennms.netmgt.vmmgr.Starter.startDaemon(Starter.java:94)         at org.opennms.netmgt.vmmgr.Controller.start(Controller.java:173)         at org.opennms.netmgt.vmmgr.Controller.main(Controller.java:150)         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)         at java.lang.reflect.Method.invoke(Method.java:498)         at org.opennms.bootstrap.Bootstrap$4.run(Bootstrap.java:542)         at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalArgumentException: A metric named parsers.Netflow-9-Parser.sessionCount already exists         at com.codahale.metrics.MetricRegistry.register(MetricRegistry.java:91)         at org.opennms.netmgt.telemetry.protocols.netflow.parser.UdpParserBase.<init>(UdpParserBase.java:81)         at org.opennms.netmgt.telemetry.protocols.netflow.parser.Netflow9UdpParser.<init>(Netflow9UdpParser.java:65)         at org.opennms.netmgt.telemetry.protocols.netflow.parser.factory.Netflow9UdpParserFactory.createBean(Netflow9UdpParserFactory.java:66)         at org.opennms.netmgt.telemetry.protocols.netflow.parser.factory.Netflow9UdpParserFactory.createBean(Netflow9UdpParserFactory.java:44)         at org.opennms.netmgt.telemetry.protocols.registry.impl.TelemetryServiceRegistryImpl.getService(TelemetryServiceRegistryImpl.java:121)         at org.opennms.netmgt.telemetry.protocols.registry.impl.TelemetryServiceRegistryImpl.getService(TelemetryServiceRegistryImpl.java:56)         at org.opennms.netmgt.telemetry.protocols.registry.impl.TelemetryRegistryImpl.getParser(TelemetryRegistryImpl.java:95)         at Proxyd5a17d20_5212_463e_949d_686597d64b80.getParser(Unknown Source)         at org.opennms.netmgt.telemetry.listeners.factory.UdpListenerFactory.lambda$createBean$0(UdpListenerFactory.java:59)         at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)         at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)         at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)         at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)         at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)         at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)         at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)         at org.opennms.netmgt.telemetry.listeners.factory.UdpListenerFactory.createBean(UdpListenerFactory.java:61)         at org.opennms.netmgt.telemetry.listeners.factory.UdpListenerFactory.createBean(UdpListenerFactory.java:42)         at org.opennms.netmgt.telemetry.protocols.registry.impl.TelemetryServiceRegistryImpl.getService(TelemetryServiceRegistryImpl.java:121)         at org.opennms.netmgt.telemetry.protocols.registry.impl.TelemetryServiceRegistryImpl.getService(TelemetryServiceRegistryImpl.java:56)         at org.opennms.netmgt.telemetry.protocols.registry.impl.TelemetryRegistryImpl.getListener(TelemetryRegistryImpl.java:85)         at org.opennms.netmgt.telemetry.daemon.Telemetryd.start(Telemetryd.java:140)         at org.opennms.netmgt.daemon.AbstractSpringContextJmxServiceDaemon$2.run(AbstractSpringContextJmxServiceDaemon.java:128)         at org.opennms.core.logging.Logging.withPrefix(Logging.java:71)         at org.opennms.netmgt.daemon.AbstractSpringContextJmxServiceDaemon.start(AbstractSpringContextJmxServiceDaemon.java:118)         at sun.reflect.GeneratedMethodAccessor470.invoke(Unknown Source)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)         at java.lang.reflect.Method.invoke(Method.java:498)         at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)         at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)         at java.lang.reflect.Method.invoke(Method.java:498)         at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)         at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112)         at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46)         at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)         at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)         at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)         ... 13 more

 

In my configuration two listeners (NF9-listener and multiprotocol-listener) were enabled. Both pointed to the parser for NF9. After disabling one of the two listeners OpenNMS was able to start again.
It seems that telemetryd fails to start, when two or more enabled listeners are referencing the same parser instance. The problem seems to be, that the metric is tried to be created twice in this case and telemetryd fails to start.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

fooker December 3, 2020 at 9:06 AM

fooker December 2, 2020 at 12:12 PM

This can be worked around by renaming one of the two parsers. The name is just used for display purposes (and naming counters and stats). Therefore the queue parameter must be used to configure both listeners to use the same queue.

Fixed

Details

Assignee

Reporter

Components

Sprint

Fix versions

Affects versions

Priority

PagerDuty

Created December 2, 2020 at 7:49 AM
Updated December 5, 2020 at 7:12 PM
Resolved December 5, 2020 at 7:12 PM

Flag notifications