On Wed, Dec 14, 2011 at 1:44 PM, Kalpak Gadre <[email protected]> wrote: > Hi, > > I am working with a route which transfers files over SFTP. The route had > trouble in case where there was inactivity for more than SSH session timeout > period. Whenever an exchange was initiated after long duration of > inactivity, it would fail due to "Connection reset by peer" which I assume > is because SSH server dropped the session due to inactivity. > > To fix this problem, I added disconnect=true to ensure that every transfer > reconnects to the SSH session. After adding this though, I am seeing issues > transferring files. Here are log snippets, > > 2011-12-12 18:01:24,159 | DEBUG | Wrote [/tmp/NSE/FILE_20111212.txt] to > [Endpoint[sftp://10.0.0.1//tmp/NSE/?disconnect=true&password=******&username=user]] > 2011-12-12 18:01:24,159 | TRACE | postWriteCheck disconnect from: > Endpoint[sftp://10.0.0.1//tmp/NSE/?disconnect=true&password=******&username=user] > 2011-12-12 18:01:24,159 | DEBUG | Disconnecting from: > Endpoint[sftp://10.0.0.1//tmp/NSE/?disconnect=true&password=******&username=user] > 2011-12-12 18:01:24,159 | INFO | JSCH -> Disconnecting from 10.0.0.1 port > 22 > 2011-12-12 18:01:24,159 | INFO | JSCH -> Caught an exception, leaving main > loop due to socket closed > > Although the log suggests that the file is written and then route is trying > to disconnect as a part of postWriteCheck, the file is not written on the > server. Not sure if it is due to unsafe disconnect from the SSH server. > > Any suggestions what could be wrong? >
I suggest to enable DEBUG/TRACE logging of the JSCH library to see more details why it fails, and what the exception is etc. > Thanks, > > Kalpak -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
