Since updating from 5.29 to 5.31.0 on WordPress I am receiving the following error from my cron job:
Fatal error: Uncaught Exception: : in /home/*hostname*/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php:286
Stack trace:
#0 /home/*hostname*/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(193): CRM_Core_JobManager_scheduledJobFatalErrorHandler(Array)
#1 /home/*hostname*/www/www/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/*hostname*/www/www/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php(997): PEAR_Error->__construct('DB Error: unkno...', -1, 16, Array, 'TRUNCATE TABLE ...')
#3 /home/*hostname*/www/www/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-1, 16, Array, 'TRUNCATE TABLE ...')
#4 /home/*hostname*/www/www/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, 16, Array, 'TRUNCATE TABLE ...', 'DB_Error', true)
#5 /home/*hostname*/www/www/wp-content/plugins/civicrm/civicrm/vendor/pe in /home/*hostname*/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php on line 286
I am using WordPress 5.3.3 on a Linux Shared Server. The cron job being evoked is:
#!/bin/sh
php ~/www/www/wp-content/plugins/civicrm/civicrm/bin/cli.php -u *username* -p *password* -e Job -a execute
Any idea why this is happening? Thanks.
TRUNCATE TABLE ...
error looks like. FWIW, it's better not to runcron
viacli.php
but rather to use a route that goes via WordPress, e.g. WP-CLI or WP-REST.