"file not found" error when moving files on SSHFTP servers with BusinessConnect

"file not found" error when moving files on SSHFTP servers with BusinessConnect

book

Article ID: KB0088654

calendar_today

Updated On:

Products Versions
TIBCO BusinessConnect -
Not Applicable -

Description

Resolution:
Description:
---------------

When attempting to move files on an SSHFTP server using the executeRenameCmd function, BC throws a "file not found" error as follows:


----------------
Custom script for protocol 'EZComm', partner 'TestCMDPartner', returned error, retry count=1 details: XXX to YYYY : Error during rename operation: Remote file (or path) not found: &ltfull source file name>
----------------

Environment:
---------------
All

Resolution:
--------------
The file can be moved by doing the following:

1.  Set the remote directory to the root:
2.  Use the full path for both the source and destinations files in the executeRenameCmd:


as in this example code snippet:

         sshftpClient.setRemoteDir("//");

     // Obtain the file

          fileName = //home/user1/sshftptest/sshftppolled/" + fileName;
         job.aeTrace("INFO", "BC-Custom", job.getName()+" Old file name is " + fileName, null);
        var newFilename = "//home/user2/sshftptest/outbound/" + fileName + ".txt"

         job.aeTrace("INFO", "BC-Custom", job.getName()+" New file name is " + newFilename, null);

         filereply = sshftpClient.executeRenameCmd(fileName,newFilename);
     // Check if it is deleted and log it
     if ( filereply == OK ) {          
       job.aeTrace("INFO", "BC-Custom", job.getName()+"File '" + fileName + "' name changed successfully.", null);
     }

Note that this will not work if the source and destination directories are on different file systems.

Issue/Introduction

"file not found" error when moving files on SSHFTP servers with BusinessConnect