Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1E5A1200CF7 for ; Tue, 19 Sep 2017 15:49:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1D07E1609DD; Tue, 19 Sep 2017 13:49:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3B7B01609DB for ; Tue, 19 Sep 2017 15:49:10 +0200 (CEST) Received: (qmail 86523 invoked by uid 500); 19 Sep 2017 13:49:05 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 86484 invoked by uid 99); 19 Sep 2017 13:49:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Sep 2017 13:49:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 996ED183C5D for ; Tue, 19 Sep 2017 13:49:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.201 X-Spam-Level: X-Spam-Status: No, score=-99.201 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id UF1-996Koe97 for ; Tue, 19 Sep 2017 13:49:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 67C9C5FCC3 for ; Tue, 19 Sep 2017 13:49:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 33F35E0F18 for ; Tue, 19 Sep 2017 13:49:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id A30FB24514 for ; Tue, 19 Sep 2017 13:49:00 +0000 (UTC) Date: Tue, 19 Sep 2017 13:49:00 +0000 (UTC) From: =?utf-8?Q?=C3=96nder_Sezgin_=28JIRA=29?= To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CAMEL-11754) Apache Camel FTP getting Cannot retrieve file: RemoteFile error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 19 Sep 2017 13:49:11 -0000 [ https://issues.apache.org/jira/browse/CAMEL-11754?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] =C3=96nder Sezgin updated CAMEL-11754: --------------------------------- Priority: Minor (was: Major) > Apache Camel FTP getting Cannot retrieve file: RemoteFile error > --------------------------------------------------------------- > > Key: CAMEL-11754 > URL: https://issues.apache.org/jira/browse/CAMEL-11754 > Project: Camel > Issue Type: Bug > Components: camel-ftp > Affects Versions: 2.19.0 > Environment: Windows 10 x64 > jdk1.8.0_131 > Camel 2.19.0 > Reporter: dheitzer > Assignee: =C3=96nder Sezgin > Priority: Minor > > I'm receiving an error from the FTP Component when its processing files i= n Camel 2.19.0. > I'm trying to retrieve files using the Camel FTP component (Camel 2.19.0)= : > from("ftp://my.host.com:21/my/relative/directory?download=3Dtrue&stepwise= =3Dfalse&delete=3Dfalse") > {code:java} > org.apache.camel.component.file.GenericFileOperationFailedException: Cann= ot retrieve file: RemoteFile[my/relative/directory/file1.txt] from: ftp://m= y.host.com:21/my/relative/directory?delete=3Dfalse&download=3Dtrue&stepwise= =3Dfalse > at org.apache.camel.component.file.GenericFileConsumer.processExchang= e(GenericFileConsumer.java:427) > at org.apache.camel.component.file.remote.RemoteFileConsumer.processE= xchange(RemoteFileConsumer.java:137) > at org.apache.camel.component.file.GenericFileConsumer.processBatch(G= enericFileConsumer.java:218) > at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFi= leConsumer.java:182) > at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollCon= sumer.java:174) > at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsu= mer.java:101) > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java= :511) > at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) > at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTa= sk.access$301(ScheduledThreadPoolExecutor.java:180) > at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTa= sk.run(ScheduledThreadPoolExecutor.java:294) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecut= or.java:1142) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecu= tor.java:617) > at java.lang.Thread.run(Thread.java:748) > {code} > From the TRACE logs, I can see that Camel is listing the files in the dir= ectory correctly: > {code:java} > [TRACE] 2017-09-05 11:40:49,438 org.apache.camel.component.file.remote.Ft= pConsumer - Polling directory: my/relative/directory > [TRACE] 2017-09-05 11:40:51,748 org.apache.camel.component.file.remote.Ft= pOperations - listFiles(my/relative/directory) > [TRACE] 2017-09-05 11:40:58,657 org.apache.camel.component.file.remote.Ft= pConsumer - Found 3 in directory: my/relative/directory > [TRACE] 2017-09-05 11:40:58,657 org.apache.camel.component.file.remote.Ft= pConsumer - FtpFile[name=3D/absolute/path/to/directory/file1.txt, dir=3Dfal= se, file=3Dtrue] > [TRACE] 2017-09-05 11:40:58,657 org.apache.camel.component.file.remote.Ft= pConsumer - FtpFile[name=3D/absolute/path/to/directory/file2.txt, dir=3Dfal= se, file=3Dtrue] > [TRACE] 2017-09-05 11:40:58,657 org.apache.camel.component.file.remote.Ft= pConsumer - FtpFile[name=3D/absolute/path/to/directory/file3.txt, dir=3Dfal= se, file=3Dtrue] > {code} > When Camel tries to process each file however, it appears to be prependin= g the relative directory to the absolute directory and failing to find the = resulting garbled path: > {code:java} > [TRACE] 2017-09-05 11:40:59,417 org.apache.camel.component.file.remote.Ft= pConsumer - Processing file: RemoteFile[absolute/path/to/directory/file1.tx= t] > [TRACE] 2017-09-05 11:40:59,418 org.apache.camel.component.file.remote.Ft= pConsumer - Retrieving file: my/relative/directory//absolute/path/to/direct= ory/file1.txt from: ftp://my.host.com:21/my/relative/directory?delete=3Dfal= se&download=3Dtrue&stepwise=3Dfalse > [TRACE] 2017-09-05 11:40:59,418 org.apache.camel.component.file.remote.Ft= pOperations - retrieveFile(my/relative/directory//absolute/path/to/director= y/file1.txt) > [TRACE] 2017-09-05 11:40:59,418 org.apache.camel.component.file.remote.Ft= pOperations - 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.Ft= pConsumer - Error processing file RemoteFile[absolute/path/to/directory/fil= e1.txt] due to Cannot retrieve file: RemoteFile[absolute/path/to/directory/= file1.txt] from: ftp://my.host.com:21/my/relative/directory?delete=3Dfalse&= download=3Dtrue&stepwise=3Dfalse > {code} > This path in the logs constructed by the FTPComponent is incorrect: > {noformat} > Retrieving file: my/relative/directory//absolute/path/to/directory/file1.= txt > {noformat} > I debugged the Camel FTP consumer and it looks like > [on line 238 is where the relative path is getting prepended to the absol= ute path|https://github.com/apache/camel/blob/camel-2.19.x/components/camel= -ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java#= L238] > Interestingly enough, [the SFTP component is doing the same thing|https:/= /github.com/apache/camel/blob/camel-2.19.x/components/camel-ftp/src/main/ja= va/org/apache/camel/component/file/remote/SftpConsumer.java#L208] however i= t is working because=20 > {code:java} > RemoteFileOperations > {code} > does not set filename as an absolute path but=20 > {code:java} > RemoteFileOperations > {code} > does. > Does anyone have any suggestions to work around this to get the FTP Conpo= nent to consume the files? or am I doing something incorrectly? > I'm using Camel 2.19.0 -- This message was sent by Atlassian JIRA (v6.4.14#64029)