Support

Akeeba Backup for Joomla!

#21338 issue with CRON on a VPS server - Could not connect to MySQL

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 tampe125 on Friday, 31 October 2014 11:24 CDT

e-ware
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:
I have a VPS, and run multiple domains on it.
I am not having any issue with making backups of my domains that are using the shared/common IP of the VPS. I have one domain that has a different IP (for the SSL certificate) and runs on https - on this domain the same CRON that works fine for other domains does not work. I am gettign the error listed below.
Any suggestions?

Thank you!



PHP Fatal error: Uncaught exception 'RuntimeException' with message 'Could not connect to MySQL' in /var/www/vhosts/i-tica.com/httpdocs/administrator/components/com_akeeba/akeeba/drivers/mysqli.php:282
Stack trace:
#0 /var/www/vhosts/i-tica.com/httpdocs/administrator/components/com_akeeba/akeeba/abstract/driver.php(1048): AEDriverMysqli->query()
#1 /var/www/vhosts/i-tica.com/httpdocs/administrator/components/com_akeeba/akeeba/abstract/driver.php(939): AEAbstractDriver->execute()
#2 /var/www/vhosts/i-tica.com/httpdocs/administrator/components/com_akeeba/akeeba/platform/abstract.php(114): AEAbstractDriver->loadResult()
#3 /var/www/vhosts/i-tica.com/httpdocs/administrator/components/com_akeeba/akeeba/platform/platform.php(196): AEPlatformAbstract->load_configuration(1)
#4 /var/www/vhosts/i-tica.com/httpdocs/cli/akeeba-backup.php(380): AEPlatform->__call('load_configurat...', Array)
#5 /var/www/vhosts/i-tica.com/httpdocs/cli/akeeba-backup.php(380): AEPlatform->load_configuration(1)
#6 /var/www/vhosts/i-tica.com/httpdocs/cli/akeeb in /var/www/vhosts/i-tica.com/httpdocs/administrator/components/com_akeeba/akeeba/drivers/mysqli.php on line 282

tampe125
Akeeba Staff
Hello Erwin,

can you please double check if you have configured any additional database in the backup profile?
If so, can you please double check their access details?

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!

e-ware
Hello
I just checked:
I have only the default profile, and in that profile I have not added any additional databases.
Also, if I run the backup from the backend, it runs just fine. If I use the cron job, or if I run the script from the shell I get the error I posted.
Best regards
Erwin

e-ware
Not sure if this is important info, but I use MySQL, not MySQLi

tampe125
Akeeba Staff
When do you get this error?
Can you please attach the log you are getting from the CRON job?
Can you please double check if the PHP CLI executable that the CRON job is running has mysqli /mysql extension enabled?

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!

e-ware
Hello

The PHP CLI executable is running the extension.
There is nothing additional in the log of the cron job. I even ran the command from the shell, and the output I get is what I posted.

So in a nutshell: all the domains running on the shared IP are working fine, the domain that is in https/SSL on a separate IP, but on the same VPS is not working.
All of them use the same installation of PHP/MySQL...

Question is: why am I getting this error on that one domain?

tampe125
Akeeba Staff
What's the database server inside the configuration file of that site?
Is that localhost?
Can you please allow network connection in MySQL and try to change it to 127.0.0.1?
I suspect there are permission issues over the named pipe

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!

e-ware
Changed it from localhost to 127.0.01 in the confguration file, but same issue

tampe125
Akeeba Staff
While performing a backup from the CLI, we are simply asking Joomla CLI application to connect to the database. This means that Joomla performs the action and it cannot connect to the database.
Considering how robust, tested and widely used the Joomla! code is we can only assume that there is something strange about this VPS setup.
Most likely MySQL's TCP/IP support is disabled or the database user is not allowed to connect from whatever hostname it is reported by the PHP CLI.

Since the error occurs outside our code we do not know how we can help except by stating these possible issues.

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!

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!