Uploaded image for project: 'YADE - Managed File Transfer'
  1. YADE - Managed File Transfer
  2. YADE-642

Transfer can fail when Target PostProcessing is defined and Source selection returns 0 files

    XMLWordPrintable

Details

    Description

      Current Situation

      • If the source selection returns 0 files and SourceFileOptions/Directives/DisableErrorOnNonFilesFound=true:
        • If no PostProcessing commands are defined on the Target
          • YADE execution ends as expected.
        • If PostProcessing commands are defined on the Target
          • This also includes Jump-Host setups where the Target is located in an external network and cannot be reached directly from the Source.
            • In this case the YADE engine automatically generates PostProcessing commands on the Jump Host to reach the Target.
          • The transfer fails with a target connection exception (e.g. "SSHClient not connected" for SFTP).
          • Cause:
            • YADE establishes a connection to the Jump/Target only if the source selection returns more than 0 files.
            • If PostProcessing commands exist, YADE still attempts to execute them.
            • As a result, the PostProcessing step is executed on a Jump/Target client that was never connected, which leads to the connection exception.

      Maintainer Note

      • If configured, the following operation commands are executed on the Target only if the Source file selection returns at least one file.
      • If no files are selected, the Target connection is not established and these commands are not executed.
        • CommandBeforeOperation
        • CommandAfterOperationOnSuccess
        • CommandAfterOperationOnError
        • CommandAfterOperationFinal

      Patch

      • Applying the patch
        • Since YADE-626, YADE can be executed not only as a standalone Shell Job, but also as an integrated Java JITL Job.
        • This means the patch can/should be deployed in two locations:
          • <agent install>/lib/patches - for YADE configured as a JITL Job (com.sos.jitl.jobs.yade.YADEJob)
          • <agent install>/yade/lib/patches - for YADE configured as a Shell Job
            • Note: The Agent instance does not need to be restarted to apply the patch

      Test Instructions

      • Transfer without Jump Host
        • Source configuration
          • Configure LocalSource as Source.
          • Configure the Source Selection so that no files are found (e.g., use a non-existing directory).
          • Set SourceFileOptions/Directives/DisableErrorOnNonFilesFound = true
          • Configure operation commands:
            • LocalPreProcessing/CommandBeforeOperation = echo CommandBeforeOperation
            • LocalPostProcessing/CommandAfterOperationOnSuccess = echo CommandAfterOperationOnSuccess
            • LocalPostProcessing/CommandAfterOperationOnError = echo CommandAfterOperationOnError
            • LocalPostProcessing/CommandAfterOperationFinal = echo CommandAfterOperationFinal
        • Target configuration
          • Configure an SFTPFragmentRef as Target.
          • Configure the same operation commands as above.
        • Execute test
          • Expected result
            • The corresponding commands are executed only on the Source.
            • The Target remains unconnected.
              • No commands configured on the Target are executed.
            • No exceptions are thrown.
      • Transfer with Jump Host
        • Source configuration
          • Configure LocalSource as Source (same configuration as above).
        • Target configuration
          • Configure an SFTPFragmentRef as Target.
            • Configure operation commands as above.
            • The corresponding SFTPFragment must use the Jump Host.
        • Execute test
          • Expected result
            • The corresponding commands are executed only on the Source.
            • The Jump Host and Target remain unconnected.
              • No commands configured on the Jump Host or Target are executed.
            • No exceptions are thrown.
      • Regression Tests (to ensure the fix did not break existing functionality)
        • Execute additional tests:
          • Test with SourceFileOptions/Directives/DisableErrorOnNonFilesFound = false
          • Test with a Source Selection that returns files.

      Attachments

        Issue Links

          Activity

            People

              re Robert Ehrlich
              re Robert Ehrlich
              Aakash Rao Aakash Rao
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: