Question : Cron log error : error: Connection to Mysql could not be established

System health says there are issues with Cron jobs not working

I’m seeing this error in the cronlog files

error: [Cake\Database\Exception\MissingConnectionException] Connection to Mysql could not be established: SQLSTATE[HY000] [2002] No such file or directory in /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/D
atabase/Driver.php on line 133
Stack trace …
Caused by: [PDOException] SQLSTATE[HY000] [2002] No such file or directory in /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Driver.php on line 125
Stack trace …

All the rest of the system appears to work fine through the web interface so I’m guessing its something to do with php run from the command line not getting some variables passed but I’m not sure.

Its a standard VM based installation that just worked apart from this bit. I’ve been back through the installation guide but can’t find anything that appears to be relevant.

Any hints or tips appreciated

App Version

3.16.3

DB Schema Version

20220921113150

Hello,

Can you send us about page from the instance to support@eramba.org?

Hi There! I’m facing a similar issue with my community installation. Running the bin/cake queue -v through the cronjob throws the error message below but it does work when connected to the container:

Caused by: [PDOException] SQLSTATE[HY000] [2002] No such file or directory in /var/www/eramba/app/upgrade/vendor/cakephp/cakephp/src/Database/Driver.php on line 121

any hints?