FTP connection issue

Hello, any help would be gratefully appreciated.

I’m doing a ColdFusion to Lucee server and have had issues with my FTP connection.

The current code:

I get the following error message:
“ERROR”,“cfthread-87”,“06/25/2020”,“16:00:50”,“cfthread-87”,"Connection is not open;Connection is not open;lucee.runtime.exp.NativeException: Connection is not open
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:474)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:608)
at org.apache.commons.net.ftp.FTP.type(FTP.java:1081)
at org.apache.commons.net.ftp.FTPClient.setFileType(FTPClient.java:1519)
at lucee.runtime.net.ftp.FTPClientImpl.setFileType(FTPClientImpl.java:86)
at lucee.runtime.net.ftp.FTPWrap.connect(FTPWrap.java:112)
at lucee.runtime.net.ftp.FTPWrap.(FTPWrap.java:61)
at lucee.runtime.net.ftp.FTPPoolImpl._get(FTPPoolImpl.java:83)
at lucee.runtime.net.ftp.FTPPoolImpl.get(FTPPoolImpl.java:38)
at lucee.runtime.tag.Ftp.getClient(Ftp.java:495)
at lucee.runtime.tag.Ftp.actionOpen(Ftp.java:619)
at lucee.runtime.tag.Ftp.doEndTag(Ftp.java:178)
at standalone.create_pdf.createpdf_cfm$cf$f.threadCall(/standalone/Create_pdf/createpdf.cfm:344)
at lucee.runtime.thread.ChildThreadImpl.execute(ChildThreadImpl.java:204)
at lucee.runtime.thread.ChildThreadImpl.run(ChildThreadImpl.java:146)
Caused by: java.io.IOException: Connection is not open
… 15 more
"

I’ve also tried:

new ftp().open( action=“open”, connection=“transferPDF”, server=“#theIPAddess#”, username=“#theUserName#”, password=“#thePassWord#”, port=“#thePort#”,transferMode=“binary” );

Get Error message:
“ERROR”,“cfthread-96”,“06/25/2020”,“16:04:54”,“cfthread-96”,"Connection is not open;Connection is not open;lucee.runtime.exp.NativeException: Connection is not open
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:474)
at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:608)
at org.apache.commons.net.ftp.FTP.type(FTP.java:1081)
at org.apache.commons.net.ftp.FTPClient.setFileType(FTPClient.java:1519)
at lucee.runtime.net.ftp.FTPClientImpl.setFileType(FTPClientImpl.java:86)
at lucee.runtime.net.ftp.FTPWrap.connect(FTPWrap.java:112)
at lucee.runtime.net.ftp.FTPWrap.(FTPWrap.java:61)
at lucee.runtime.net.ftp.FTPPoolImpl._get(FTPPoolImpl.java:83)
at lucee.runtime.net.ftp.FTPPoolImpl.get(FTPPoolImpl.java:38)
at lucee.runtime.tag.Ftp.getClient(Ftp.java:495)
at lucee.runtime.tag.Ftp.actionOpen(Ftp.java:619)
at lucee.runtime.tag.Ftp.doEndTag(Ftp.java:178)
at org.lucee.cfml.helperbase_cfc$cf.udfCall1(/org/lucee/cfml/HelperBase.cfc:129)
at org.lucee.cfml.helperbase_cfc$cf.udfCall(/org/lucee/cfml/HelperBase.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:217)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:646)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:576)
at lucee.runtime.SuperComponent.call(SuperComponent.java:83)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1709)
at org.lucee.cfml.ftp_cfc$cf.udfCall1(/org/lucee/cfml/Ftp.cfc:8)
at org.lucee.cfml.ftp_cfc$cf.udfCall(/org/lucee/cfml/Ftp.cfc)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:344)
at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:207)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:647)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1917)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:864)
at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1728)
at standalone.create_pdf.createpdf_cfm$cf$g.threadCall(/standalone/Create_pdf/createpdf.cfm:348)
at lucee.runtime.thread.ChildThreadImpl.execute(ChildThreadImpl.java:204)
at lucee.runtime.thread.ChildThreadImpl.run(ChildThreadImpl.java:146)
Caused by: java.io.IOException: Connection is not open
… 35 more
"

I am able to connect if I go to the server and do an FTP.

Scratching head here…
Thanks in advance with any help.
David.

Code didn’t show up…

Example one.
cfftp connection=“transferPDF” username=“#theUserName#” password=“#thePassWord#” server=“#theIPAddess#” port=“#thePort#” action=“open” transferMode=“binary” stopOnError=“No”

cfscript
new ftp().open( action=“open”, connection=“transferPDF”, server=“#theIPAddess#”, username=“#theUserName#”, password=“#thePassWord#”, port=“#thePort#”,transferMode=“binary” );
cfscript

did you try passive mode?

Hello Zac,

Yes I’ve tried that… I’ve also tried transforMode = “Auto”

Can you double check that? I was able to replicate the error using a standard unencrypted FTP connection on port 21 with transferMode="binary". But when I changed to transferMode="auto" the connection succeeded.

This was on Lucee 5.3.4.85. Which version are you using?

1 Like

I was able to solve my issue by removing the Attribute, transferMode=“binary”.
I think transforMode = “auto” would also work.

David.

Just come across this same issue and it seems to be a bug so I’ve raised at ticket for it:

https://luceeserver.atlassian.net/browse/LDEV-3528