1
votes

I have an FTP server setup on a custom port rather than port 21. Now I'm able to connect to it remotely using an IP and the new port set using FileZilla, which is set to passive mode. Everything works as expected in FileZilla, but when I try using the same credentials in Microsoft Visual Studio Community 2015, I get this error

Unable to retrieve folder information from the server. FTP Passive mode is not available.

If I turn the passive mode off, I get this error:

Unable to retrieve folder information from the server. Illegal PORT command (500).

My goal in all this is to quickly modify and upload the files on the server I change without having to go through FileZilla. The reason VS specific is for C++ development environment. Potentially I'm setting it up incorrect, but I've looked online and I've done File>Website and added the credentials there. Tried completed disabling my firewall, no luck. I know the port is good otherwise I wouldn't be able to connect via FileZilla. Just running out of ideas what to do as it works in one case but not the other. Any help is very much appreciated.

FileZilla log:

Status: Connecting to XXX.XXX.XXX.XXX:XXX...
Status: Connection established, waiting for welcome message...
Status: Insecure server, it does not support FTP over TLS.
Status: Server does not support non-ASCII characters.
Status: Logged in
Status: Retrieving directory listing...
Status: Server sent passive reply with unroutable address. Using server address instead.
Status: Directory listing of "/home/<USER>" successful
1
Show us your code! Show us a log file! Show us a FileZilla log file! Anything! - Martin Prikryl
What is there to show??? I posted the errors I'm getting by simply attempting to connect in visual studios ftp. - William McCarty
Sorry, I've misunderstood the question. Anyway, FileZilla log file would be useful anyway. If you have an access to server-side log, post that too (for both FileZilla and VS session). Or packet capture. - Martin Prikryl
Mon Feb 6 09:35:47 2017 [pid 8571] CONNECT: Client "::ffff:XXX.XXX.XX.XX" Mon Feb 6 09:35:47 2017 [pid 8569] [<USER>] OK LOGIN: Client "::ffff:XXX.XX.$ - William McCarty
got that in the logs on the server - William McCarty

1 Answers

1
votes

Server sent passive reply with unroutable address

That means your server is misconfigured. It does not know it's external IP address. It reports local (as of the server) IP address to the client in the response to the PASV command. The client obviously cannot connect to that address to start a data transfer.

See my article on network configuration for FTP passive mode for details.

FileZilla, when receiving an unroutable IP address, uses the IP address of the FTP server for the data transfer. But that's just heuristics, that does not have any backing in the FTP specification. I assume that the Visual Studio (as all Microsoft implementations of FTP protocol do) strictly adheres to the FTP specification. It does not do anything "smart" like FileZilla and simply fails (what is actually the "correct" behavior).