Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-10303

GetElasticsearch processor invokes elasticsearch GET api without an identifier when flow file is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.16.3
    • 1.19.0
    • None

    Description

      When GetElasticsearch processor has an incoming connection, and the document id is an expression, this results in expression evaluating to null when the processor runs without a flow file. This in turn results in elasticsearch GET api being invoked without an ID and elastic throwing an error.

      Also noticed that other processors handle this scenario by short-circuiting at the beginning of onTrigger method

              FlowFile input = null;
              if (context.hasIncomingConnection()) {
                  input = session.get();
      
                  // If we have no FlowFile, and all incoming connections are self-loops then we can continue on.
                  // However, if we have no FlowFile and we have connections coming from other Processors, then
                  // we know that we should run only if we have a FlowFile.
                  if (input == null && context.hasNonLoopConnection()) {
                      return;
                  }
              }
      

      However GetElasticsearch does not.

      Attachments

        Issue Links

          Activity

            People

              Chris S Chris Sampson
              vjgorla Vijaya Gorla
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m