camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "dheitzer (JIRA)" <>
Subject [jira] [Created] (CAMEL-11754) Apache Camel FTP getting Cannot retrieve file: RemoteFile error
Date Wed, 06 Sep 2017 13:38:00 GMT
dheitzer created CAMEL-11754:

             Summary: Apache Camel FTP getting Cannot retrieve file: RemoteFile error
                 Key: CAMEL-11754
             Project: Camel
          Issue Type: Bug
          Components: camel-ftp
    Affects Versions: 2.19.0
         Environment: Windows 10 x64
Camel 2.19.0
            Reporter: dheitzer

I'm receiving an error from the FTP Component when its processing files in Camel 2.19.0.

I'm trying to retrieve files using the Camel FTP component (Camel 2.19.0):



org.apache.camel.component.file.GenericFileOperationFailedException: Cannot retrieve file:
RemoteFile[my/relative/directory/file1.txt] from:
    at org.apache.camel.component.file.GenericFileConsumer.processExchange(
    at org.apache.camel.component.file.remote.RemoteFileConsumer.processExchange(
    at org.apache.camel.component.file.GenericFileConsumer.processBatch(
    at org.apache.camel.component.file.GenericFileConsumer.poll(
    at org.apache.camel.impl.ScheduledPollConsumer.doRun(
    at java.util.concurrent.Executors$
    at java.util.concurrent.FutureTask.runAndReset(
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(
    at java.util.concurrent.ScheduledThreadPoolExecutor$
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$

>From the TRACE logs, I can see that Camel is listing the files in the directory correctly:


[TRACE] 2017-09-05 11:40:49,438 org.apache.camel.component.file.remote.FtpConsumer - Polling
directory: my/relative/directory
[TRACE] 2017-09-05 11:40:51,748 org.apache.camel.component.file.remote.FtpOperations - listFiles(my/relative/directory)
[TRACE] 2017-09-05 11:40:58,657 org.apache.camel.component.file.remote.FtpConsumer - Found
3 in directory: my/relative/directory
[TRACE] 2017-09-05 11:40:58,657 org.apache.camel.component.file.remote.FtpConsumer - FtpFile[name=/absolute/path/to/directory/file1.txt,
dir=false, file=true]
[TRACE] 2017-09-05 11:40:58,657 org.apache.camel.component.file.remote.FtpConsumer - FtpFile[name=/absolute/path/to/directory/file2.txt,
dir=false, file=true]
[TRACE] 2017-09-05 11:40:58,657 org.apache.camel.component.file.remote.FtpConsumer - FtpFile[name=/absolute/path/to/directory/file3.txt,
dir=false, file=true]


When Camel tries to process each file however, it appears to be prepending the relative directory
to the absolute directory and failing to find the resulting garbled path:


[TRACE] 2017-09-05 11:40:59,417 org.apache.camel.component.file.remote.FtpConsumer - Processing
file: RemoteFile[absolute/path/to/directory/file1.txt]
[TRACE] 2017-09-05 11:40:59,418 org.apache.camel.component.file.remote.FtpConsumer - Retrieving
file: my/relative/directory//absolute/path/to/directory/file1.txt from:
[TRACE] 2017-09-05 11:40:59,418 org.apache.camel.component.file.remote.FtpOperations - retrieveFile(my/relative/directory//absolute/path/to/directory/file1.txt)
[TRACE] 2017-09-05 11:40:59,418 org.apache.camel.component.file.remote.FtpOperations - Client
retrieveFile: my/relative/directory//absolute/path/to/directory/file1.txt
[WARN ] 2017-09-05 11:40:59,518 org.apache.camel.component.file.remote.FtpConsumer - Error
processing file RemoteFile[absolute/path/to/directory/file1.txt] due to Cannot retrieve file:
RemoteFile[absolute/path/to/directory/file1.txt] from:


This path in the logs constructed by the FTPComponent is incorrect:

Retrieving file: my/relative/directory//absolute/path/to/directory/file1.txt

I debugged the Camel FTP consumer and it looks like
[[on line 238 is where the relative path is getting prepended to the absolute path|]

Interestingly enough, [the SFTP component is doing the same thing|]
however it is working because 
 does not set filename as an absolute path but 

Does anyone have any suggestions to work around this to get the FTP Conponent to consume the
files? or am I doing something incorrectly?

I'm using Camel 2.19.0

This message was sent by Atlassian JIRA

View raw message