• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

SFTP Issue on Coldfusion 2016

New Here ,
Jun 25, 2018 Jun 25, 2018

Copy link to clipboard

Copied

Hello,

We recently migrated our applications from ColdFusion 9 to ColdFusion 2016. One of our applications SFTPs files using cfftp tag.

We noticed that CFFTP tag with ColdFusion 2016 no longer works. We worked with our internal IT team and the remote SFTP server team to resolve all issues with firewall. When we connect with WINSCP from our end, we were able to successfully connect to the remote server but when we use CFFTP from ColdFusion 2016, it seems stuck in the CFFTP tag. It does not even time out.

Initially we thought it's the same code as CF9 and since CFFTP worked in CF9, it should work in CF 2016 but it did not. Later we realized that some of the tags were deprecated and we corrected that and ran the tests. But our efforts were in vain.

We get this error message in the FTP log: "Information","ajp-nio-8016-exec-1","06/20/18","14:06:00","","Starting FTP request {action='open'}"

We used the below code to connect:

<cfftp action = "open"
  
connection = "myConnection1"
  
fingerprint="aa:bb:cc:dd:ee:ff:gg:hh:ii:jj:kk:ll:mm:nn:oo"
  
passive="yes"
  
password="xxxxx"
  
port="22"
  
secure = "yes"
  
server = "1.1.1.1" 
  
stopOnError = "yes"
  
timeout="30"
  
username = "xyz">

Here is the environment info:

Version 2016, 0, 06, 308055

Tomcat Version 8.5.28.0

Java Version 1.8.0_161

OpenSSL Version 1.0.2n

Please assist.

Thanks,

KP

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 25, 2018 Jun 25, 2018

Copy link to clipboard

Copied

I haven't worked with the CFFTP tag, but I suggest changing stopOnError to "no" and putting CFTRY/CFCATCH tags around the CFFTP tag, and have it either CFDUMP the #cfcatch# to screen, or send it via email.  You should see the underlying cause.

HTH,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 25, 2018 Jun 25, 2018

Copy link to clipboard

Copied

Thanks WolfShade. We will try and will let you know.

Thanks,

KP

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 03, 2018 Jul 03, 2018

Copy link to clipboard

Copied

After we ran it looks like the code gets stuck in <CFFTP tag and spinning indefinitely. So anything in the next line never gets executed.

Thanks,

KP

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2018 Jul 06, 2018

Copy link to clipboard

Copied

The CFTRY/CFCATCH should allow the error to occur, display or email the error message, and continue processing.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 09, 2018 Jul 09, 2018

Copy link to clipboard

Copied

Doesn’t come out of the CFFTP tag. We are working on a workaround to call WINSCP scripts using a batch file.

Thanks,

KP

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 13, 2018 Sep 13, 2018

Copy link to clipboard

Copied

Did you ever find a solution to this (other than using a script instead of cfftp)?  I have the exact same issue.  The same secure FTP code/commands on CF9 don't work on CF2016.  Just clocks and never errors out.  If I install FileZilla on the server that has CF2016, the server can connect using SFTP to the remote server with no issues, so it shouldn't be a firewall issue.  This is really a pain to troubleshoot.  Using CFFTP in secure="no" mode works fine, but we are required to use SFTP.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 19, 2018 Sep 19, 2018

Copy link to clipboard

Copied

In case anyone Google's this and is looking for a solution - I figured out one that is easy to implement.  There is an issue with the java username and password input and details about this can be found here:https://confluence.cornell.edu/display/hosting/Using+CFFTP+Tag+in+CF10

Using CFFTP Tag in CF10 - CIT Hosting Documentation - Dashboard

In case the link above stops working, To fix this issue,

Add the following two lines to your code right above the CFFTP section:

<cfset _jsch = CreateObject('java','com.jcraft.jsch.JSch')>
<cfset _jsch.setConfig("PreferredAuthentications", "publickey,keyboard-interactive,password")>

What's actually happening is Java 1.7 with jsch (via apache ant) is looking for user login and password input (separate from the username and login you may be providing with your CFFTP tags).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 07, 2021 Jan 07, 2021

Copy link to clipboard

Copied

LATEST

This fixed my issue but interesting to note Im using Java 1.8 and the latest ColdFusion 2016 as of this writing: 2016.0.16.320445 so it seems it is still a bug as of 1/7/2021

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation