Cannot establish FTP connection

whipworks

Well-Known Member
Aug 19, 2014
194
11
68
cPanel Access Level
Reseller Owner
Hi,

We're getting these errors trying to connect to the server using FTP.

Error: The data connection could not be established: ECONNREFUSED - Connection refused by server

Any reason why? Thanks.
 

CiboloJack

Registered
Oct 31, 2019
2
0
1
[email protected]
cPanel Access Level
Website Owner
This has been going for me for a couple of days. I have created new FTP accounts, which return the username and password are incorrect. The other ftp accounts, which worked a few days ago are returning the same error. I cannot ftp into ANY of 15 websites which I manage. When will this be addressed?
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
Error: The data connection could not be established: ECONNREFUSED - Connection refused by server
This error specifically, seems to indicate that the connection is being refused by the web server - this is typically a port not being open properly. Ultimately there's not enough information provided here to give you another cause - are you able to access any logs on the webserver, namely /var/log/messages? If you are able to - the log entries when the connection attempt is occurring may be useful.
 

whipworks

Well-Known Member
Aug 19, 2014
194
11
68
cPanel Access Level
Reseller Owner
This error specifically, seems to indicate that the connection is being refused by the web server - this is typically a port not being open properly. Ultimately there's not enough information provided here to give you another cause - are you able to access any logs on the webserver, namely /var/log/messages? If you are able to - the log entries when the connection attempt is occurring may be useful.
We get this....

Data connection timed out.
Data connection timed out.
Data connection timed out.
Falling back to PORT instead of PASV mode.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston

mathx

Active Member
Jan 16, 2017
26
3
3
Toronto
cPanel Access Level
DataCenter Provider
whipworks tech here.

some reason the server side is writing (from strace):

[pid 23721] write(6, "227 Entering Passive Mode (SERVER.ROUTER.NET.1,209,120)\r\n", 50) = 50

where SERVER.ROUTER.NET.1 is the actual gw of the cpanel server.

where would it get that idea? this isnt a natted setup yet it's doing that....

....[time passes]...

grep that ip -r in /etc and i get

pure-ftpd.conf:ForcePassiveIP SERVER.ROUTER.NET.1

I nor any of the other techs would have ever set that. Where the heck did that come from!?!?
 
  • Like
Reactions: cPanelLauren

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
That's interesting, it should definitely look like this in its default state:

Code:
[[email protected] ~]# grep ForcePassiveIP /etc/pure-ftpd.conf
# ForcePassiveIP               192.168.0.1
I'm not sure what would have not only changed that but changed it to the hostname rather than the IP address.

If you comment that line out like it is in my test server are you able to FTP normally?

If so - change it here as well:

Code:
var/cpanel/conf/pureftpd/local
 

mathx

Active Member
Jan 16, 2017
26
3
3
Toronto
cPanel Access Level
DataCenter Provider
Yeah if you dont change it in /var/cpanel/conf/pureftpd/main (by removing it, nothing is commented out there), then it will eventually rewrite the config file and restart the daemon (5.5 weeks later?) and cause the same issue.