GUI FTP works but command line FTP does not
ntmd8r said 2 years, 7 months ago:
I have several websites I am responsible for.
Most are hosted by other providers.
I have 1 hosted by GoDaddy.
The site is set up fine.
I use a GUI FTP program (FlashFXP) to connect to and
transfer files back and forth to all my sites.
This works just fine for all of them, including the 1 with GoDaddy.
I also have created batch executions, running under my task manager, to connect to several of my sites, to download (backup) certain files from these sites.
These running tasks actually execute Windows FTP program, and execute commands set up in script files.
MOST of these work just fine.
The 1 which doesn’t work is the one for the GoDaddy site.
I can run my FlashFXP against the GoDaddy site, it it works just fine.
When I run the Windows FTP program, I can connect fine, I can login fine, I can change folders fine, but as soon as I try to list files in a folder, or do a “get”, or anything to do with files, I get
“Could not open data connection to port xxxxx” message.
Then my connection times out.
I am using EXACTLY the same commands in both the FlashFXP program as I use in the DOS command prompt running Windows FTP program.
Yet the FlashFXP works, but the Windows FTP does not.
Note that both FLashFXP and Windows FTP work for ALL the other sites I manage. It is only this 1 by GoDaddy that I am having trouble with.
Here are the commands I use:
open mywebsite 21
user xxxxxxxxx
pw zzzzzzzzzz
quote pasv
cd folder1
cd folder2
ls
pretty simple stuff
FlashFXP works; Windows FTP does not.
I need to be able to use the Windows FTP program, because I run scheduled tasks to download/backup files from the server to my computer.
So I do NOT want to have to run them manually.
For all the other sites I manage, this works fine.
I have checked my firewall… the settings for both programs are identical.
So… I am at a loss.
Does anyone have any ideas/thoughts/suggestions/tips ??????
Gary A said 2 years, 7 months ago:
@ Ntmd8r
Since you are able to connect to your account using a GUI FTP program, you should have no trouble accessing your account via FTP using other methods. You might want to do a separate FTP test using the command line to see if you are able to isolate any issue. I recommend that you take a look at this article for our recommended test steps.
-Gary
joed said 2 years, 7 months ago:
Drop the command “quote pasv” and you should be fine.
ntmd8r said 2 years, 7 months ago:
GaryA,
I agree with you.
Since I am able to do everything with a GUI FTP program, I should have no problems using other methods.
But…. I do !!!!! As I explained.
The article you recommend tells me to do exactly what I have been trying to do.
I open a DOS window.
Start FTP.
open the connection to my website
provide my ID and PW
change folders
all that works fine.
But when I try to do a get, or a recv, or a ls,
I get that damned error message.
JoeD,
I have tried with and without the “quote pasv”….
same results.
Just to let you know, I have been working with computers since 1968 (yes… 42 years).
I have built so many applications it isn’t funny.
I have learned/used more programming languages than I can remember.
So I am very familiar with a variety of things.
But this scenario really has me stumped.
joed said 2 years, 7 months ago:
I’m sure you know all of this but for the sake of the forum I will go over it anyway.
FTP communications go over two different ports. There is the Control port and the Data port. The control port handles all of the commands you are sending and is run over port 21. This is obviously working for you since you are able to login and change directories. However once you issue a command that touches data like “ls”, “get”, “put”, etc. The answer comes back from the server over the data port. The data port number varies based on things like if you have run the “pasv” command. So you are obviously having problems connecting to this port. The problem could be on either end. You may want to run a packet capture on your side to watch the ftp session and see where the drop is occuring. Also can you provide me your domain name so I can double check things on our side.
-Joe
ntmd8r said 2 years, 7 months ago:
Joed,
my domain I am trying to work with is
And yes, I do know about the 2 ports, etc., etc.
A thing I have just noticed…
When I issue the “quote pasv” command, it returns to me the IP address of the site , plus 2 octets which I thought were the port number.
In my case it returns (97,74,46,128,198,239)
Now I know the first 4 octets are the IP of my site.
And I was under the understanding that the last 2 octets provided me with the port number it was going to use.
And this was the “198″ * 256 + “239″.
This equates to 50688 + 239 = 50927
But when I then issue a ls command, it then times out eventually, and gives me a message about not being able to connect to port 57396.
Now why is it trying a different port than the one it already assigned ?
Just getting weirder and weirder.
Thanks for any help
joed said 2 years, 7 months ago:
Thanks for providing your domain name. The good news is I am able to reproduce your issue. The bad news is that the DOS client http://ftp.exe does not appear to support passive ftp easily.
Our hosting environment went through a bit of a network redesign a couple years ago and all new hosting servers (including yours) are now placed in an area that requires passive ftp.
By analyzing packet captures on my workstation I have noticed the following. The error message “Could not open data connection to port xxxxx” is coming from the FTP server. It is telling you that it cannot talk to your client on port xxxxx. (port 57396 in your last example) So the fact that it doesn’t match the port number returned from the pasv command is normal.
I’m a Windows Systems Engineer at Go Daddy and for some reason our Windows shared hosting servers work just fine with the dos client. By watching the packets to the Windows server I see that if you send the “quote pasv” command the next data command fails with the error, “425 Cannot open data connection.” This is why I originally wrote “drop the quote pasv command”. However if I send an “ls” command again it works. By looking at the packet capture I see that it is actually defaulting back to Active FTP and that is why it works. Of course this negates the comment I made in the second paragraph. Not sure what to say about that except that is what the network guys told us when that environment was going live. My reaction was to enable passive FTP in Windows, but I didn’t bother to disable Active FTP. However it appears that the Linux guys did disable Active FTP.
So I see two options for you:
1. Switch to Windows Grid Hosting. (Hey I’m the Windows guy. I have to say this!)
2. Use a different command line tool. The Linux engineer I worked with on this issue suggested NCFTP.
Also take a look at this blog post. He appears to be doing something similar and also recommends NCFTP.
http://jlchereau.blogspot.com/2007/07/schedule-your-backup-transfers.html
Good luck!
-Joe
ntmd8r said 2 years, 7 months ago:
Joe.
Thanks for the help.
1. I am a windows guy too. I just might transfer to Windows hosting.
2. I looked at NcFTP.
I run my backup/copy job as a scheduled task at night, to reduce server load.
The name of the file I am backing up, and the target folder I place it in changes each day.
So I create a windows script (this is what actually runs via the task scheduler), which ascertains the
desired filename, and ascertains the correct target directory, then it builds a txt file of all the appropriate FTP commands to connect, login, change to the correct source folder, change to the correct target folder, then get the specified file, then close.
The script then invokes Windows FTP, passing it the txt filename as input.
Works like a damn…. except for this particular server. I have other sites on other servers and this all works jut fine.
But, back to NcFTP…. using NcFTPget, you CAN provide it with a txt file name. But this only can be used to specify the host, userid, and password.
I cannot specify the server folder, nor the target folder. Of course, I can provide the desired filename as an input parameter.
Essentially I want a complete batch FTP processor (like Windows FTP). But it has to be able to get past the “issues” with this UNIX server.
So… If I can’t find another solution reasonably quickly, I think I will opt for the WINDOWS Server.
Thanks again
ntmd8r said 2 years, 7 months ago:
Hey… I have a solution.
I have written a small VB6 small to use the built-in FTP Internet connection library modules.
Since I need to use logic to determine what filename and target folder to copy to every time it runs, I can place that logic in the VB code.
So I built it, and it runs just fine…. and does the job.
So I now run this .exe as my scheduled task, rather then my vbScript file.
Cool.
If anyone might be interested in seeing the VB code for my solution, you can send me an email via GoDaddy.
joed said 2 years, 7 months ago:
That’s great news. Glad you were able to code around your problem.
-Joe
zoubir said 2 years, 4 months ago:
Hi ntmd8r
I have exactly the same issue as you with the FTP command line, i need to automate transfering files with a batch script an i’m blocked when trying the get command, and i dont think that the Linux guys have found a solution for this bug. so if it’s possible i need to have a look on your small VB script and how did you used the built-in FTP Internet connection library modules.
Thanks for your help
ntmd8r said 2 years, 4 months ago:
Hi Zoubir.
OK, I will send you my source code… but I need to know your email address.
Ntmd8r
zoubir said 2 years, 4 months ago:
<p>Hi ntmd8r</p>
<p>I repport the issue to my hosting support and they said that they were able to duplicate the issue within windows command line and it works for them, however it still not working for me and in different windows workstation. That why i’m interested by your solution.</p>
<p>thank you very much for your help
</p>
zoubir said 2 years, 4 months ago:
Hi ntmd8r
It seems that i cannot show you my email through this post, i already ask for a connection request on your profil in order to be able to send you emails and it still pending for your confirmation.
thanks
Zoubir
ntmd8r said 2 years, 4 months ago:
I tried to respond to your request for a connection,
but when I link on the “connection request” line (in my profile), I get
“oops… the page you are looking for is not found”.
So I don’t know how to accept your request.
Any help ?????????
Anyone ?????????
7 min expected wait time