You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by nicoruti <ni...@diligent-it.com> on 2015/11/25 10:05:00 UTC

sFTP 'listFiles' does not work after upgrade from 2.15.x to 2.16.0

Dear camel-community

I have the following route (simplified):

RemoteFileEndpoint ftpEndpoint =
endpoint("sftp:ftp.myhost.com/?username=user&password=xxxxx&delay=43200000&disconnect=true",
RemoteFileEndpoint.class);
ftpEndpoint.setFilter(new MyDownloadFileFilter());
from(ftpEndpoint)
         .to("file:{{configured.dl.dir}}")
         .log("Downloaded ${header.CamelFileName} over FTP")
         .to("direct:further-processing")
.end();


This route worked as expected and I could download all files that are
accepted by MyDownloadFileFilter.
After upgrading from 2.15.x to the latest camel version 2.16.0, I faced the
following exception:


WARN ] 2015-11-25 09:41:12.988 [Camel (camel-1) thread #2 -
sftp://ftp.myhost.com/] RemoteFilePollingConsumerPollStrategy - Trying to
recover by disconnecting from remote server forcing a re-connect at next
poll: sftp://user@ftp.myhost.com:22
[WARN ] 2015-11-25 09:41:12.993 [Camel (camel-1) thread #2 -
sftp://ftp.myhost.com/] SftpConsumer - Consumer
Consumer[sftp://ftp.myhost.com/?delay=43200000&disconnect=true&password=xxxxxx&username=user]
failed polling endpoint:
Endpoint[sftp://ftp.myhost.com/?delay=43200000&disconnect=true&password=xxxxxx&username=user].
Will try again at next poll. Caused by:
[org.apache.camel.component.file.GenericFileOperationFailedException -
Cannot list directory: .]
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
list directory: .
	at
org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:597)
~[camel-ftp-2.16.0.jar:2.16.0]
	at
org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:574)
~[camel-ftp-2.16.0.jar:2.16.0]
	at
org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:115)
~[camel-ftp-2.16.0.jar:2.16.0]
	at
org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:79)
~[camel-ftp-2.16.0.jar:2.16.0]
	at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:119)
~[camel-core-2.16.0.jar:2.16.0]
	at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
[camel-core-2.16.0.jar:2.16.0]
	at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
[camel-core-2.16.0.jar:2.16.0]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[?:1.8.0_60]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
[?:1.8.0_60]
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
[?:1.8.0_60]
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
[?:1.8.0_60]
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[?:1.8.0_60]
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[?:1.8.0_60]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_60]
Caused by: com.jcraft.jsch.SftpException: 
	at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1720)
~[jsch-0.1.53.jar:?]
	at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1526)
~[jsch-0.1.53.jar:?]
	at
org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:588)
~[camel-ftp-2.16.0.jar:2.16.0]
	... 13 more
Caused by: java.io.IOException: Pipe closed
	at java.io.PipedInputStream.read(PipedInputStream.java:307) ~[?:1.8.0_60]
	at
com.jcraft.jsch.Channel$MyPipedInputStream.updateReadSide(Channel.java:362)
~[jsch-0.1.53.jar:?]
	at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1543)
~[jsch-0.1.53.jar:?]
	at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1526)
~[jsch-0.1.53.jar:?]
	at
org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:588)
~[camel-ftp-2.16.0.jar:2.16.0]
	... 13 more

What could be the issue here? I tried to play with the 'disconnect' and the
'stepwise' flag, but it does not resolve the issue. Thanks for your help.




--
View this message in context: http://camel.465427.n5.nabble.com/sFTP-listFiles-does-not-work-after-upgrade-from-2-15-x-to-2-16-0-tp5774379.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: sFTP 'listFiles' does not work after upgrade from 2.15.x to 2.16.0

Posted by Claus Ibsen <cl...@gmail.com>.
What is the latest working 2.15.x version you can use? And mind that
2.15.5 is on the way, so maybe give that a test too.
http://camel.465427.n5.nabble.com/VOTE-Release-Apache-Camel-2-15-5-td5774324.html

Then we/you can do some source code compare, and commit history to
track down what changes may cause a problem for you.

On Wed, Nov 25, 2015 at 10:30 AM, nicoruti
<ni...@diligent-it.com> wrote:
> Thanks, Claus, for your quick response.
>
> Indeed, jcraft went up from 0.1.51 to 0.1.53. But switching back to the old
> version leads to the same error.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/sFTP-listFiles-does-not-work-after-upgrade-from-2-15-x-to-2-16-0-tp5774379p5774382.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: sFTP 'listFiles' does not work after upgrade from 2.15.x to 2.16.0

Posted by nicoruti <ni...@diligent-it.com>.
Thanks, Claus, for your quick response. 

Indeed, jcraft went up from 0.1.51 to 0.1.53. But switching back to the old
version leads to the same error.



--
View this message in context: http://camel.465427.n5.nabble.com/sFTP-listFiles-does-not-work-after-upgrade-from-2-15-x-to-2-16-0-tp5774379p5774382.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: sFTP 'listFiles' does not work after upgrade from 2.15.x to 2.16.0

Posted by Claus Ibsen <cl...@gmail.com>.
Maybe its jcraft version change. Try using the same version of jcraft as before.

On Wed, Nov 25, 2015 at 10:05 AM, nicoruti
<ni...@diligent-it.com> wrote:
> Dear camel-community
>
> I have the following route (simplified):
>
> RemoteFileEndpoint ftpEndpoint =
> endpoint("sftp:ftp.myhost.com/?username=user&password=xxxxx&delay=43200000&disconnect=true",
> RemoteFileEndpoint.class);
> ftpEndpoint.setFilter(new MyDownloadFileFilter());
> from(ftpEndpoint)
>          .to("file:{{configured.dl.dir}}")
>          .log("Downloaded ${header.CamelFileName} over FTP")
>          .to("direct:further-processing")
> .end();
>
>
> This route worked as expected and I could download all files that are
> accepted by MyDownloadFileFilter.
> After upgrading from 2.15.x to the latest camel version 2.16.0, I faced the
> following exception:
>
>
> WARN ] 2015-11-25 09:41:12.988 [Camel (camel-1) thread #2 -
> sftp://ftp.myhost.com/] RemoteFilePollingConsumerPollStrategy - Trying to
> recover by disconnecting from remote server forcing a re-connect at next
> poll: sftp://user@ftp.myhost.com:22
> [WARN ] 2015-11-25 09:41:12.993 [Camel (camel-1) thread #2 -
> sftp://ftp.myhost.com/] SftpConsumer - Consumer
> Consumer[sftp://ftp.myhost.com/?delay=43200000&disconnect=true&password=xxxxxx&username=user]
> failed polling endpoint:
> Endpoint[sftp://ftp.myhost.com/?delay=43200000&disconnect=true&password=xxxxxx&username=user].
> Will try again at next poll. Caused by:
> [org.apache.camel.component.file.GenericFileOperationFailedException -
> Cannot list directory: .]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> list directory: .
>         at
> org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:597)
> ~[camel-ftp-2.16.0.jar:2.16.0]
>         at
> org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:574)
> ~[camel-ftp-2.16.0.jar:2.16.0]
>         at
> org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:115)
> ~[camel-ftp-2.16.0.jar:2.16.0]
>         at
> org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:79)
> ~[camel-ftp-2.16.0.jar:2.16.0]
>         at
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:119)
> ~[camel-core-2.16.0.jar:2.16.0]
>         at
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
> [camel-core-2.16.0.jar:2.16.0]
>         at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
> [camel-core-2.16.0.jar:2.16.0]
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> [?:1.8.0_60]
>         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
> [?:1.8.0_60]
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
> [?:1.8.0_60]
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
> [?:1.8.0_60]
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> [?:1.8.0_60]
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> [?:1.8.0_60]
>         at java.lang.Thread.run(Thread.java:745) [?:1.8.0_60]
> Caused by: com.jcraft.jsch.SftpException:
>         at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1720)
> ~[jsch-0.1.53.jar:?]
>         at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1526)
> ~[jsch-0.1.53.jar:?]
>         at
> org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:588)
> ~[camel-ftp-2.16.0.jar:2.16.0]
>         ... 13 more
> Caused by: java.io.IOException: Pipe closed
>         at java.io.PipedInputStream.read(PipedInputStream.java:307) ~[?:1.8.0_60]
>         at
> com.jcraft.jsch.Channel$MyPipedInputStream.updateReadSide(Channel.java:362)
> ~[jsch-0.1.53.jar:?]
>         at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1543)
> ~[jsch-0.1.53.jar:?]
>         at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1526)
> ~[jsch-0.1.53.jar:?]
>         at
> org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:588)
> ~[camel-ftp-2.16.0.jar:2.16.0]
>         ... 13 more
>
> What could be the issue here? I tried to play with the 'disconnect' and the
> 'stepwise' flag, but it does not resolve the issue. Thanks for your help.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/sFTP-listFiles-does-not-work-after-upgrade-from-2-15-x-to-2-16-0-tp5774379.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2