[ 
https://issues.apache.org/jira/browse/CAMEL-12061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16328526#comment-16328526
 ] 

Claus Ibsen commented on CAMEL-12061:
-------------------------------------

Can you try enabling DEBUG logging level on the ftp component, and do you see 
this line when Camel disconnects the FTP client

 

if (log.isDebugEnabled()) {
 log.debug("Disconnecting from: {}", remoteServer());
}

As Camel will attempt to disconnect if that poll failed, as the WARN message 
says.

And do you get this error all the time, eg can you reproduce it? We could try 
to improve camel-ftp to do a hard disconnect and ensure the ftp client is fully 
re-created.

> SFTP exception-handling more problemtatic than documented
> ---------------------------------------------------------
>
>                 Key: CAMEL-12061
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12061
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-sftp
>    Affects Versions: 2.20.1
>         Environment: java 8, windows 2008 r2, 
>            Reporter: dieter von holten
>            Priority: Minor
>              Labels: ioexception, sftp
>
> my poll-sftp-server-for-files-to-download route crashes fom time to time. i 
> happend to get a stacktrace which indicates an IoException when the SFTP 
> component changes the folder to inspect on the remote site. Can happen - 
> however, contrary to the documentation, which says an exception produces a 
> warning and is otherwise ignored, the whole application goes down.
> -------------------------------------------------------------------------
> {{
> Dez 04, 2017 3:45:34 PM 
> org.apache.camel.component.file.remote.RemoteFilePolling
> ConsumerPollStrategy rollback
> WARNUNG: Trying to recover by disconnecting from remote server forcing a 
> re-connect at next poll: sftp://XXXXXXXXXXXXXXXX
> Dez 04, 2017 3:45:34 PM org.apache.camel.util.CamelLogger log
> WARNUNG: Consumer 
> Consumer[sftp://XXXXXXXXXXXXX/out/prod/?delay=30000&delete=true&localWorkDirectory=c%3A%2FMarta%2FHgmTkw14%2Femcs%2Ftemp%2F&password=
> xxxxxx] failed polling endpoint: 
> sftp://XXXXXXXXXXXXX/out/prod/?delay=30000&delete=true&localWorkDirectory=c%3A%2FMarta%2FHgmTkw14%2Femcs%2Ftemp%2F&pas
> sword=xxxxxx. Will try again at next poll. Caused by: 
> [org.apache.camel.component.file.GenericFileOperationFailedException - Cannot 
> change directory to: out]
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot 
> change directory to: out
>         at 
> org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:609)
>         at 
> org.apache.camel.component.file.remote.SftpOperations.changeCurrentDirectory(SftpOperations.java:597)
>         at 
> org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:108)
>         at 
> org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:80)
>         at 
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:124)
>         at 
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
>         at 
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
>         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:607)
>         ... 13 more
> Caused by: java.io.IOException: inputstream is closed
>         at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2911)
>         at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2935)
>         at com.jcraft.jsch.ChannelSftp._realpath(ChannelSftp.java:2355)
>         at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:342)
>         ... 14 more
> }}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to