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?