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

Issues with HTTPCallback post action

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.0.0
    • Fix Version/s: None
    • Component/s: CDAP, UI
    • Labels:
      None
    • Rank:
      1|i00j67:

      Description

      Hi,

      We have a pipeline alert configured for a workflow. We want to provide the notification once the workflow completes. However, we want to provide the HTTPCallback requestBody at runtime programmatically. There are 2 issues I see -

      1) The CDAP UI does not display the alert details. See attached image. This is the JSON snippet of my post action for the corresponding workflow

         "postActions": [
            {
              "name": "HTTPCallback",
              "plugin": {
                "name": "HTTPCallback",
                "type": "postaction",
                "properties": {
                  "requestHeaders": "Content-Type:application/json",
                  "method": "POST",
                  "numRetries": "3",
                  "followRedirects": "false",
                  "connectTimeout": "5000",
                  "runCondition": "completion",
                  "body": "${requestBody}",
                  "url": "http://myhost:myport/notifications"
                },
                "artifact": {
                  "name": "http-plugins",
                  "version": "2.0.0"
                }
              }
            }
          ],
      

      2) When I try to run this workflow by marking the requestBody parameter as "provided" (since I want to supply it's value at runtime via my plugin code), it fails with the below error

      Caused by: co.cask.cdap.api.macro.InvalidMacroException: Argument 'requestBody' is not defined.
      	at co.cask.cdap.etl.common.DefaultMacroEvaluator.lookup(DefaultMacroEvaluator.java:58) ~[na:na]
      	at co.cask.cdap.internal.app.runtime.plugin.MacroParser.findRightmostMacro(MacroParser.java:140) ~[na:na]
      	at co.cask.cdap.internal.app.runtime.plugin.MacroParser.parse(MacroParser.java:82) ~[na:na]
      	at co.cask.cdap.internal.app.runtime.plugin.MacroParser.parse(MacroParser.java:66) ~[na:na]
      	at co.cask.cdap.internal.app.runtime.plugin.PluginInstantiator.substituteMacros(PluginInstantiator.java:292) ~[na:na]
      	at co.cask.cdap.internal.app.runtime.plugin.PluginInstantiator.newInstance(PluginInstantiator.java:252) ~[na:na]
      	at co.cask.cdap.internal.app.runtime.DefaultPluginContext.newPluginInstance(DefaultPluginContext.java:93) ~[na:na]
      	at co.cask.cdap.internal.app.runtime.AbstractContext.newPluginInstance(AbstractContext.java:497) ~[na:na]
      	at co.cask.cdap.etl.common.plugin.PipelinePluginContext.newPluginInstance(PipelinePluginContext.java:79) ~[na:na]
      	at co.cask.cdap.datapipeline.SmartWorkflow.initialize(SmartWorkflow.java:458) ~[na:na]
      	at co.cask.cdap.datapipeline.SmartWorkflow.initialize(SmartWorkflow.java:112) ~[na:na]
      	at co.cask.cdap.internal.app.runtime.AbstractContext.lambda$initializeProgram$0(AbstractContext.java:617) ~[na:na]
      	at co.cask.cdap.internal.app.runtime.AbstractContext$2.run(AbstractContext.java:534) ~[na:na]
      	at co.cask.cdap.data2.transaction.Transactions$CacheBasedTransactional.finishExecute(Transactions.java:224) ~[na:na]
      

      Am I missing something?

        Attachments

          Activity

            People

            • Assignee:
              priyanka Priyanka Nambiar
              Reporter:
              rshringi Rajiv Shringi
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: