使用docker在vm中执行sftp时关闭管道错误

时间:2016-06-20 17:47:18

标签: docker apache-camel sftp

我有一个mounterized容器的camel路由器,它从远程主机到VM本地文件夹执行sftp。如果我只是以传统方式在VM中运行我的代码(即java -jar my-sftp-camel-router.jar),它会下载所有5000个文件。但是,当我使用docker run -P / tmp /:/ tmp / my-sftp-camel-router-image运行与docker镜像相同的操作时,它会在下载大约12个文件后失败。 这两种情况在我的本地机器上运行良好,但在VM上运行不正确。

org.apache.camel.component.file.GenericFileOperationFailedException: Cannot change directory to: /
at org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:576)
at org.apache.camel.component.file.remote.SftpOperations.changeCurrentDirectory(SftpOperations.java:533)
at org.apache.camel.component.file.remote.SftpOperations.buildDirectory(SftpOperations.java:472)
at org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:106)
at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.begin(GenericFileRenameProcessStrategy.java:43)
at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:367)
at org.apache.camel.component.file.remote.RemoteFileConsumer.processExchange(RemoteFileConsumer.java:137)
at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:226)
at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:190)
at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:175)
at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:102)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: 4: 
at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:359)
at org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:574)
... 17 more
Caused by: java.io.IOException: Pipe closed
at java.io.PipedInputStream.read(PipedInputStream.java:307)
at java.io.PipedInputStream.read(PipedInputStream.java:377)
at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2882)
at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2908)
at com.jcraft.jsch.ChannelSftp._realpath(ChannelSftp.java:2328)
at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:342)
... 18 more

0 个答案:

没有答案