Results 1 to 7 of 7

Thread: Sftp Inbound Channel, Failure No Recovery

  1. #1
    Join Date
    Aug 2010
    Posts
    10

    Default Sftp Inbound Channel, Failure No Recovery

    I have a situation where I have a sftp inbound channel pooling the remote sftp folder every 30 seconds. It has happened where I have gotten an exception when performing a directory list. When this happens the poller stops and I have to restart the application in order for the polller to start again. Is there a way for spring-integration to recover from such exceptions?

    Attached is the stack trace:


    Not sure what is going on with the VAOnce service but we had another problem this morning. We got the following error before 5am and it never pulled the files until I bounced the service:
    2011-02-01 04:56:52,054 ERROR gov.va.vaonce.eip.handler.MessageHandler : EIP Process faiiled message
    org.springframework.integration.MessagingException : Problem occurred while synchronizing remote to local directory
    at org.springframework.integration.file.remote.synchr onizer.AbstractInboundFileSynchronizer.synchronize ToLocalDirectory(AbstractInboundFileSynchronizer.j ava:129)
    at org.springframework.integration.file.remote.synchr onizer.AbstractInboundFileSynchronizingMessageSour ce.receive(AbstractInboundFileSynchronizingMessage Source.java:132)
    at org.springframework.integration.endpoint.SourcePol lingChannelAdapter.doPoll(SourcePollingChannelAdap ter.java:89)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$1.call(AbstractPollingEndpoint.java :116)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$1.call(AbstractPollingEndpoint.java :114)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$Poller$1.run(AbstractPollingEndpoin t.java:179)
    at org.springframework.integration.util.ErrorHandling TaskExecutor$1.run(ErrorHandlingTaskExecutor.java: 52)
    at org.springframework.core.task.SyncTaskExecutor.exe cute(SyncTaskExecutor.java:48)
    at org.springframework.integration.util.ErrorHandling TaskExecutor.execute(ErrorHandlingTaskExecutor.jav a:49)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$Poller.run(AbstractPollingEndpoint. java:174)
    at org.springframework.scheduling.support.DelegatingE rrorHandlingRunnable.run(DelegatingErrorHandlingRu nnable.java:51)
    at org.springframework.scheduling.concurrent.Reschedu lingRunnable.run(ReschedulingRunnable.java:81)
    at java.util.concurrent.Executors$RunnableAdapter.cal l(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.jav a:138)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.access$301(ScheduledThreadPoolE xecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.run(ScheduledThreadPoolExecutor .java:207)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.io.IOException: Failed to list files
    at org.springframework.integration.sftp.session.SftpS ession.list(SftpSession.java:82)
    at org.springframework.integration.sftp.session.SftpS ession.list(SftpSession.java:42)
    at org.springframework.integration.file.remote.sessio n.CachingSessionFactory$CachedSession.list(Caching SessionFactory.java:125)
    at org.springframework.integration.file.remote.synchr onizer.AbstractInboundFileSynchronizer.synchronize ToLocalDirectory(AbstractInboundFileSynchronizer.j ava:118)
    ... 19 more
    Caused by: 4:
    at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java :1751)
    at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java :1758)
    at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:11 96)
    at org.springframework.integration.sftp.session.SftpS ession.list(SftpSession.java:70)
    ... 22 more
    Caused by: java.io.IOException: inputstream is closed
    at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java: 2327)
    at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.jav a:2351)
    at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java :1732)
    ... 25 more
    2011-02-01 04:56:52,070 ERROR gov.va.vaonce.eip.handler.MessageHandler : org.springframework.integration.MessagingException : Problem occurred while synchronizing remote to local directory
    2011-02-01 04:57:20,600 ERROR gov.va.vaonce.eip.handler.MessageHandler : EIP Process faiiled message
    org.springframework.integration.MessagingException : Problem occurred while synchronizing remote to local directory
    at org.springframework.integration.file.remote.synchr onizer.AbstractInboundFileSynchronizer.synchronize ToLocalDirectory(AbstractInboundFileSynchronizer.j ava:129)
    at org.springframework.integration.file.remote.synchr onizer.AbstractInboundFileSynchronizingMessageSour ce.receive(AbstractInboundFileSynchronizingMessage Source.java:132)
    at org.springframework.integration.endpoint.SourcePol lingChannelAdapter.doPoll(SourcePollingChannelAdap ter.java:89)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$1.call(AbstractPollingEndpoint.java :116)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$1.call(AbstractPollingEndpoint.java :114)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$Poller$1.run(AbstractPollingEndpoin t.java:179)
    at org.springframework.integration.util.ErrorHandling TaskExecutor$1.run(ErrorHandlingTaskExecutor.java: 52)
    at org.springframework.core.task.SyncTaskExecutor.exe cute(SyncTaskExecutor.java:48)
    at org.springframework.integration.util.ErrorHandling TaskExecutor.execute(ErrorHandlingTaskExecutor.jav a:49)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$Poller.run(AbstractPollingEndpoint. java:174)
    at org.springframework.scheduling.support.DelegatingE rrorHandlingRunnable.run(DelegatingErrorHandlingRu nnable.java:51)
    at org.springframework.scheduling.concurrent.Reschedu lingRunnable.run(ReschedulingRunnable.java:81)
    at java.util.concurrent.Executors$RunnableAdapter.cal l(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.jav a:138)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.access$301(ScheduledThreadPoolE xecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.run(ScheduledThreadPoolExecutor .java:207)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.io.IOException: Failed to list files
    at org.springframework.integration.sftp.session.SftpS ession.list(SftpSession.java:82)
    at org.springframework.integration.sftp.session.SftpS ession.list(SftpSession.java:42)
    at org.springframework.integration.file.remote.sessio n.CachingSessionFactory$CachedSession.list(Caching SessionFactory.java:125)
    at org.springframework.integration.file.remote.synchr onizer.AbstractInboundFileSynchronizer.synchronize ToLocalDirectory(AbstractInboundFileSynchronizer.j ava:118)
    ... 19 more
    Caused by: 4:
    at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java :1751)
    at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java :1758)
    at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:11 96)
    at org.springframework.integration.sftp.session.SftpS ession.list(SftpSession.java:70)
    ... 22 more
    Caused by: java.io.IOException: inputstream is closed
    at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java: 2327)
    at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.jav a:2351)
    at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java :1732)
    ... 25 more
    2011-02-01 04:57:20,616 ERROR gov.va.vaonce.eip.handler.MessageHandler : org.springframework.integration.MessagingException : Problem occurred while synchronizing remote to local directory

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    What version fo Spring Integration you are using?

  3. #3
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    The reason why I am asking is because we had this issue reported and fixed for SI 2.0.1 and it seem to me from the stack trace that you are using 2.0.0.
    https://jira.springsource.org/browse/INT-1660

  4. #4
    Join Date
    Aug 2010
    Posts
    10

    Default

    I happen to be the one that submitted the defect that you referenced. I think this is happening at a higher level that is causing the poller tread to stop checking for files.

    I am currently using 2.0.1

  5. #5
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Ok, that is strange since I just ran the test that simulated this issue and after seing the same exception poling continues. Of course I am running against the snapshot build so i'll look into it more to see if there was any change related to this.

    Could you also post your configuration. I just want to make sure that my test simulates as close as possible whatever you are doing.

    Also, is it possible for you to upgrade to the snapshot

    If you are using Maven and need to know how to configure repositories read this: http://www.springsource.org/node/2962 and the version would be 2.0.2.BUILD-SNAPSHOT

  6. #6
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    ALso, could you please verify that you are using 2.0.1 and that there is no old artifacts in it.
    My concern is the following line in the stack:
    Code:
    at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:129)
    Currently in the trunk its line 136 and i can trace it to changes in https://jira.springsource.org/browse/INT-1665 which is again made for 2.0.1

  7. #7
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Have you had any chance to try it out? We are about to release SI 2.0.2 and would like to make sure this issue is addressed.
    Please let us know
    Cheers

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •