0

I'm trying to setup a connection to FTP to transfer a file. Unfortunately, because of the environment the tools I have available to me are limited.

I'm receiving the following error:

An error occurred while establishing an FTP connection.

Error: Connection refused: connect.

Does this mean that I can reach the FTP server but the credentials are incorrect? Does it mean that I can't reach the server at all? Or is there no way to tell?

Update: I changed the IP address I was using to some other random number, so it's almost certainly because I can't connect. I wish there was a way to tell the difference between connectivity and authorization issues.

ale
  • 6,369
  • 7
  • 55
  • 65
  • If you have command line access on the CF server - try an ftp client from there. If the connection is over SSL, does the Java keystore accept the certificate? – orangepips Feb 01 '11 at 21:22
  • Unfortunately, I don't have that sort of access. This thing is tighter than a drum. – ale Feb 01 '11 at 21:25
  • 2
    Its its so tightly locked, I wouldn't be surprised if outgoing ports are blocked. Can you have a sysadmin confirm that you can make outgoing ftp connections from that server? – Edward M Smith Feb 01 '11 at 21:33
  • Indeed. I have a call into the IT people to check on it. – ale Feb 01 '11 at 22:07

4 Answers4

7

A "Connection Refused" error means that either the server you're trying to connect to isn't running an FTP server, or there's a firewall in your way that's preventing the connection.

An "User Authentication failed" error would usually occur if your credentials are bad.

FYI, for plain old FTP connections, the cfftp.errorCode may give you more information, once your are able to establish a connection. The errorCode will point to the response in the IETF FTP protocol standard , like "425", which would mean "Can't open data connection.".

Mark
  • 2,362
  • 18
  • 34
  • I have verified, for plain FTP connections, you will get a 530 Login authentication failed error for bad credentials, not connection refused. – Mark Feb 01 '11 at 21:44
1

Could be either one of those cases. Do you have a standalone FTP client to test with? Does it work from another machine?

scrittler
  • 1,121
  • 6
  • 8
  • Unfortunately, I am not allowed to install new tools, like an FTP client, and certainly not on the server. I think you're right; I changed the IP address I'm using to some other random address and got the same error, so I'm thinking I just can't connect. – ale Feb 01 '11 at 21:23
  • Most OS's have command line FTP clients. Windows XP, Server 2003, Linux, OSX. Just type "ftp hostname" at the command prompt. If there's no ftp command line client, you could always try the command line telnet client - "telnet hostname 21". This should also connect you. examples: "ftp ftp.biblio.org", "telnet ftp.biblio.org 21". – Mark Feb 01 '11 at 21:41
1

You can check your ability to connect to the FTP server using Telnet at the command prompt(On windows, Go to Start > Run > type cmd).

telnet my-domain-name.com 21

you can try at non default port as you wish. That will let you know if your machine can reach the FTP server, and you can try logging on to check your credentials.

Here's a good post: Understanding FTP using raw FTP commands and telnet

ale
  • 6,369
  • 7
  • 55
  • 65
Saul
  • 1,387
  • 5
  • 23
  • 45
  • As mentioned previously, I **do not** have access to any really useful tools, including the command line. – ale Feb 02 '11 at 13:53
1

hey check if your directory attribute is begining with a "/" character. this used to work through cf8 but stopped working for me in cf9 (specifically 9.0.1); also try the following and see if this helps:

<cfftp connection="mycon" server="myserver.com" action="open" username = "anonymous" password = "anonymous" />
<cfdump var="#mycon#" label="">
<cfftp connection="mycon" action="getcurrentdir" result="result"/>
<cfdump var="#result#" label="">

you may find that its the listdir that is giving you the problem, not the connection.

Andro Selva
  • 53,910
  • 52
  • 193
  • 240