[ 
https://issues.apache.org/jira/browse/CAMEL-6591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stephan Siano updated CAMEL-6591:
---------------------------------

    Attachment: 0001-CAMEL-6591-SFTP-endpoint-fails-if-the-server-disconn.patch

test and patch to reconnect closed connections without failing in SFTP
                
> SFTP endpoint fails if the server disconnected the socket
> ---------------------------------------------------------
>
>                 Key: CAMEL-6591
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6591
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.11.1
>            Reporter: Stephan Siano
>         Attachments: 
> 0001-CAMEL-6591-SFTP-endpoint-fails-if-the-server-disconn.patch
>
>
> If the ssh server disconnects the socket held by an SFTP endpoint (and the 
> disconnect option is not set to true) the next call to this endpoint will 
> fail. A call after the failed call will reconnect (and succeed if the server 
> is available again).
> The error message is as follows:
> SftpSimpleProduceDisconnectTest
> org.apache.camel.component.file.remote.sftp.SftpSimpleProduceDisconnectTest
> testSftpSimpleProduce(org.apache.camel.component.file.remote.sftp.SftpSimpleProduceDisconnectTest)
> org.apache.camel.CamelExecutionException: Exception occurred during execution 
> on the exchange: Exchange[Message: Hello World]
>       at 
> org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1360)
>       at 
> org.apache.camel.util.ExchangeHelper.extractResultBody(ExchangeHelper.java:619)
>       at 
> org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:454)
>       at 
> org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:450)
>       at 
> org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:152)
>       at 
> org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:146)
>       at 
> org.apache.camel.component.file.remote.sftp.SftpSimpleProduceDisconnectTest.testSftpSimpleProduce(SftpSimpleProduceDisconnectTest.java:50)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>       at java.lang.reflect.Method.invoke(Unknown Source)
>       at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
>       at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>       at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
>       at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>       at 
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>       at 
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
>       at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
>       at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>       at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
>       at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
>       at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>       at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
>       at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
>       at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
>       at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
>       at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
>       at 
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>       at 
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
>       at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
>       at 
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
>       at 
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> Caused by: 
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot 
> change directory to: target
>       at 
> org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:536)
>       at 
> org.apache.camel.component.file.remote.SftpOperations.changeCurrentDirectory(SftpOperations.java:524)
>       at 
> org.apache.camel.component.file.remote.SftpOperations.storeFile(SftpOperations.java:771)
>       at 
> org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:278)
>       at 
> org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:166)
>       at 
> org.apache.camel.component.file.remote.RemoteFileProducer.process(RemoteFileProducer.java:49)
>       at 
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
>       at 
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:192)
>       at 
> org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:73)
>       at 
> org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:366)
>       at 
> org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:1)
>       at 
> org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:233)
>       at 
> org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:337)
>       at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:175)
>       at 
> org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:111)
>       at 
> org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:150)
>       ... 31 more
> Caused by: 4: 
>       at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:332)
>       at 
> org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:534)
>       ... 46 more
> Caused by: java.io.IOException: Pipe closed
>       at java.io.PipedInputStream.read(Unknown Source)
>       at java.io.PipedInputStream.read(Unknown Source)
>       at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2665)
>       at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2691)
>       at com.jcraft.jsch.ChannelSftp._realpath(ChannelSftp.java:2148)
>       at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:315)
>       ... 47 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to