Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
945 views
in FAQ: edtFTPj/Free by (120 points)

I'm experiencing problems with edtFTPj, deployed on AWS: regardless of what settings I set in advanced connection/server settings I'm getting "Error: Server returned unroutable private IP address in PASV reply " testing my server with https://ftptest.net/ and in server logs I see:

2016-04-19 06:21:48 INFO  FtpLoggingFilter:84 - RECEIVED: PASS *****
2016-04-19 06:21:48 INFO  PASS:246 - Login success - test2
2016-04-19 06:21:48 INFO  FtpLoggingFilter:157 - SENT: 230 User logged in, proceed.

2016-04-19 06:21:48 INFO  FtpLoggingFilter:84 - RECEIVED: TYPE I
2016-04-19 06:21:48 INFO  FtpLoggingFilter:157 - SENT: 200 Command TYPE okay.

2016-04-19 06:21:59 INFO  FtpLoggingFilter:84 - RECEIVED: MKD 945811551
2016-04-19 06:21:59 INFO  MKD:109 - Directory create : test2 - /945811551
2016-04-19 06:21:59 INFO  FtpLoggingFilter:157 - SENT: 257 "/945811551" created.

2016-04-19 06:22:01 INFO  FtpLoggingFilter:84 - RECEIVED: CWD 945811551
2016-04-19 06:22:01 INFO  FtpLoggingFilter:157 - SENT: 250 Directory changed to /945811551

2016-04-19 06:22:07 INFO  FtpLoggingFilter:84 - RECEIVED: SYST
2016-04-19 06:22:07 INFO  FtpLoggingFilter:157 - SENT: 215 UNIX Type: Apache FtpServer

2016-04-19 06:22:07 INFO  FtpLoggingFilter:84 - RECEIVED: PWD
2016-04-19 06:22:07 INFO  FtpLoggingFilter:157 - SENT: 257 "/945811551" is current directory.

2016-04-19 06:22:07 INFO  FtpLoggingFilter:84 - RECEIVED: PASV
2016-04-19 06:22:07 INFO  FtpLoggingFilter:157 - SENT: 227 Entering Passive Mode (172,31,30,187,200,147)


where 172.31.30.187 is mu EC2 instance's private IP.

 

in code:

            ftp.setRemoteHost(AppConstants.FTPServer.HOST);
            ftp.setRemotePort(AppConstants.FTPServer.PORT);
            ftp.setUserName(username);
            ftp.setPassword(password);
      ftp.getAdvancedFTPSettings().setActiveIPAddress(AppConstants.FTPServer.HOST);
            ftp.getAdvancedFTPSettings().setConnectMode(FTPConnectMode.PASV);
            ftp.getAdvancedFTPSettings().setAutoPassiveIPSubstitution(true); // AWS has problems with this
            ftp.getAdvancedFTPSettings().setActivePortRange(3000, 4000);

 

where AppConstants.FTPServer.HOST value in my public IP, I'm 100% sure with logs.

 

What I do wrong and how to fix this?

by (153k points)
None of this logging looks familiar. Where's the logging outputted by edtFTPj?
by (120 points)
I've set -Dedtftp.log.level=DEBUG to my Tomcat's JAVA_OPTS so it suppose to turn logging on. What would be the marks showing I'm getting edt logs?
Please note I have lines like
2016-04-20 13:24:06 INFO  FtpLoggingFilter:157 - SENT: 227 Entering Passive Mode (172,31,30,187,177,161)
on my logs. These are edt classes logs, right?
by (2.7k points)
This is not logging from edtFTPj.  Apache Mina is mentioned in the stack-trace and I suspect all of the logging is from there.   Mina seems to contain an FTP server.  edtFTPj is an FTP client library.
by (120 points)
Please say what is filter/mark for edtFTPj logs, please?
There are definitely fpt-related:

2016-04-27 15:30:14 INFO  FtpLoggingFilter:157 - SENT: 211-Extensions supported

 SIZE

 MDTM

 REST STREAM

 LANG en;zh-tw;ja;is

 MLST Size;Modify;Type;Perm

 AUTH SSL

 AUTH TLS

 MODE Z

 UTF8

 TVFS

 MD5

 MMD5

 MFMT

211 End

2016-04-27 15:30:15 INFO  FtpLoggingFilter:84 - RECEIVED: PASV
2016-04-27 15:30:15 DEBUG IODataConnectionFactory:161 - Initiating passive data connection
2016-04-27 15:30:15 DEBUG IODataConnectionFactory:208 - Opening passive data connection on address "/172.31.30.187" and port 0
2016-04-27 15:30:15 DEBUG IODataConnectionFactory:213 - Passive data connection created on address "/172.31.30.187" and port 0
by (120 points)
Oh! I think I got you! It's probably related to http://stackoverflow.com/questions/21015542/using-apache-ftp-server-in-passive-mode-not-working-connection-refused-by-serv described here. But I'm not implementing apache's server on my own, I use the default they provide. Will continue digging.

Please log in or register to answer this question.

...