Uploaded image for project: 'Camunda Optimize'
  1. Camunda Optimize
  2. OPT-6374

NPE on setting digest if no previousReportResults exists

XMLWordPrintable

    • Icon: Bug Report Bug Report
    • Resolution: Fixed
    • Icon: L3 - Default L3 - Default
    • 3.9.0, 3.9.0-alpha3
    • None
    • backend
    • None
    • Not defined

      Brief summary of the bug. What is it ? Where is it ?

      When creating a set of kpi reports and activating the digest email right I way I hit a nullpointerexception happing due to the complete absence of the  previousKpiReportResults (the parameter passed is `null`)

      Steps to reproduce:

      1. Start a new Optimize environment
      2. Create some kpi reports using e.g. the magic link on the processes page
      3. Enable the digest email on the process
      4. Click save 

      Actual result:

      Stacktrace:

      8:11:43.631 [qtp1477431915-20] ERROR o.c.o.r.p.GenericExceptionMapper - Mapping generic REST error
      java.lang.NullPointerException: null
          at org.camunda.optimize.service.digest.DigestService.lambda$composeKpiReportSummaryText$4(DigestService.java:202)
          at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
          at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
          at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
          at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
          at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
          at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
          at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
          at org.camunda.optimize.service.digest.DigestService.composeKpiReportSummaryText(DigestService.java:215)
          at org.camunda.optimize.service.digest.DigestService.composeDigestEmailText(DigestService.java:193)
          at org.camunda.optimize.service.digest.DigestService.sendDigestAndUpdateLatestKpiResults(DigestService.java:168)
          at org.camunda.optimize.service.digest.DigestService.handleDigestTask(DigestService.java:97)
          at org.camunda.optimize.service.digest.DigestService.rescheduleDigest(DigestService.java:116)
          at org.camunda.optimize.service.digest.DigestService.handleProcessUpdate(DigestService.java:105)
          at org.camunda.optimize.service.ProcessOverviewService.updateProcess(ProcessOverviewService.java:109)
          at org.camunda.optimize.rest.ProcessOverviewRestService.updateProcess(ProcessOverviewRestService.java:65)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:566)
          at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
          at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124)
          at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)
          at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:159)
          at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) 

      Expected result:

      • the edge-case of no previous kpi results shouldn't cause a NPE
      • actually saving digest settings shouldn't synchronously trigger an email to be sent? ideally this is done asynchronously/different thread to not influence the actual REST call as it actually does in this case

       

      Hint:

      It also seems like this is a chicken egg problem due to the error the previous/lastKpiResults never get persisted.

        This is the controller panel for Smart Panels app

              Unassigned Unassigned
              sebastian.bathke Sebastian Bathke
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: