You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Shing Hing Man <ma...@yahoo.com> on 2014/04/24 19:46:03 UTC

Sftp timeout exception in less regular frequency

Hi,

I am using Camel 2.12.3. 

I am using   sftp to ftp files from folder 

                 /tmp/segment/service/ftpOut

 
from(file:/tmp/segment/service/ftpOut?move=/tmp/segment/service/ftpDone/${file:name}&recursive=true)
.to( sftp://foo@remote.com/test?preferredAuthentications=publickey&privateKeyFile=/home/foo/ftpKey/id_rsa&tempFileName=${file:onlyname}.tmp)


If files are dropped into  folder ftpOut every minute,   the files will be sftp successfully. 

If a file is dropped  in the folder ftpOut,  5 minutes after the prevuious one, it would stay in ftpOut until a timeout exception.


2014-04-24 17:27:00,524 INFO  o.a.c.c.file.remote.SftpOperations  - JSCH -> Caught an exception, leaving main loop due to Connection timed out
2014-04-24 17:27:00,524 INFO  o.a.c.c.file.remote.SftpOperations  - JSCH -> Disconnecting from remote.com port 22
2014-04-24 17:27:00,525 WARN  o.a.c.c.f.remote.RemoteFileProducer  - Writing file failed with: 
2014-04-24 17:27:00,529 ERROR o.a.c.processor.DefaultErrorHandler  - Failed delivery for (MessageId: ID-segservicetest-37765-1398356832592-0-35 on ExchangeId: ID-segservicetest-37765-1398356832592-0-36). Exhausted after delivery attempt: 1 caught: org.apache.camel.component.file.GenericFileOperationFailedException: 

Message History
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
[uploadSegments    ] [uploadSegments    ] [file:///home/foo/segService/ftp/ftpOut?move=%2Fhome%2Ffoo%2FsegSer] [    932942]
[uploadSegments    ] [log2              ] [log                                                                           ] [         1]
[uploadSegments    ] [to5               ] [sftp:/foo@remote.com/custom_segments/upload/?preferr] [    932941]


I have looked at the documentation of sftp and can not configure  out which timeout parameter is the problem.

it would be appreciated if someone could point out what I have done wrong.

Thanks in advance for any assistance!

Shing

Re: Sftp timeout exception in less regular frequency

Posted by Shing Hing Man <ma...@yahoo.com>.
Setting the parameter serverAliveInterval to 60, say, keeps the connection alive and get rides of  the timout exception.

Shing

On Thursday, 24 April 2014, 18:46, Shing Hing Man <ma...@yahoo.com> wrote:
 
Hi,

I am using Camel 2.12.3. 

I am using   sftp to ftp files from folder 

                 /tmp/segment/service/ftpOut

 
from(file:/tmp/segment/service/ftpOut?move=/tmp/segment/service/ftpDone/${file:name}&recursive=true)
.to( sftp://foo@remote.com/test?preferredAuthentications=publickey&privateKeyFile=/home/foo/ftpKey/id_rsa&tempFileName=${file:onlyname}.tmp)


If files are dropped into  folder ftpOut every minute,   the files will be sftp successfully. 

If a file is dropped  in the folder ftpOut,  5 minutes after the prevuious one, it would stay in ftpOut until a timeout exception.


2014-04-24 17:27:00,524 INFO  o.a.c.c.file.remote.SftpOperations  - JSCH -> Caught an exception, leaving main loop due to Connection timed out
2014-04-24 17:27:00,524 INFO  o.a.c.c.file.remote.SftpOperations  - JSCH -> Disconnecting from remote.com port 22
2014-04-24 17:27:00,525 WARN  o.a.c.c.f.remote.RemoteFileProducer  - Writing file failed with: 
2014-04-24 17:27:00,529 ERROR o.a.c.processor.DefaultErrorHandler  - Failed delivery for (MessageId: ID-segservicetest-37765-1398356832592-0-35 on ExchangeId: ID-segservicetest-37765-1398356832592-0-36). Exhausted after delivery attempt: 1 caught: org.apache.camel.component.file.GenericFileOperationFailedException: 

Message History
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
[uploadSegments    ] [uploadSegments    ] [file:///home/foo/segService/ftp/ftpOut?move=%2Fhome%2Ffoo%2FsegSer] [    932942]
[uploadSegments    ] [log2              ] [log                                                                           ] [         1]
[uploadSegments    ] [to5               ] [sftp:/foo@remote.com/custom_segments/upload/?preferr] [    932941]


I have looked at the documentation of sftp and can not configure  out which timeout parameter is the problem.

it would be appreciated if someone could point out what I have done wrong.

Thanks in advance for any assistance!

Shing