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

The Alarm History feature is not working

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 26.1.0
    • 26.1.1
    • Alarms
    • Security Level: Default (Default Security Scheme)
    • None
    • Horizon 2020 - May 13

    Description

      The alarm history feature, used to forward alarm changes to Elasticsearch is not working on Horizon 26.1.0, but it works on 25.x (verified with 25.2.1).

      I'm including a simple test environment with Docker that someone can use to verify that it works with H25 but not with H26.

      With H26, there is an exception on karaf.log on every attempt to send an alarm to Elastic:

      2020-05-15T13:20:56,900 | ERROR | ElasticAlarmIndexer | DefaultTemplateInitializer       | 293 - org.opennms.features.jest.client - 26.1.0 | An error occurred while initializing template alarms: java.lang.ClassCastException: class com.google.gson.JsonPrimitive cannot be cast to class com.google.gson.JsonArray (com.google.gson.JsonPrimitive and com.google.gson.JsonArray are in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @306682d6).
      com.google.common.util.concurrent.UncheckedExecutionException: java.lang.ClassCastException: class com.google.gson.JsonPrimitive cannot be cast to class com.google.gson.JsonArray (com.google.gson.JsonPrimitive and com.google.gson.JsonArray are in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @306682d6)
              at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2203) ~[?:?]
              at com.google.common.cache.LocalCache.get(LocalCache.java:3937) ~[?:?]
              at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941) ~[?:?]
              at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824) ~[?:?]
              at org.opennms.features.jest.client.template.CachingTemplateLoader.load(CachingTemplateLoader.java:59) ~[293:org.opennms.features.jest.client:26.1.0]
              at org.opennms.features.jest.client.template.DefaultTemplateInitializer.doInitialize(DefaultTemplateInitializer.java:118) ~[293:org.opennms.features.jest.client:26.1.0]
              at org.opennms.features.jest.client.template.DefaultTemplateInitializer.initialize(DefaultTemplateInitializer.java:85) [293:org.opennms.features.jest.client:26.1.0]
              at org.opennms.features.alarms.history.elastic.ElasticAlarmIndexer.run(ElasticAlarmIndexer.java:205) [408:org.opennms.features.alarms.history.elastic:26.1.0]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
              at java.lang.Thread.run(Thread.java:834) [?:?]
      Caused by: java.lang.ClassCastException: class com.google.gson.JsonPrimitive cannot be cast to class com.google.gson.JsonArray (com.google.gson.JsonPrimitive and com.google.gson.JsonArray are in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @306682d6)
              at com.google.gson.JsonObject.getAsJsonArray(JsonObject.java:195) ~[?:?]
              at org.opennms.features.jest.client.template.TemplateMerger.merge(TemplateMerger.java:62) ~[?:?]
              at org.opennms.features.jest.client.template.TemplateMerger.merge(TemplateMerger.java:52) ~[?:?]
              at org.opennms.features.jest.client.template.MergingTemplateLoader.merge(MergingTemplateLoader.java:54) ~[?:?]
              at org.opennms.features.jest.client.template.MergingTemplateLoader.load(MergingTemplateLoader.java:50) ~[?:?]
              at org.opennms.features.jest.client.template.CachingTemplateLoader$1.load(CachingTemplateLoader.java:51) ~[?:?]
              at org.opennms.features.jest.client.template.CachingTemplateLoader$1.load(CachingTemplateLoader.java:48) ~[?:?]
              at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527) ~[?:?]
              at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319) ~[?:?]
              at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282) ~[?:?]
              at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197) ~[?:?]
              ... 10 more
      

      Interestingly, with Horizon 26.0.0, the alarm history feature works as expected, meaning something changed recently broke it.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: