FTP errors are bothersome.
And, it becomes more troublesome when you spend the whole day resolving these errors.
One such FTP error is “421 service not available“.
At Bobcares, we help server owners resolve such FTP errors as part of our Dedicated Support Services.
Today, let’s discuss the top 3 reasons for this error and how we fix them.
FTP error 421 service not available – A Quick Glance
FTP error code 4xx means that the connection hasn’t been attempted and the requested action hasn’t taken place. But, this condition is temporary, and the action may be requested again.
And, FTP error 421 service not available means that the connection to the remote server can’t be established. FTP clients such as Filezilla returns the error like this:
421 Service not available, remote server has closed connection.
FTP error 421 service not available – Causes & Fixes
Now, let’s discuss the common reasons for this error and how our Dedicated Engineers fix them.
1) Invalid FTP host
This error can occur when the FTP server can’t determine the IP address of the server by the hostname. And, the server logs(/var/log/messages) show this error.
getaddrinfo 'Hostname_Is_Here' error: Name or service not known warning: unable to determine IP address of 'host.domain.com domain
How we fix?
Here, our Support Experts first check the connectivity to the FTP host using the ping command.
ping host.domain.com
If ping doesn’t respond, we add the correct hostname in the following server configuration files.
/etc/hosts /etc/sysconfig/network
Most importantly, we restart the network service to reflect these changes.
/etc/init.d/network
On the other hand, on Plesk servers, we change the hostname from Tools & Settings > Server Settings.
2) Firewall restrictions
Another probable reason for this error is the incorrect firewall configurations or firewall restrictions.
We’ve seen instances where the remote server blocks connections from an IP address or IP address range. The IP can be blocked due to abnormal activities, too many connections, etc.
Similarly, another possibility is that the user is being blocked from making outbound connections either at the ISP end or at their local firewall. We’ve seen cases where third party firewall or antivirus on the system blocking FTP connections. Also, ISPs can block the normal outbound FTP traffic.
How we fix?
Firstly, our Support Experts ensure that the customer’s IP address isn’t blocked in the remote server. For example, we use the below command to determine if the customer’s IP address xx.xx.xx.xx is blocked.
csf -g xx.xx.xx.xx
And, if the IP is blocked, we’ll immediately remove the block and restore the FTP access. Later, we update the reason for the block and the remedial measures to the customer.
If there are no problems on the server side, we update customers to disable their security applications such as Antivirus, Windows firewall, etc. one by one. This helps us to identify which application is causing problems.
Alternatively, if the issue is at the ISP end, we get the traceroute results from the customer. This helps us to identify if the issue lies at the intermediate level.
Most importantly, if the customers are blocked at the ISP or local firewall level, we always suggest them to use SFTP for connection as it uses SSH for connecting.
3) FTP service configuration errors
Similarly, another variation of this error in ProFTP servers is given below.
test.com proftpd[130008] 127.0.0.1: Failed binding to ::, port 21: Address already in use test.com proftpd[130008] 127.0.0.1: Check to see if inetd/xinetd, or another proftpd instance, is already using ::, port 21
This error usually occurs when port 21 is already used by another application. It can also happen when the ProFTP service is stuck on the server. Similarly, errors in the FTP service configuration file can also create problems.
How we fix?
Firstly, our Support Engineers check the services listening on FTP port 21 using the netstat command.
netstat -plnt | grep :21
And, if we find that this port is used by multiple applications or another instance of proftpd, we’ll reconfigure these applications on alternate ports. For example, in plesk servers, we always ensure that the ServerType parameter is set to inetd in the ProFTP configuration file.
ServerType inetd
Here, the inetd/xinetd service listens on port 21 for connection requests, then start the proftpd and pass the connection off.
In case if we find that the FTP service is stuck on the server, we kill the dead process and restart the service using the below commands.
ps aux | grep proftpd
kill -9 PID
service xinetd restart
In addition to that, we ensure that the FTP configuration files(/etc/proftpd.conf and /etc/vsftpd.conf) are intact.
Recently, we were contacted by a customer that he can’t connect to FTP. The logs showed missing /var/run/proftpd/ directory. When we checked, the ProFTPd configuration file(/etc/proftpd.conf) was referring to this folder. But, this folder wasn’t created in the server. So, our Support Engineers went ahead and created the folder /var/run/proftpd/ to fix the issue.
[Need an expert to resolve your ongoing FTP problems? Our Experienced Support Experts can help you here.]
Conclusion
In short, FTP error 421 service not available can occur due to firewall restrictions, invalid FTP host and more. Today, we’ve discussed the top 3 reasons for this error and how our Dedicated Engineers fix them.
” width=”20″ height=”20″>
Im getting the 421 error “too many (15) connections” from Filezilla. I am at a loss as to why this is happening, it never happened before. My host said FTP is working fine on their end. I’ll be able to upload about 750 files, out of 17,000 I need to upload, then cant connect again.
I was also getting 421 error in my website while connecting to my FTP client “FileZilla”. Thankful to you for such a wonderful article. It helped me a lot!
Keep writing like this!