IIS 7 and Above
FTP 7.5 - Preventing Reply Code 125 for Legacy Application
Last post Sep 13, 2011 08:43 AM by megha23
Feb 19, 2010 05:16 PM|Orod|LINK
We recently migrated some of our applications to Windows 2008/IIS 7.0/FTP 7.5 and while the applications are working we are seeing a change in FTP response codes as compared to FTP6.
Each night we receive data extracts via FTP from legacy systems. The extract written for these systems expects to see 3 FTP response codes
230 User Logged In.
150 Opening ASCII mode data connection.
226 Transfer Complete.
In the change to FTP 7.5 we are seeing code 125 instead of 150.
125 Data connection already open; Transfer starting.
Is there a way to prevent code 125 and instead force 150? In an attempt to force the 150 code I've lowered the "Data Connection Timeout" setting without any luck. I would expect that the first connection from a server would receive the 150 code, but even
this is not always the case.
I've spent a number of hours looking into this without much luck, any thoughts are appreciated.
ftp 7.5 Configuration reply codes data channel
Feb 22, 2010 09:30 PM|robmcm|LINK
Unfortuntately there is no way to directly customize an FTP response code.
But that being said, codes 125 and 150 can both be expected, so your script should be checking for both codes.
Feb 22, 2010 09:55 PM|Orod|LINK
I appreciate the response. I thought that might be the case but wanted to verify before we move ahead with updating the legacy code.
Sep 12, 2011 10:39 AM|megha23|LINK
I also have similar type of problem , i receive response code 125 instead of 150 after pasv and also i didn't getting any error , and file transfer writes fraction of bytes of original file , i am not sure what's wrong. with what reason i am getting 125
response code and not 150 , and how it affects my file transfer.
Sep 12, 2011 11:46 AM|HCamper|LINK
Check Robert's Post
The Wikipedia Status codes for FTP
Download and install Log Parser Microsoft Download Center
Monitor the FTP traffic using the logs look for the file sizes and errors. You can create check for md5 sums of the files to verify the orginal
and transfered files.
Sep 13, 2011 03:12 AM|robmcm|LINK
Receiving a 125 instead of 150 after PASV only indicates that the data connection was already open, that does not indicate an error. In the article that Martin pointed to, those two status codes are defined as the following:
So you can see that the difference is simply indicated whether the FTP service is opening a new data connection or using a data connection was already open.
For what it's worth, KB Article 2505047 - Changes introduced with Microsoft FTP 7.5 discusses this behavior in the following way:
FTP 7.5 returns a 125 or 150 response when an FTP client sends a command needing the data connection in passive mode
In earlier versions of IIS, the FTP service returned a "125 Data connection already open; transfer starting." response for APPE, STOU and STOR commands sent by FTP clients when the client and server were communicating over a passive mode connection. Further,
FTP would return a "150 File status okay; about to open data connection." response for the APPE, STOU and STOR commands over active mode connections.
Beginning in FTP 7.5, the response message does not depend on whether the request for the data connection is over passive mode or active mode. Instead, if the data connection is already established FTP 7.5 responds with "125 Data connection already open; transfer
starting". If the data connection is not already established, FTP responds with "150 File status okay; about to open data connection." It is also important to note that FTP 7.5 does not start establishing the data connection for PASV or EPSV commands until
the data connection for an earlier FTP request is disconnected.
With regard to the file download failure, that should not be related to the status code - you're seeing the correct status, but it sounds like something is causing the connection to fail. Do you have a firewall between the client and server?
Sep 13, 2011 08:43 AM|megha23|LINK
Hmm, i seen it and my exact problem is not that i am getting 125 status but theres some problem in data transfer.