Support

Akeeba Backup for Joomla!

#27195 Test SFTP connection failure

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
n/a
PHP version
n/a
Akeeba Backup version
n/a

Latest post by on Sunday, 02 April 2017 17:17 CDT

HESC-PWSI
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 2Mb, please upload it on your server and post a link to it.

Description of my issue:

When I test the connection in the backend of Joomla, I get this message:
SFTP Connection Test
Could not connect to the remote SFTP server.
Your web server does not have the SSH2 PHP module, therefore can not connect to SFTP servers.

I have discussed this with the techs in charge of the Linux servers. Both the web server and the receiving server have SSH2 installed and enabled. We have been able to connect manually from the web server to the receiving server using the User account information.

I traced this error message to the code in a few places in Akeeba:
public function connect()
                {
                                // Try to connect to the SSH server
                                if (!function_exists('ssh2_connect'))
                                {
                                                throw new \RuntimeException('Your web server does not have the SSH2 PHP module, therefore can not connect to SFTP servers.', 500);
                                }
 
                                $this->connection = ssh2_connect($this->host, $this->port);
 
                                if ($this->connection === false)
                                {
                                                $this->connection = null;
 
                                                throw new \RuntimeException(sprintf('Cannot connect to SFTP server [host:port] = %s:%s', $this->host, $this->port), 500);
                                }


So it seems that the website is failing the check to the ssh2_connect statement. What is this missing? What should I be asking our techs for to prove that the SSH2 module (and lib) is installed and enabled?

Where do I go from here...

nicholas
Akeeba Staff
Manager
The SSH2 extension is largely experimental. It was only recently made available for PHP 7.0 and only if you self-compile it with PECL. It's very likely that your host does not have that extension set up in their server. Moreover, SSH2 seems to have some issues with some SFTP servers. For these reasons the current beta version of Akeeba Backup (5.3.0.b1) has a new method called "Upload to SFTP server over cURL". This uses the PHP cURL extension instead which is more likely to be installed on the server and compatible with a wider selection of SFTP servers.

That leaves you with two courses of action. Either ask your host to install the SSH2 extension or give our beta version a go.

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!

HESC-PWSI
My Linux server people want to know what directory Akeeba backup expects the SSH2 module to be located at - it is possible that there is a mismatch between the server and your software.

Once I know where it looks for it, then I can let them know where it needs to be.

nicholas
Akeeba Staff
Manager
The SSH2 we're talking about is a PHP extension. PHP extensions are loaded in the php.ini file. The location of the php.ini file depends on how THEY have set up THEIR server. I am not your host and I have not set up your server. I cannot possibly tell your "Linux server people" how to do their job - especially for a task that's so simple that even an intern can do in his sleep.

I believe that you should be looking for a competent web host instead. I recommend, in no particular order, SiteGround, EuroVPS, CloudAccess.net and Rochen.

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!

HESC-PWSI
We are a US state government agency that has recently reorganized our ITS staff into a single huge group (previously it was each agency had it's own ITS staff). Sometimes they end up putting software in the wrong area on Red Hat - not the first time we have had that issue.

So changing our host is not possible.

I just installed the 5.3.0.b1 version on a test site, and the results from the Test SFTP Connection button was an error message "Could not connect to the remote SFTP server. The error message was:" with a red bar that only contained an "Y"

Not a helpful message for me, but perhaps you have an idea of what it means or where it is located.

Thank you.

nicholas
Akeeba Staff
Manager
Hm, being stuck with that host will be a small challenge. If your Linux people have managed to compile the PHP SSH2 library they can install it like any other PHP module. After making the php.ini changes they have to restart Apache (and the PHP FastCGI server if they're using FastCGI). I don't use any RedHat or CentOS servers, I am only familiar with Ubuntu Server so I can't give any more precise instructions.

Regarding the beta version, it would appear that cURL can't connect to the remote server and the only response from the remote server was "Y". I know that's not helpful, but that's what the remote server replied. Are you sure you are connecting to an SFTP server? I would expect to see this kind of unhelpful response if I tried to connect to an FTP server or another service (wrong port) on the remote server.

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!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

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!