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

Log endpoint returns invalid json if all events are filtered

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.0
    • Component/s: Log
    • Labels:
      None
    • Release Notes:
      Fixed the logs REST API to return a valid json object when filters are specified
    • Rank:
      1|i00a53:

      Description

      The logging endpoint allows you to specify format as json and to specify a filter. If the filter causes all events to be filtered out, the endpoint returns ']' when it should return an empty collection '[]'.

      To reproduce, deploy an app, run a program, then do a call that is guaranteed to match nothing:

      http://localhost:11015/v3/namespaces/default/apps/MMDS-Trainer/workflows/DataPipelineWorkflow/runs/defbfa92-ded7-11e7-a13d-a6ee8d303f93/logs?format=json&filter=MDC:asdf=matches_nothing
      

      the response will be ']'.

        Attachments

          Activity

            People

            • Assignee:
              vinisha Vinisha Shah
              Reporter:
              ashau Albert Shau
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: