You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Lorrin Nelson <lh...@nerdylorrin.net> on 2010/09/29 00:38:52 UTC

sftp -> seda yields GenericFileOperationFailedException during GenericFileOnCompletion move processing

Is there a reason that an sftp->seda route would fail? In both examples below, uri is like "sftp://test@host/mult?include=.*.log&move=.done&password=******

This works as expected:
        from(uri).to("direct:foobar");
        from("direct:foobar").log("${body}");

But this fails. It does log the contents of the file, but then dies trying to move the file. Exception below.
        from(uri).to("seda:foobar");
        from("seda:foobar").log("${body}");

Thanks for any advice!
-Lorrin

RemoteFilePollingConsumerPollStrategy 2010-09-28 15:31:54,525 -- WARN -- Trying to recover by disconnecting from remote server forcing a re-connect at next poll: sftp://test@host:22
SftpOperations 2010-09-28 15:31:54,526 -- INFO -- JSCH -> Disconnecting from host port 22
RemoteFilePollingConsumerPollStrategy 2010-09-28 15:31:54,582 -- WARN -- Consumer Consumer[sftp://test@host/mult?include=.*.log&move=.done&password=J3fp69z%40] could not poll endpoint: sftp://test@host/mult?include=.*.log&move=.done&password=J3fp69z%40 caused by: Cannot list directory: mult
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot list directory: mult
	at org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:377)
	at org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:54)
	at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:83)
	at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:97)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:637)
Caused by: 2: No such file
	at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2289)
	at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1741)
	at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:1758)
	at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1196)
	at org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:368)
	... 12 more
GenericFileOnCompletion 2010-09-28 15:31:54,587 -- ERROR -- Caused by: [org.apache.camel.component.file.GenericFileOperationFailedException - Cannot change current directory to: /home/test]
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot change current directory to: /home/test
	at org.apache.camel.component.file.remote.SftpOperations.changeCurrentDirectory(SftpOperations.java:352)
	at org.apache.camel.component.file.remote.SftpOperations.buildDirectory(SftpOperations.java:304)
	at org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:89)
	at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:83)
	at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:121)
	at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:83)
	at org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:52)
	at org.apache.camel.util.UnitOfWorkHelper.doneSynchronizations(UnitOfWorkHelper.java:55)
	at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:173)
	at org.apache.camel.processor.UnitOfWorkProcessor.doneUow(UnitOfWorkProcessor.java:121)
	at org.apache.camel.processor.UnitOfWorkProcessor.access$000(UnitOfWorkProcessor.java:36)
	at org.apache.camel.processor.UnitOfWorkProcessor$1.done(UnitOfWorkProcessor.java:106)
	at org.apache.camel.processor.DefaultChannel$1.done(DefaultChannel.java:262)
	at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:328)
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:206)
	at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
	at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99)
	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
	at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:169)
	at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:111)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:637)
Caused by: 4: 
	at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:285)
	at org.apache.camel.component.file.remote.SftpOperations.changeCurrentDirectory(SftpOperations.java:350)
	... 26 more
Caused by: java.io.IOException: Pipe closed
	at java.io.PipedInputStream.read(PipedInputStream.java:291)
	at java.io.PipedInputStream.read(PipedInputStream.java:361)
	at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2325)
	at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2351)
	at com.jcraft.jsch.ChannelSftp._realpath(ChannelSftp.java:1810)
	at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:268)
	... 27 more

RE: sftp -> seda yields GenericFileOperationFailedException during GenericFileOnCompletion move processing

Posted by GegeFR <gw...@ericsson.com>.
Alleluia !

I had an hunch when i saw that sometimes I had exceptions like :
"SSH_MSG_DISCONNECT: 2 Packet corrupt". So that meant that somehow the
software is sending garbage to the SSH server.

And i found ... Well ... To make it short :
 - The Jsch ChannelSftp is not thread-safe...
 - When introducing SEDA or DISRUPTOR we add asynchrous behaviors and thus
try to do concurrent file operations...

To validate I copied "org.apache.camel.component.file.remote.SftpOperations"
into my own sources and added the synchronized keyword in from of every
public method and now it works perfectly, no more exceptions.

So I have now my workaround ... Is someone able to elaborate a proper fix
with only the necessary and smart synchronisations ?



--
View this message in context: http://camel.465427.n5.nabble.com/sftp-seda-yields-GenericFileOperationFailedException-during-GenericFileOnCompletion-move-processing-tp2905598p5768365.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: sftp -> seda yields GenericFileOperationFailedException during GenericFileOnCompletion move processing

Posted by Sven Nold <Sv...@isb-ag.de>.
Hi,

the same issue exists on 

sftp/file => disruptor 

It seems something with the BatchConsumer (file). My current "bad solution" to use wiretap to leave that processing.
Would be great to hear a better solution.


-----Original Message-----
From: GegeFR [mailto:gwenhael.pasquiers@ericsson.com] 
Sent: Thursday, June 18, 2015 10:08 AM
To: users@camel.apache.org
Subject: Re: sftp -> seda yields GenericFileOperationFailedException during GenericFileOnCompletion move processing

Hi, 

I'm digging this up but 5 years later I'm meeting the exact same issue.

sftp => seda => anything causes this type of errors.

Anybody has any idea about that issue nowadays ?



--
View this message in context: http://camel.465427.n5.nabble.com/sftp-seda-yields-GenericFileOperationFailedException-during-GenericFileOnCompletion-move-processing-tp2905598p5768349.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: sftp -> seda yields GenericFileOperationFailedException during GenericFileOnCompletion move processing

Posted by GegeFR <gw...@ericsson.com>.
Hi, 

I'm digging this up but 5 years later I'm meeting the exact same issue.

sftp => seda => anything causes this type of errors.

Anybody has any idea about that issue nowadays ?



--
View this message in context: http://camel.465427.n5.nabble.com/sftp-seda-yields-GenericFileOperationFailedException-during-GenericFileOnCompletion-move-processing-tp2905598p5768349.html
Sent from the Camel - Users mailing list archive at Nabble.com.