fhossfel opened a new issue, #5936:
URL: https://github.com/apache/hop/issues/5936

   ### Apache Hop version?
   
   2.13
   
   ### Java version?
   
   21
   
   ### Operating system
   
   macOS
   
   ### What happened?
   
   The SFTP job fails to move a file after upload if the target directory is on 
a different (read: persistent) file system. The reason seems to be that in 
`ActionSftpPut.java`you have a call to `moveTo`:
   
       case AFTER_FTPSPUT_MOVE:
                   FileObject destination = null;
                   try {
                     destination =
                         HopVfs.getFileObject(
                             realDestinationFolder
                                 + Const.FILE_SEPARATOR
                                 + myFile.getName().getBaseName());
                     myFile.moveTo(destination);
                     if (isDetailed()) {
                       logDetailed(
                           BaseMessages.getString(
                               PKG, "ActionSftpPut.Log.FileMoved", myFile, 
destination));
                     }
                   } finally {
                     if (destination != null) {
                       destination.close();
                     }
                   }
   
   This intern call LocalFile.doRename() which fails because it requires 
copying and deleting.
   
   
   The full stack trace is below (/files/work and /files/arc are on two 
different filesystems):
   
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server - ERROR: Error while 
trying to send files. Exception : Could not rename 
"file:///files/work/XYZ_31.10.2025T15-52-03.csv" to 
"file:///files/arc/XYZ_31.10.2025T15-52-03.csv".
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server - ERROR: 
org.apache.commons.vfs2.FileSystemException: Could not rename 
"file:///files/work/XYZ_31.10.2025T15-52-03.csv" to 
"file:///files/arc/XYZ_31.10.2025T15-52-03.csv".
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      at 
org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(AbstractFileObject.java:1717)
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      at 
org.apache.hop.workflow.actions.sftpput.ActionSftpPut.execute(ActionSftpPut.java:874)
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      at 
org.apache.hop.workflow.Workflow.executeFromStart(Workflow.java:751)
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      at 
org.apache.hop.workflow.Workflow.executeFromStart(Workflow.java:894)
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      at 
org.apache.hop.workflow.Workflow.executeFromStart(Workflow.java:894)
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      at 
org.apache.hop.workflow.Workflow.executeFromStart(Workflow.java:453)
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      at 
org.apache.hop.workflow.Workflow.startExecution(Workflow.java:313)
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      at 
org.apache.hop.workflow.engines.local.LocalWorkflowEngine.startExecution(LocalWorkflowEngine.java:248)
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      at 
org.apache.hop.run.HopRun.runWorkflow(HopRun.java:438)
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      at 
org.apache.hop.run.HopRun.runWorkflow(HopRun.java:389)
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      at 
org.apache.hop.run.HopRun.run(HopRun.java:206)
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      at 
org.apache.hop.run.HopRun.main(HopRun.java:931)
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server - Caused by: 
org.apache.commons.vfs2.FileSystemException: Could not rename file 
"/files/work/XYZ_31.10.2025T15-52-03.csv" to 
"file:///files/arc/XYZ_31.10.2025T15-52-03.csv".
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      at 
org.apache.commons.vfs2.provider.local.LocalFile.doRename(LocalFile.java:225)
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      at 
org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(AbstractFileObject.java:1708)
       2025/10/31 15:52:04 - Upload *.csv to SFTP Server -      ... 11 more`
   
   Arguably this is a bugs in commons-vfs but the Move files action works 
flawlessly.
   
   ### Issue Priority
   
   Priority: 3
   
   ### Issue Component
   
   Component: Actions


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to