You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Wuyts Diether <di...@optis.be> on 2013/01/23 14:10:13 UTC

Producing files to ftp now working in 2.10.3

Hi,

We are trying to create a simple route that writes files to an ftp server.
But we're unable to get this to work using version 2.10.3.

However, if we use version 2.10.2 our Route is working correctly, and a file is created on the ftp server.
Below you can see 2 traces .

Our endpoint is:  ftp://testftp@192.168.100.1/Diether?password=<snip>&stepwise=false
We already tried changing the stepwise property, using //Diether as start directory, changed the path separator,...
I also found the following thread: http://mail-archives.apache.org/mod_mbox/camel-users/201010.mbox/%3c963618E6-DCCB-4BF7-BE72-BE9444A80F1F@nerdylorrin.net%3e
Which seems to be related.

Is this a bug that was recently (re-) introduced and should we consider downgrading to the previous version?
Or am I overlooking something?


Succesfull using Camel 2.10.2:
13:45:40.889 [Camel (context) thread #1 - file://c:/docdata/isexport] DEBUG o.a.c.c.f.remote.RemoteFileProducer - Not already connected/logged in. Connecting to: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
13:45:40.889 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Connecting using FTPClient: org.apache.commons.net.ftp.FTPClient@370bf5a4
13:45:40.889 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Connecting to ftp://testftp@192.168.100.1:21 using connection timeout: 10000
13:45:40.902 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Attempting to login user: testftp using password: ****
13:45:40.914 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - User testftp logged in: true
13:45:40.916 [Camel (context) thread #1 - file://c:/docdata/isexport] INFO  o.a.c.c.f.remote.RemoteFileProducer - Connected and logged in to: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
13:45:40.916 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - buildDirectory(Diether)
13:45:40.918 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Trying to build remote directory: Diether
13:45:40.922 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - changeCurrentDirectory(/)
13:45:40.922 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Changing directory: /
13:45:40.923 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.f.remote.RemoteFileProducer - About to write [Diether/DD_AI2013023134540.xml] to [Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]] from exchange [Exchange[null]]
13:45:40.923 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - storeFile(Diether/DD_AI2013023134540.xml)
13:45:40.923 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - doStoreFile(Diether/DD_AI2013023134540.xml)



Errors using Camel 2.10.3:
13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.impl.SharedProducerServicePool - Acquire: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false] service: RemoteFileProducer[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] DEBUG o.a.camel.processor.SendProcessor - >>>> Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false] Exchange[null]
13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.f.remote.RemoteFileProducer - Processing file: Diether/DD_AI201302313526.xml for exchange: Exchange[null]
13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.f.remote.RemoteFileProducer - preWriteCheck send noop success: false
13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] DEBUG o.a.c.c.f.remote.RemoteFileProducer - Not already connected/logged in. Connecting to: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Connecting using FTPClient: org.apache.commons.net.ftp.FTPClient@764af73e
13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Connecting to ftp://testftp@192.168.100.1:21 using connection timeout: 10000
13:52:06.736 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Attempting to login user: testftp using password: ****
13:52:06.750 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - User testftp logged in: true
13:52:06.752 [Camel (context) thread #0 - file://c:/docdata/isexport] INFO  o.a.c.c.f.remote.RemoteFileProducer - Connected and logged in to: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
13:52:06.752 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - buildDirectory(Diether)
13:52:06.754 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - changeCurrentDirectory(/)
13:52:06.754 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Changing directory: \\
13:52:06.755 [Camel (context) thread #0 - file://c:/docdata/isexport] WARN  o.a.c.c.f.remote.RemoteFileProducer - Writing file failed with: File operation failed: 550 Failed to change directory.
 Cannot change directory to: \\. Code: 550


Best regards,
Diether





Re: Producing files to ftp now working in 2.10.3

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Jan 23, 2013 at 2:10 PM, Wuyts Diether <di...@optis.be> wrote:
> Hi,
>
> We are trying to create a simple route that writes files to an ftp server.
> But we're unable to get this to work using version 2.10.3.
>
> However, if we use version 2.10.2 our Route is working correctly, and a file is created on the ftp server.
> Below you can see 2 traces .
>
> Our endpoint is:  ftp://testftp@192.168.100.1/Diether?password=<snip>&stepwise=false
> We already tried changing the stepwise property, using //Diether as start directory, changed the path separator,...
> I also found the following thread: http://mail-archives.apache.org/mod_mbox/camel-users/201010.mbox/%3c963618E6-DCCB-4BF7-BE72-BE9444A80F1F@nerdylorrin.net%3e
> Which seems to be related.
>
> Is this a bug that was recently (re-) introduced and should we consider downgrading to the previous version?
> Or am I overlooking something?
>

Yeah unfortunately there is some problems with the FTP component in
the latest releases, both consumer and producers.
We are working on fixing that. If you got time then fell free to test
on 2.10-SNAPSHOT. Though I am not sure if we have it fixed yet.

You may try to set the separator=Windows or Unix depending on the
target FTP server OS.
And turn stepwise=false, if your ftp server allows GET/PUT commands on
files with file paths.
Some servers requires you to CD into the actual dir first.


>
> Succesfull using Camel 2.10.2:
> 13:45:40.889 [Camel (context) thread #1 - file://c:/docdata/isexport] DEBUG o.a.c.c.f.remote.RemoteFileProducer - Not already connected/logged in. Connecting to: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
> 13:45:40.889 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Connecting using FTPClient: org.apache.commons.net.ftp.FTPClient@370bf5a4
> 13:45:40.889 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Connecting to ftp://testftp@192.168.100.1:21 using connection timeout: 10000
> 13:45:40.902 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Attempting to login user: testftp using password: ****
> 13:45:40.914 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - User testftp logged in: true
> 13:45:40.916 [Camel (context) thread #1 - file://c:/docdata/isexport] INFO  o.a.c.c.f.remote.RemoteFileProducer - Connected and logged in to: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
> 13:45:40.916 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - buildDirectory(Diether)
> 13:45:40.918 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Trying to build remote directory: Diether
> 13:45:40.922 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - changeCurrentDirectory(/)
> 13:45:40.922 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Changing directory: /
> 13:45:40.923 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.f.remote.RemoteFileProducer - About to write [Diether/DD_AI2013023134540.xml] to [Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]] from exchange [Exchange[null]]
> 13:45:40.923 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - storeFile(Diether/DD_AI2013023134540.xml)
> 13:45:40.923 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - doStoreFile(Diether/DD_AI2013023134540.xml)
>
>
>
> Errors using Camel 2.10.3:
> 13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.impl.SharedProducerServicePool - Acquire: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false] service: RemoteFileProducer[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
> 13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] DEBUG o.a.camel.processor.SendProcessor - >>>> Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false] Exchange[null]
> 13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.f.remote.RemoteFileProducer - Processing file: Diether/DD_AI201302313526.xml for exchange: Exchange[null]
> 13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.f.remote.RemoteFileProducer - preWriteCheck send noop success: false
> 13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] DEBUG o.a.c.c.f.remote.RemoteFileProducer - Not already connected/logged in. Connecting to: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
> 13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Connecting using FTPClient: org.apache.commons.net.ftp.FTPClient@764af73e
> 13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Connecting to ftp://testftp@192.168.100.1:21 using connection timeout: 10000
> 13:52:06.736 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Attempting to login user: testftp using password: ****
> 13:52:06.750 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - User testftp logged in: true
> 13:52:06.752 [Camel (context) thread #0 - file://c:/docdata/isexport] INFO  o.a.c.c.f.remote.RemoteFileProducer - Connected and logged in to: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
> 13:52:06.752 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - buildDirectory(Diether)
> 13:52:06.754 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - changeCurrentDirectory(/)
> 13:52:06.754 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Changing directory: \\
> 13:52:06.755 [Camel (context) thread #0 - file://c:/docdata/isexport] WARN  o.a.c.c.f.remote.RemoteFileProducer - Writing file failed with: File operation failed: 550 Failed to change directory.
>  Cannot change directory to: \\. Code: 550
>
>
> Best regards,
> Diether
>
>
>
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Producing files to ftp now working in 2.10.3

Posted by Diether <di...@optis.be>.
We tried with stepwise true/false
Also tried the different file separators (UNIX, Windows or the default).
All with the same result. 
If the directory doesn’t exist, it is created on the correct location
though.


We also tried the sftp component, but it's also not working.
Instead of a 550 we just get a message that the directory could not be found
(/).
The directory structure of the ftp server is as follows:
/ftp/testftp/Diether

Using filezilla I noticed that if we log in using sftp we are in
/ftp/testftp/ and can access all directories.
With ftp we are immediately in testftp and cannot go to the parent
directories.


Writing to the home directory after logging in works fine though.
So perhaps as a workaround we can create a new user who has
/ftp/testftp/Diether as his home directory.
Or we have to use version 2.10.2 for now then.





--
View this message in context: http://camel.465427.n5.nabble.com/Producing-files-to-ftp-now-working-in-2-10-3-tp5726060p5726063.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Producing files to ftp now working in 2.10.3

Posted by Aki Yoshida <el...@gmail.com>.
There is a known bug ( reported in CAMEL-5989) introduced 2.10.2 for
sftp using the stepwise directory traversal that results in a similar
error. But yours is for ftp and it is happening independent of the
stepwise property setting, it seems to be different. Could you
describe which variations you have tried?

thanks.

aki

2013/1/23 Wuyts Diether <di...@optis.be>:
> Hi,
>
> We are trying to create a simple route that writes files to an ftp server.
> But we're unable to get this to work using version 2.10.3.
>
> However, if we use version 2.10.2 our Route is working correctly, and a file is created on the ftp server.
> Below you can see 2 traces .
>
> Our endpoint is:  ftp://testftp@192.168.100.1/Diether?password=<snip>&stepwise=false
> We already tried changing the stepwise property, using //Diether as start directory, changed the path separator,...
> I also found the following thread: http://mail-archives.apache.org/mod_mbox/camel-users/201010.mbox/%3c963618E6-DCCB-4BF7-BE72-BE9444A80F1F@nerdylorrin.net%3e
> Which seems to be related.
>
> Is this a bug that was recently (re-) introduced and should we consider downgrading to the previous version?
> Or am I overlooking something?
>
>
> Succesfull using Camel 2.10.2:
> 13:45:40.889 [Camel (context) thread #1 - file://c:/docdata/isexport] DEBUG o.a.c.c.f.remote.RemoteFileProducer - Not already connected/logged in. Connecting to: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
> 13:45:40.889 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Connecting using FTPClient: org.apache.commons.net.ftp.FTPClient@370bf5a4
> 13:45:40.889 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Connecting to ftp://testftp@192.168.100.1:21 using connection timeout: 10000
> 13:45:40.902 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Attempting to login user: testftp using password: ****
> 13:45:40.914 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - User testftp logged in: true
> 13:45:40.916 [Camel (context) thread #1 - file://c:/docdata/isexport] INFO  o.a.c.c.f.remote.RemoteFileProducer - Connected and logged in to: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
> 13:45:40.916 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - buildDirectory(Diether)
> 13:45:40.918 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Trying to build remote directory: Diether
> 13:45:40.922 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - changeCurrentDirectory(/)
> 13:45:40.922 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Changing directory: /
> 13:45:40.923 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.f.remote.RemoteFileProducer - About to write [Diether/DD_AI2013023134540.xml] to [Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]] from exchange [Exchange[null]]
> 13:45:40.923 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - storeFile(Diether/DD_AI2013023134540.xml)
> 13:45:40.923 [Camel (context) thread #1 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - doStoreFile(Diether/DD_AI2013023134540.xml)
>
>
>
> Errors using Camel 2.10.3:
> 13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.impl.SharedProducerServicePool - Acquire: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false] service: RemoteFileProducer[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
> 13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] DEBUG o.a.camel.processor.SendProcessor - >>>> Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false] Exchange[null]
> 13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.f.remote.RemoteFileProducer - Processing file: Diether/DD_AI201302313526.xml for exchange: Exchange[null]
> 13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.f.remote.RemoteFileProducer - preWriteCheck send noop success: false
> 13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] DEBUG o.a.c.c.f.remote.RemoteFileProducer - Not already connected/logged in. Connecting to: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
> 13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Connecting using FTPClient: org.apache.commons.net.ftp.FTPClient@764af73e
> 13:52:06.715 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Connecting to ftp://testftp@192.168.100.1:21 using connection timeout: 10000
> 13:52:06.736 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Attempting to login user: testftp using password: ****
> 13:52:06.750 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - User testftp logged in: true
> 13:52:06.752 [Camel (context) thread #0 - file://c:/docdata/isexport] INFO  o.a.c.c.f.remote.RemoteFileProducer - Connected and logged in to: Endpoint[ftp://testftp@192.168.100.1/Diether?password=******&stepwise=false]
> 13:52:06.752 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - buildDirectory(Diether)
> 13:52:06.754 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - changeCurrentDirectory(/)
> 13:52:06.754 [Camel (context) thread #0 - file://c:/docdata/isexport] TRACE o.a.c.c.file.remote.FtpOperations - Changing directory: \\
> 13:52:06.755 [Camel (context) thread #0 - file://c:/docdata/isexport] WARN  o.a.c.c.f.remote.RemoteFileProducer - Writing file failed with: File operation failed: 550 Failed to change directory.
>  Cannot change directory to: \\. Code: 550
>
>
> Best regards,
> Diether
>
>
>
>