tracker issue : CF-3796626

select a category, or use search below
(searches all categories and all time range)
Title:

CFFTP LISTDIR Command Fails against FTP servers that do not allow the SYST command

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Wil Genovese / Wil Genovese (Wil Genovese)

Created: 07/29/2014

Components: Net Protocols, FTP

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: CF11_Final / CF10_Update14

Priority/Frequency: Major / Most users will encounter

Locale/System: English / Win 2008 Server R2 64 bit

Vote Count: 1

Listed in the version 11.0.03.292480 Issues Fixed doc
Problem Description: CFFTP LISTDIR command fails against FTP servers that do not allow the SYST command.

Steps to Reproduce:
Test against different FTP servers and you will find this does not work on FTP servers that do not allow the SYST command.

Here is code to test:
<cfscript>
ftpServer = '';
userName = '';
pw  = "";
</cfscript>
<cfftp action="open" username="#userName#" connection="myFtp" password="#pw#" server="#ftpServer#" stopOnError="no" passive="true" />
<cfoutput>
	FTP connection Open: #cfftp.succeeded#<br>
</cfoutput>
<cfdump var="#cfftp#">

<cfftp action="listdir" stoponerror="false" name="filelist" directory="./" connection="myFtp" passive="true">
<cfdump var="#cfftp#">
<cfdump var="#filelist#" label="filelist">
<cfftp action="close" connection="myFtp" stopOnError = "Yes">


Actual Result:

215 ERROR

When the LISTDIR command executes the SYST command must get executed first in order to determine the type of FTP server. I see this in regular FTP clients too. In most cases I see the 215 fail in a FTP client and the client simply ignores the response and goes on to the next command.

Here in ColdFusion CFFTP does NOT ignore the error even though the stopOnError attribute is set to false. I was able to see where the actual failure happened by using Wireshark to monitor the FTP network traffic created by CFFTP and I attached a screenshot of the error message as seen in Wireshark.



Expected Result:
Expected a directory listing



Any Workarounds:
None

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3796626

External Customer Info:
External Company:  
External Customer Name: Wilgeno
External Customer Email:  
External Test Config: I have tested this with ColdFusion 10 and 11 and I get the same results.

Attachments:

  1. July 30, 2014 00:00:00: 1_CFFTP_LISTDIR.png

Comments:

I've tested the same code with ColdFusion 8 and CFFTP works properly in CF8. This is a change in behavior that was not expected or documented as far as I can find.
Comment by External U.
11495 | July 30, 2014 02:25:01 PM GMT
Am not able to connect to Rakuten Marketplace due to this bug
Vote by External U.
11509 | July 30, 2014 02:36:10 PM GMT
I just tested this with ColdFusion 9 and that has the same error. I am not seeing anything in documentation that mentions a change in FTP behavior for CFFTP.
Comment by External U.
11496 | July 30, 2014 03:36:44 PM GMT
This looks like the bug that was reported 2 years ago: https://bugbase.adobe.com/index.cfm?event=bug&id=CF-3307999
Comment by External U.
11497 | August 07, 2014 11:45:10 AM GMT
It might be two different bugs. The other is in OPEN action this is in the LISTDIR action. But it does appear CFFTP has issues.
Comment by External U.
11498 | August 07, 2014 11:50:42 AM GMT
I have a developer I'm working with that's using Buy.com (the same as the other issue). He's on CF10. Your CF11 bug is the exact bug he is experiencing.
Comment by External U.
11499 | August 07, 2014 12:05:04 PM GMT
I am able to reproduce the issue. ColdFusion uses commons-net library for cfftp operations. commons-net uses SYST command to know about the OS which helps in parsing the ftp listdir listing. If the target ftp server is not allowing syst command commons-net check for the following jvm property to know about the OS type of the target server. org.apache.commons.net.ftp.systemType (provided by commons-net ftp library) If this jvm property is provided with the target ftp server system type and the target server does not support SYST command during listdir operation the file listing parser is decided from the value of this jvm property. If target ftp server is on windows specify value as WINDOWS If the target ftp server is on unix flavour machinges specify value as UNIX Note: If you are connecting to two ftp servers which are running on different OS (one on win, one on Unix) which does not support SYST command you should not use this work around. We will add a new attribute to the cfftp tag to specify the desired OS type which helps in parsing the listdir listing response. Thanks, Pavan.
Comment by S V.
11500 | August 11, 2014 12:43:29 PM GMT
I've tested the proposed solution below and that does NOT work. I am in direct communications with Rupesh and I have provided credentials to an FTP server that can be used to test against. Additionally this work around will not work for our client as they need to work with multiple FTP servers from various vendors. A patch for ColdFusion 10 needs to be released sooner than later. There has not been a patch release since January of this year. ColdFusion 10 has the appearance of having been abandoned at Adobe.
Comment by External U.
11501 | August 18, 2014 12:47:45 PM GMT
I've just checked my FTP server logs and have found that Adobe isn't testing against the FTP server that I know can be used to recreate the issue. Is someone going to respond or test?
Comment by External U.
11502 | August 21, 2014 12:12:58 PM GMT
Added new attribute parserKey to cfftp tag which when given the value "unix" or "windows" does not trigger SYST command and CFFTP ListDir works fine even if SYST command is disabled in the FTP server. (Comment added from ex-user id:nawani)
Comment by Adobe D.
11503 | September 01, 2014 04:46:27 AM GMT
I have verified the fix works.
Comment by External U.
11504 | November 04, 2014 03:39:12 PM GMT
Why <cfftp parserkey="windows|unix" ? I'd recommend <cfftp systemtype="windows|unix" Can the "parserkey" attribute please be renamed to "systemtype"? What CF11 build is this fixed in? Build 11,0,03,291742 still sends the SYST command when parserkey="windows". Thanks!, -Aaron
Comment by External U.
11505 | November 06, 2014 11:42:04 PM GMT
If action="open", then the parserkey attribute is ignored. Meaning, SYST is still sent for <cfftp action="listdir" connection="myConnection" parserkey="windows"..>. Thanks!, -Aaron
Comment by External U.
11506 | November 07, 2014 01:54:23 AM GMT
Filed #CF-3849151 to rename the "parserkey" attribute to "systemtype", since that's what the attribute is asking for: the "system type". That matches the JVM property: org.apache.commons.net.ftp.systemType ("system type" not "parser key") Thanks!, -Aaron
Comment by External U.
11507 | November 09, 2014 05:56:58 AM GMT
I've verified this is fixed in CF11 Update 3 (11,0,03,292024(PreRelease)). SYST is no longer sent for open or listdir. Thanks!, -Aaron
Comment by External U.
11508 | November 15, 2014 05:19:13 PM GMT