Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-14062

ReportGenerationAppTest is flaky

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.1.0
    • Fix Version/s: 5.1.0
    • Component/s: Dashboard
    • Labels:
    • Rank:
      1|i00g93:

      Description

      The test case testGenerateReport fails with: 

      java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:37265/v3/namespaces/default/apps/ReportGenerationApp/spark/ReportGenerationSpark/methods/reports/download?report-id=7a9feb81-9b2b-11e8-8483-00000015ec59
      

      Digging into bamboo logs, I can see that this is due to the fact the report does not exist:

      2018-08-08 16:53:07,182 - ERROR [ReportGenerationSpark-http-executor-9:c.c.c.i.a.r.s.h.DelayedHttpServiceResponder@117] - Exception occurred while handling request:
      java.io.FileNotFoundException: File /tmp/CDAP-DUT-JOB1/junit3295195695033986837/junit9152959932851481362/namespaces/default/data/ReportFileset/system/7a9feb81-9b2b-11e8-8483-00000015ec59/reports does not exist.
              at org.apache.twill.filesystem.LocalLocation.list(LocalLocation.java:309) ~[twill-common-0.13.0.jar:0.13.0]
              at co.cask.cdap.data2.dataset2.lib.file.FileSetDataset$FileSetLocation.list(FileSetDataset.java:477) ~[na:na]
              at co.cask.cdap.data2.dataset2.lib.file.FileSetDataset$FileSetLocation.list(FileSetDataset.java:477) ~[na:na]
              at co.cask.cdap.report.ReportGenerationSpark$ReportSparkHandler.getReportDetails(ReportGenerationSpark.java:743) ~[unpacked/:na] 

      That, in turn, appears to be caused by a failure in the report generation spark earlier:

      Exception in thread "TMS-RunrecordEvent-Subscriber-thread" java.lang.IllegalArgumentException: offset (0) + length (8) exceed
       the capacity of the array: 1
              at co.cask.cdap.api.common.Bytes.explainWrongLengthOrOffset(Bytes.java:485)
              at co.cask.cdap.api.common.Bytes.toLong(Bytes.java:463)
              at co.cask.cdap.api.common.Bytes.toLong(Bytes.java:448)
              at co.cask.cdap.messaging.data.MessageId.<init>(MessageId.java:69)
              at co.cask.cdap.messaging.service.CoreMessageFetcher$MessageCloseableIterator.<init>(CoreMessageFetcher.java:145)
              at co.cask.cdap.messaging.service.CoreMessageFetcher.fetch(CoreMessageFetcher.java:60)
              at co.cask.cdap.messaging.context.BasicMessageFetcher.fetch(BasicMessageFetcher.java:79)
              at co.cask.cdap.report.main.TMSSubscriber.run(TMSSubscriber.java:89) 

      So, there appear to be multiple issues here:

      • TMS contains an ill-formed message (which appears to be the root cause)
      • The report generation fails, but that failure is not detected
      • The reports handler returns an internal error if a report does not exist 

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                terence Terence Yim
                Reporter:
                andreas Andreas Neumann
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: