Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12061

SFTP exception-handling more problemtatic than documented

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.20.1
    • 2.21.0
    • camel-sftp
    • java 8, windows 2008 r2,

    • Unknown

    Description

      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
      }}

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            dvholten Dieter von Holten
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: