FTP Issues from server

ViperGTI

Well-Known Member
Joined
Mar 29, 2012
Messages
382
Reaction score
0
Location
Centurion
So we currently have two dedicated servers hosted in Jhb and basically we use FTP to backup to each other. I've written a small .NET application that collects all the required data and then transfers it to the other server on a daily basis.

Now from the 1st server to the 2nd server, this works 100%. However, from the 2nd server, I can't FTP out to the 1st server. I've narrowed down the problem to the server, but have no idea where.
Here is what I did to rule out other possibilities:

1. Ruled out firewall on 2nd server by completely disabling the Windows Firewall and the Hetzner Firewall
2. Ruled out the application by connecting manually via Windows FTP.exe through command prompt. Exactly the same results
3. Ruled out the firewall on the 1st server by connecting to Hetzner's FTP backup servers that are provided as part of the service. I can connect to that same backup server from the 1st server.

Basically what happens is that the FTP login is successful and then when trying to upload the file, the file is created on the target server, but 0 bytes in size. Ftp.exe just hangs there at that point until Ctrl+C is pressed and my application eventually comes back with the error "The remote server returned an error: (425) Can't open data connection."

I have Total Commander installed on both servers which I use as a FTP Client and Total Commanders always connects. From both servers, 100%. So the problem seems to be at the core of how the Microsoft libraries connect via FTP.

Any ideas where to look next?
 
I've found even with the firewall turned off it is still active somehow (Win 7/2008). Make sure port 20 and 21 TCP are open in the firewall AND that the FTP application has been added.
 
Forgot to mention... Tried both Active and Passive.
Server1 to Server2 is using Active without issues though.

Well, it is the classic symptom of the FTP control channel being open, then the data channel being unable to open for some reason. Maybe it is setting the port number too high on the data channel. Usually Passive sorts this all out though. Otherwise I dunno.
 
I've found even with the firewall turned off it is still active somehow (Win 7/2008). Make sure port 20 and 21 TCP are open in the firewall AND that the FTP application has been added.
Yep... already added. Both the applications and the ports.

Well, it is the classic symptom of the FTP control channel being open, then the data channel being unable to open for some reason. Maybe it is setting the port number too high on the data channel. Usually Passive sorts this all out though. Otherwise I dunno.
That is what I thought as well. The strange thing though is that I can FTP out using Total Commander (Active and Passive), but not with the Microsoft console application (or .NET Framework for that matter).
 
Ok... Solved. Hetzner firewall was blocking the traffic. Disabling the Hetzner firewall does not take immediate effect which is why I missed it. I basically disabled it, tested and if it doesn't work, I enabled it again. After the previous hacking attempt, I'm a little paranoid so don't want to leave the firewall down too long.
 
Top
Sign up to the MyBroadband newsletter
X