sourcePath and destinationPath are on the same SFTP server, but different folders
Executing the above code leads to the following stack trace:
[2020-07-29 12:25:31,107] [-1234] [] [PassThroughMessageProcessor-61] ERROR {org.wso2.carbon.connector.FileCopy} - Error occurred while copying a file. Could not copy "sftp://user:***@ftp-secure.example.com/from/20200729-110700.zip" to "sftp://user:***@ftp-secure.example.com/_archive/20200729-110700.zip".
org.apache.commons.vfs2.FileSystemException: Could not copy "sftp://user:***@ftp-secure.example.com/from/uic-counter/20200729-110700.zip" to "sftp://user:***@ftp-secure.example.com/_archive/20200729-110700.zip".
at org.apache.commons.vfs2.provider.AbstractFileObject.copyFrom(AbstractFileObject.java:294)
at org.wso2.carbon.connector.FileCopy.copy(FileCopy.java:196)
at org.wso2.carbon.connector.FileCopy.copyFile(FileCopy.java:117)
at org.wso2.carbon.connector.FileCopy.connect(FileCopy.java:59)
at org.wso2.carbon.connector.core.AbstractConnector.mediate(AbstractConnector.java:32)
at org.apache.synapse.mediators.ext.ClassMediator.mediate(ClassMediator.java:94)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.mediators.template.TemplateMediator.mediate(TemplateMediator.java:104)
at org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:148)
at org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:84)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:169)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:169)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:224)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:443)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:179)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.commons.vfs2.FileSystemException: Could not connect to SFTP server at "sftp://user:***@ftp-secure.example.com/".
at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel(SftpFileSystem.java:127)
at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetInputStream(SftpFileObject.java:469)
at org.apache.commons.vfs2.provider.AbstractFileObject.getInputStream(AbstractFileObject.java:1119)
at org.apache.commons.vfs2.provider.DefaultFileContent.getInputStream(DefaultFileContent.java:349)
at org.apache.commons.vfs2.provider.DefaultFileContent.write(DefaultFileContent.java:734)
at org.apache.commons.vfs2.provider.DefaultFileContent.write(DefaultFileContent.java:720)
at org.apache.commons.vfs2.provider.DefaultFileContent.write(DefaultFileContent.java:691)
at org.apache.commons.vfs2.provider.DefaultFileContent.write(DefaultFileContent.java:707)
at org.apache.commons.vfs2.FileUtil.copyContent(FileUtil.java:78)
at org.apache.commons.vfs2.provider.AbstractFileObject.copyFrom(AbstractFileObject.java:289)
... 27 more
Caused by: com.jcraft.jsch.JSchException: channel is not opened.
at com.jcraft.jsch.Channel.sendChannelOpen(Channel.java:768)
at com.jcraft.jsch.Channel.connect(Channel.java:151)
at com.jcraft.jsch.Channel.connect(Channel.java:145)
at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel(SftpFileSystem.java:101)
... 36 more
using another filesystem (FTP, FILE) as target does not show the problem
Description
Moving the issue from https://github.com/wso2-extensions/esb-connector-file/issues/128
Description: Try to copy files from one folder on SFTP server to another folder on the same SFTP server fails.
Steps to reproduce:
sourcePath and destinationPath are on the same SFTP server, but different folders Executing the above code leads to the following stack trace:
using another filesystem (FTP, FILE) as target does not show the problem
found on WSO2 EI 6.4.0 WUM level 1585759234543
Steps to Reproduce
No response
Affected Version(s)
No response
OS, DB, other environment details and versions
No response
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response