Support

Akeeba Backup for Joomla!

#37108 latest version of akeeba backup but not sending to transfering via ftp

Posted in ‘Akeeba Backup for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
3.10.8
PHP version
7.4
Akeeba Backup version
8.1.4

Latest post by nicholas on Thursday, 12 May 2022 12:19 CDT

pauloneal

EXTREMELY IMPORTANT: Please attach a ZIP file containing your Akeeba Backup log file in order for us to help you with any backup or restoration issue. If the file is over 10MiB, please upload it on your server and post a link to it.

 

EXTREMELY IMPORTANT: Please attach a ZIP file containing your Akeeba Backup log file in order for us to help you with any backup or restoration issue. If the file is over 10MiB, please upload it on your server and post a link to it.\

 

every time i try and create a backup i get this error:

Failed to process file /home/customer/www/intranet.media-ten.com/public_html/administrator/components/com_akeeba/backup/site-intranet.media-ten.com-20220510-150724-mt3byjOySWVnURuK.jpa Error received from the post-processing engine: Uploading /home/customer/www/intranet.media-ten.com/public_html/administrator/components/com_akeeba/backup/site-intranet.media-ten.com-20220510-150724-mt3byjOySWVnURuK.jpa has failed. Post-processing interrupted -- no more files will be transferred   I attempted to transfer a backup manually and this worked, but only once. since then it has connected (we have watched the connection take place on the server) but it never successfully sends the files.     

tampe125
Akeeba Staff

Hello,

can you please share the backup log? Looking at what you're reporting, I suspect you have to change the state of the FTP connection mode (if "passive" was checked, you should uncheck it and viceversa).

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

pauloneal

whenever i try and attach the log file, it fails to send the message! let me try the passive/not passive checkbox and get back to you

pauloneal

debug log

pauloneal

Ok, check the server where the files are meant to be transfered to, and it has a file for 0B

tampe125
Akeeba Staff

Your backup log gets blocked since it's too large. Please zip it and attach it.

A 0byte file means that the data transfer doesn't happen. If even by toggling the passive option the transfer fails, it means that there's a firewall blocking the connection between your servers. In this case it's not possible to perform the transfer, I'd suggest you to switch to SFTP so it only needs one port and usually is more reliable as solution.

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

pauloneal

when trying SFTP i get this error:

Your web server does not have the SSH2 PHP module, therefore can not connect to SFTP servers.

tampe125
Akeeba Staff

Please get in touch with your host and ask them to enable such module, so you'll be able to use SFTP 

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

pauloneal

what port numbers do you want open on the firewall to make sure this works?

tampe125
Akeeba Staff

There isn't a specific port to open, since both servers will talk each other and after the established the command connection on port 21, they will try to arrange a connection for data transfer. If both are blocking the connection, it's impossible to establish a connection. More info here: https://www.exavault.com/blog/active-vs-passive-ftp

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

pauloneal

Port 21 and 22 are both open, these backups worked before our subscription ran out, we repurchased a license and only the intranet.media-ten.com ran, but only once.

I've check the firewall and theres no issues there.  The test setup works.  Any other ideas 

 

Andy

IT Manager

nicholas
Akeeba Staff
Manager

> Your web server does not have the SSH2 PHP module, therefore can not connect to SFTP servers.

This message is self-explanatory.

The version of PHP you are using to run your site does not have the PHP extension “ssh2”. This is something that your host needs to install and enable on your site.

Kindly note that this is already documented in https://www.akeeba.com/documentation/akeeba-backup-joomla/data-processing-engines.html#postproc-sftp. Please allow me to quote our documentation:

This engine uses the PHP extension called SSH2. The SSH2 extension is still marked as an alpha and is not enabled by default or even provided by many commercial hosts. In this case you may want to use the Upload to Remote SFTP server over cURL engine instead which uses PHP's cURL extension, available on most hosts.

> what port numbers do you want open on the firewall to make sure this works?

I am baffled. You are an IT manager. The question as posed makes no sense. What do you want me to say? SFTP: port 22. FTP: ports 21, 20 and 1024 to 65535. It's true but it sounds completely daft as you shouldn't (and don't need to!) open all these ports unconditionally.

If you don't already know, please do read how FTP works. Remember that Akeeba Backup uses Passive FTP by default.

If the connection takes place but there is no data transfer (the resulting file is 0 bytes) your problem is definitely that something in either the WEB or STORAGE server is blocking the data channel connection. Connecting and logging into the FTP server happens over the command channel (port 21). So does creating the folders and initiating the file upload. At this point the storage server starts listening to a randomly numbered port (the data channel of the connection) and tells your web server about it over the command channel (established over port 21). Your web server needs to open an outgoing connection to that random port and start sending the file data. If it fails to do so the connection times out and you end up with a zero byte file.

Our problem is that your web server needs to allow outgoing connections to this random data channel port. Of course you cannot open all ports 1024-65535 unconditionally, you might just as well drop the outgoing firewall rules! You need to open these ports conditionally: if they are related to an FTP connection made to a server's control channel over port 21. You do that with iptables and Linux' nf_conntrack_ftp kernel module. If an outgoing connection is opened related to the command channel port we should allow it.

Likewise, the storage server needs to only be listening to ports 21 (FTP command channel) and 20 (active FTP). Again, it should only open a connection to a random port 1024-65535 if it's related to the already established FTP connection. 

Linking the random ports to established connections prevents exploitation of the open ports after the command channel closes.

On the STORAGE server end you can enable incoming FTP traffic with a simple set of iptables rules and the nf_conntrack_ftp kernel module:

modprobe nf_conntrack_ftp
iptables -A INPUT -p tcp -m tcp --dport 21 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 20 -m conntrack --ctstate ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -m tcp --sport 1024: --dport 1024: -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p tcp -m tcp --sport 21 -m conntrack --ctstate ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -m tcp --sport 20 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p tcp -m tcp --sport 1024:65535 --dport 1024:65535 -m conntrack --ctstate ESTABLISHED -j ACCEPT

On the WEB server you can enable outgoing FTP traffic very similarly:

modprobe nf_conntrack_ftp
iptables -A INPUT -p tcp -m tcp --sport 21 -m conntrack --ctstate ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -m tcp --sport 20 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp -m tcp --sport 1024: --dport 1024: -m conntrack --ctstate ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -m tcp --dport 21 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -m tcp --dport 20 -m conntrack --ctstate ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -m tcp --sport 1024:65535 --dport 1024:65535 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT

Since Linux 4.7 you also need to set net.netfilter.nf_conntrack_helper=1 via sysctl (e.g. put it in /etc/sysctl.d/conntrack.conf). 

If I understand correctly you are doing your own in-house IT management. You should really have a UNIX sysadmin, this is pretty standard stuff.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Easter vacation: We will be closed from 17 April 2025 16:00 UTC to 21 April 2025 06:00 UTC due to observing the Christian Easter holiday. Support will be closed during that time for both new tickets, and replies to existing tickets.

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!