paperweight Posted May 24, 2016 Share Posted May 24, 2016 I just updated from v5 to v6 last week and I found that for the past week no cron was running. I turned on emails in cron and this is what I found today as the response: <style>.genericError { border: 1px dashed #CC0000; font-family: Tahoma; background-color: #FBEEEB; padding: 10px; color: #CC0000; }</style> <div class="genericError"> <strong>Critical Error</strong><br /> Could not connect to the database. </div> My paths to cron are correct and I can run cron from SSH, so any idea what the database connect error means and how to fix it? 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted May 24, 2016 Share Posted May 24, 2016 is the new cron file running or the old one? http://docs.whmcs.com/Cron_Tasks http://docs.whmcs.com/Custom_Crons_Directory 0 Quote Link to comment Share on other sites More sharing options...
paperweight Posted May 24, 2016 Author Share Posted May 24, 2016 Thanks for your help. Yes I updated already to use the new cron locations, and I placed it outside the webroot. Here's what I did: 1) In configuration.php in the WHMCS root I added this custom location: $crons_dir = '/home/myname/whmcs-crons/'; 2) Then in the config at /home/myname/whmcs-crons/config.php I poinbted back to my WHMCS path: $whmcspath = '/home/myname/public_html/'; 3) Then in my cPanel I have cronjobs like these set: 0 0 * * * php -q /home/myname/whmcs-crons/cron.php */15 * * * * php -q /home/myname/whmcs-crons/pop.php >/dev/null 2>&1 */15 * * * * php -q /home/myname/whmcs-crons/pipe.php >/dev/null 2>&1 Any idea what's wrong with this config? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 24, 2016 Share Posted May 24, 2016 anything in the activity log? e.g is it starting to run and then crashing during the process or is it just not being called ? 0 Quote Link to comment Share on other sites More sharing options...
paperweight Posted May 24, 2016 Author Share Posted May 24, 2016 Hi I wanted to wait to respond until the daily cron ran on its own. It just ran and I again received the email error message. The Activity and Admin logs both lack any data related to this too. Anything else I can troubleshoot? 0 Quote Link to comment Share on other sites More sharing options...
paperweight Posted May 26, 2016 Author Share Posted May 26, 2016 Another 24 hours passed and the cron ran again. Again it shows the critical error. I'm instead running it direct from SSH. Any idea how to troubleshoot this? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 26, 2016 Share Posted May 26, 2016 have you worked through the Cron Job Issues page in the documentation? http://docs.whmcs.com/Cron_Job_Issues 0 Quote Link to comment Share on other sites More sharing options...
paperweight Posted May 27, 2016 Author Share Posted May 27, 2016 Ok I double-checked something else and found a possible problem. When I ran the cron via SSH before I was logged in as root, and cron ran fine. But then I swicthed user "su mywhmcsuser" and ran as "mywhmcsuser" and then I ran into this same error on SSH: php -q /home/mysitename/whmcs-crons/cron.php <style>.genericError { border: 1px dashed #CC0000; font-family: Tahoma; background-color: #FBEEEB; padding: 10px; color: #CC0000; }</style> <div class="genericError"> <strong>Critical Error</strong><br /> Could not connect to the database. So it appears to be a permissions problem? And is the permissions problem on the db or file? Seems to be on the db, right? Is there a cPanel cron setting I missed to allow the user to run this file and access the db? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 27, 2016 Share Posted May 27, 2016 perhaps this might help... https://forums.whmcs.com/showthread.php?89699-Cron-jobs-not-working&p=377723#post377723 Hello, In most of the cases where we've seen this, it's due to the user that the crons run as not having access to MySQL in their shell. You can confirm this by logging into shell as the cPanel user and running the mysql command. Every time we've seen this, it was resolved by changing the cPanel user's shell to "default." If this does not resolve the issue, please submit a ticket so that we may take a closer look. if it doesn't help, then i'd get that support ticket, with as much relevant info as possible, into support before the weekend begins. 0 Quote Link to comment Share on other sites More sharing options...
paperweight Posted May 28, 2016 Author Share Posted May 28, 2016 if it doesn't help, then i'd get that support ticket, with as much relevant info as possible, into support before the weekend begins. So I have notified both cPanel and Cloudlinux of the problem. Technicians from cPanel were in the server a couple days ago and saw it was a Cloudlinux problem related to CageFS and cron. Then I went to CloudLinux and they said there is an internal known issue related to the paper_lantern theme and cron jobs in some installs, but when I checked and fixed that my probelm persisted. So now Cloudlinux technician at this moment are in the server checking things. I will let you know results soon. 0 Quote Link to comment Share on other sites More sharing options...
paperweight Posted May 30, 2016 Author Share Posted May 30, 2016 Solved. It was an issue with CageFS. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.