Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-12825

NPE while running AlarmLifecycleListenerManager

    XMLWordPrintable

    Details

    • Sprint:
      Horizon 2020 - August 5
    • HB Backlog Status:
      Backlog CM

      Description

      On a client installation that heavily rely on ALEC, I see lots of exceptions like the following one in alarmd.log:

      2020-07-09 13:59:26,082 ERROR [alarmd-Thread-2-of-4] o.o.n.a.AlarmLifecycleListenerManager: Error occurred while invoking listener: org.opennms.features.apilayer.alarms.AlarmLifecycleListenerManager$1@659f993f. Skipping.
      java.lang.NullPointerException: null
              at org.opennms.alec.datasource.opennms.jvm.ApiMapper.getSituationIdFromAlarm(ApiMapper.java:115) ~[?:?]
              at org.opennms.alec.datasource.opennms.jvm.ApiMapper.toSituation(ApiMapper.java:98) ~[?:?]
              at org.opennms.alec.datasource.opennms.jvm.DirectAlarmDatasource.handleNewOrUpdatedAlarmNoLock(DirectAlarmDatasource.java:168) ~[?:?]
              at org.opennms.alec.datasource.opennms.jvm.DirectAlarmDatasource.handleNewOrUpdatedAlarm(DirectAlarmDatasource.java:142) ~[?:?]
              at Proxy206caf1f_7f1a_4732_acc0_78aee3e07883.handleNewOrUpdatedAlarm(Unknown Source) ~[?:?]
              at org.opennms.features.apilayer.alarms.AlarmLifecycleListenerManager$1.handleNewOrUpdatedAlarm(AlarmLifecycleListenerManager.java:67) ~[org.opennms.features.api-layer-26.1.2.jar:?]
              at org.opennms.netmgt.alarmd.AlarmLifecycleListenerManager.lambda$onNewOrUpdatedAlarm$2(AlarmLifecycleListenerManager.java:135) ~[opennms-alarmd-26.1.2.jar:?]
              at org.opennms.netmgt.alarmd.AlarmLifecycleListenerManager.forEachListener(AlarmLifecycleListenerManager.java:206) ~[opennms-alarmd-26.1.2.jar:?]
              at org.opennms.netmgt.alarmd.AlarmLifecycleListenerManager.onNewOrUpdatedAlarm(AlarmLifecycleListenerManager.java:135) ~[opennms-alarmd-26.1.2.jar:?]
              at org.opennms.netmgt.alarmd.AlarmLifecycleListenerManager.onAlarmCreated(AlarmLifecycleListenerManager.java:150) ~[opennms-alarmd-26.1.2.jar:?]
              at org.opennms.netmgt.dao.support.AlarmEntityNotifierImpl.lambda$didCreateAlarm$0(AlarmEntityNotifierImpl.java:55) ~[opennms-dao-26.1.2.jar:?]
              at org.opennms.netmgt.dao.support.AlarmEntityNotifierImpl.forEachListener(AlarmEntityNotifierImpl.java:121) ~[opennms-dao-26.1.2.jar:?]
              at org.opennms.netmgt.dao.support.AlarmEntityNotifierImpl.didCreateAlarm(AlarmEntityNotifierImpl.java:55) ~[opennms-dao-26.1.2.jar:?]
              at org.opennms.netmgt.alarmd.AlarmPersisterImpl.addOrReduceEventAsAlarm(AlarmPersisterImpl.java:184) ~[opennms-alarmd-26.1.2.jar:?]
              at org.opennms.netmgt.alarmd.AlarmPersisterImpl.lambda$persist$0(AlarmPersisterImpl.java:122) ~[opennms-alarmd-26.1.2.jar:?]
              at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) [org.apache.servicemix.bundles.spring-tx-4.2.9.RELEASE_1.jar:?]
              at org.opennms.netmgt.alarmd.AlarmPersisterImpl.persist(AlarmPersisterImpl.java:122) [opennms-alarmd-26.1.2.jar:?]
              at org.opennms.netmgt.alarmd.Alarmd.onEvent(Alarmd.java:87) [opennms-alarmd-26.1.2.jar:?]
              at jdk.internal.reflect.GeneratedMethodAccessor400.invoke(Unknown Source) ~[?:?]
              at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
              at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
              at org.opennms.netmgt.events.api.AnnotationBasedEventListenerAdapter.processEvent(AnnotationBasedEventListenerAdapter.java:221) [org.opennms.features.events.api-26.1.2.jar:?]
              at org.opennms.netmgt.events.api.AnnotationBasedEventListenerAdapter$1.run(AnnotationBasedEventListenerAdapter.java:182) [org.opennms.features.events.api-26.1.2.jar:?]
              at org.opennms.core.logging.Logging.withPrefix(Logging.java:71) [org.opennms.core.logging-26.1.2.jar:?]
              at org.opennms.netmgt.events.api.AnnotationBasedEventListenerAdapter.onEvent(AnnotationBasedEventListenerAdapter.java:175) [org.opennms.features.events.api-26.1.2.jar:?]
              at org.opennms.netmgt.eventd.EventIpcManagerDefaultImpl$EventListenerExecutor$2.run(EventIpcManagerDefaultImpl.java:189) [org.opennms.features.events.daemon-26.1.2.jar:?]
              at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736) [?:?]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
              at org.opennms.core.concurrent.LogPreservingThreadFactory$3.run(LogPreservingThreadFactory.java:124) [opennms-util-26.1.2.jar:?]
              at java.lang.Thread.run(Thread.java:834) [?:?]
      

      I don't know if there are side effects because of this, or if ALEC is not behaving properly, but considering the amount of those exceptions, I believe it worth finding the root cause and avoid it.

        Attachments

          Activity

            People

            Assignee:
            cgorantla Chandra Gorantla
            Reporter:
            agalue Alejandro Galue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration