Issue with backup and restore(FTP Code 7)

kevinwalter

Verified User
Joined
Jun 1, 2011
Messages
47
Hi,

I'm having issues with DA backup and restore.

/usr/local/bin/curl returned error code 7
curl: (7) Failed to connect to ******** port 21 after 2718 ms: Connection refused
FTP information invalid.

This indicates a problem with the connection.

Things I did already,
- I can connect on terminal using the ftp command and telnet to the ftp server.
- Added the IP of the ftp server to the CSF allow list.

Any more ideas?

I'm on AlmaLinux 8.6.

Regards,

Kevin
 
Hello,

Do you have probably installatron on the server? Do you have the file /usr/local/directadmin/scripts/custom/ftp_upload.php ?
 
Is the remote server also a Direct admin server?

If not then check if:
- The remote FTP server has the same passive ports enabled 35000-35999
- Your directadmin server only has 1 curl installed, either OS or from Custombuild, but not both
- Check mod security rules
 
Hello,

Do you have probably installatron on the server? Do you have the file /usr/local/directadmin/scripts/custom/ftp_upload.php ?
No installatron, I do have the ftp_upload.php script.

Is the remote server also a Direct admin server?

If not then check if:
- The remote FTP server has the same passive ports enabled 35000-35999
- Your directadmin server only has 1 curl installed, either OS or from Custombuild, but not both
- Check mod security rules
The remote server is a Synology NAS. Ports are open and enabled. A other DA server is working fine.
There were 2 curls installed. I removed the custombuild one and recompiled PHP. Unfortunately the same issue appears.

Any more suggestions?

By the way, If I connect using /usr/bin/curl itself it does work.
 
Last edited:
There were so many reports on the same error related to curl and ftp_upload.php, so I don't recall which was the exact thread it in. DirectAdmin developers reported they have a fix it and suggested trying. It might be available in beta or alpha release of DirectAdmin.

As an addition you might compare your scripts/custom/ftp_upload.php with scripts/ftp_upload.php and update or even remove scripts/custom/ftp_upload.php if it causes the issue.
 
Found the issue. Thanks @ DA support.

Somehow the passive ports where removed from TCP_OUT in CSF. They added it and it worked again! :-)
 
Back
Top