Jon Erickson Posted March 15, 2019 Share Posted March 15, 2019 I've got my system cron job set up to run every 15 minutes (as often as my host allows) and it appears to be running correctly. In Automation Settings, I have the "Cron Status Ok" message with the last run date, being every 15 minutes. However the "daily" cron doesn't appear to be running. I never receive the "WHMCS Cron Job Activity" email with the report. I only receive the Domain Sync report multiple times a day. When I SSH in and run the cron with the --force and -vvv flags, everything runs smoothly, all 27 tasks are run and I receive the Activity email. But when I leave to let the cron run itself, it doesn't appear to run everything. I also have the "System cron doesn't appear to have run correctly" in Needing Attention within the Dashboard. Any help would be greatly appreciated! 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted March 16, 2019 Share Posted March 16, 2019 Check the activity log and see if it is outputting each step there. Each step should be listed as a new entry. If that isn't happening, then something else is up with the cron setup. 0 Quote Link to comment Share on other sites More sharing options...
Jon Erickson Posted March 16, 2019 Author Share Posted March 16, 2019 @steven99, I get the following logs each time the Cron is run... However, if I run the Cron via CLI with the force tag, it completes properly. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted March 20, 2019 Share Posted March 20, 2019 (edited) Daily cron runs at a specific time of day (Setup > Automation Settings > Time of Day) that is usually set to 0:00am. The log you posted comes from Domany Sync Cron which is another thing. Look for Cron Job: Completed in Utilities > Log > Activity Log. Edited March 20, 2019 by Kian 0 Quote Link to comment Share on other sites More sharing options...
Jon Erickson Posted March 20, 2019 Author Share Posted March 20, 2019 @Kian, I do not see that log entry unless I run the cron with --force. 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted March 21, 2019 Share Posted March 21, 2019 When you run --force, are you running that as the same user that WHMCS is running under or like root of the server? If root, try running it as the user. Also, in the cron settings (not whmcs), there should be an email field to send to and make sure that is filled out as it will send you errors then. 0 Quote Link to comment Share on other sites More sharing options...
Jon Erickson Posted March 21, 2019 Author Share Posted March 21, 2019 @steven99, When running with --force, it's via, I assume, root access after SSH'ing with the root credentials. However, I am not sure who cPanel/WHMCS runs the crons jobs as. Do you know? Also, I do not have a field for cron email in cPanel. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted March 22, 2019 Share Posted March 22, 2019 @Jon Erickson Try running the cron with -vvv on the end instead of -force to see what output shows 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted March 22, 2019 Share Posted March 22, 2019 Crons should run as the cpanel user. In cpanel -> cron jobs, there should be an email field as sorta described in https://documentation.cpanel.net/display/74Docs/Cron+Jobs . Another option is to manually add it to the crontab via ssh for the user via: crontab -e -u USERNAME and insert: email=webmaster@example.com At the top of the cron . 0 Quote Link to comment Share on other sites More sharing options...
Jon Erickson Posted March 22, 2019 Author Share Posted March 22, 2019 @WHMCS ChrisD @steven99, The email must be disabled by my hosting provider because I do not have that field available. Also, I do not have root privileges to manually add to crontab. I am on a linux reseller hosting account. 0 Quote Link to comment Share on other sites More sharing options...
Jon Erickson Posted March 22, 2019 Author Share Posted March 22, 2019 @steven99, Wow, totally must have missed it. It was hiding under a more link. I've added my email and hopefully will receive some kind of error log or such letting me know what's going on. 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted March 23, 2019 Share Posted March 23, 2019 Make sure to do the -vvv switch in the cron also. 1 Quote Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted March 23, 2019 Share Posted March 23, 2019 @Jon Erickson Your cron will only run once a day (the full cron) the other options run at various points of the day as per https://docs.whmcs.com/Crons#Task_Options_for_skip_.26_do so as long as you let it run with your email and -vvv at the time of the day (Settings > Automation Settings) then it should provide a full output 1 Quote Link to comment Share on other sites More sharing options...
Jon Erickson Posted March 23, 2019 Author Share Posted March 23, 2019 @steven99 and @WHMCS ChrisD, after changing the cron to: /usr/local/bin/php -q /home/soldeschutes/data/crons/cron.php -vvv ...I let the cron do its thing over night. The Daily Automation Tasks ran at 0000 as it was suppose too, but still not receiving a Completed log entry. I also did not receive any email with any kind of error. This is what my logs look like, with a couple entries on the previous page as well... 0 Quote Link to comment Share on other sites More sharing options...
WHMCS ChrisD Posted March 24, 2019 Share Posted March 24, 2019 @Jon Erickson, ok so it seems that the cron errors out around the point of the invoice generation, what is your PHP Max Timeout set to? You can check by running the following in your server terminal window php -ini | grep "max_execution_time" 0 Quote Link to comment Share on other sites More sharing options...
tuuni Posted March 25, 2019 Share Posted March 25, 2019 Hi there, Actually i have the same kind of problem here. I installed WHMCS throght Softaculous, it installed the cron folder outside public_html. Located in: /home/test123/data/crons/cron.php. I tried to put chmod 775 to see if there's any difference, but this was not the issue. Only if i force the cron update then it successfully finishes it. Is this a bug? I also ran into error 500 connection timeout error if i manually click Setup->Payments->Currencies->"Update Product Prices" button. I takes ~300 seconds every time when the timeout occurs. It did not do this before, it started doing this after i added ~20 currencies, before was 2. The last check if i did to see if the max execution time is correct. After running the code you give, i got this response: php -ini | grep "max_execution_time" max_execution_time => 0 => 0 I am using php 7.3. phpinfo() shows me that ini file is located in here which is correct: Loaded Configuration File /opt/alt/php73/etc/php.ini i have set max_execution_time to 10800 (3 hours), which is also set in that same php.ini: max_execution_time 10800 10800 and max_input_time 10800 10800 Next i tried to see where else it comes up in the server, i did this: grep -r 'max_execution_time' / I highlight and found only those, and everything seems to be as it should. test123@testdm [/]# grep -r 'max_execution_time' /etc/ /etc/cl.php.d/alt-php73/alt_php.ini:max_execution_time=10800 /etc/cl.php.d/alt-php71/alt_php.ini:max_execution_time=1200 /etc/cl.php.d/alt-php72/alt_php.ini:max_execution_time=3000 I think those are probably cPanel configurations anyways, where to go from there? Thanks!! 0 Quote Link to comment Share on other sites More sharing options...
tuuni Posted March 25, 2019 Share Posted March 25, 2019 Also i post the output here just in case: test123@testdm [/]# /opt/alt/php73/usr/bin/php -q /home/test123/data/crons/cron.php -F all -vvv WHMCS Automation Task Utility: all ================================== Daily Cron Automation Mode Queuing Tasks ------------- Force run any tasks: ignore "in progress" and "is due" Task queues ready Executing Application Queue --------------------------- 0/27 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% < 1 sec/< 1 sec 26.0 MiB Currency Exchange Rates 1/27 [▓░░░░░░░░░░░░░░░░░░░░░░░░░░░] 3% 1 sec/27 secs 26.0 MiB Product Pricing Updates Tick to enable logging of PHP Errors when possible (Not recommended for daily production use) 2/27 [▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░] 7% 16 mins/3 hrs 26.0 MiB Invoices 3/27 [▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░] 11% 16 mins/2 hrs 28.0 MiB Late Fees 4/27 [▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░] 14% 16 mins/1 hr 26.0 MiB Credit Card Charges 5/27 [▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░] 18% 16 mins/1 hr 28.0 MiB Invoice & Overdue Reminders 6/27 [▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░] 22% 16 mins/1 hr 28.0 MiB Domain Renewal Notices 7/27 [▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░] 25% 16 mins/1 hr 28.0 MiB Cancellation Requests 8/27 [▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░] 29% 16 mins/54 mins 30.0 MiB Overdue Suspensions 9/27 [▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░] 33% 16 mins/48 mins 30.0 MiB Overdue Terminations 10/27 [▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░] 37% 16 mins/43 mins 30.0 MiB Fixed Term Terminations 11/27 [▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░] 40% 16 mins/39 mins 30.0 MiB Inactive Tickets 12/27 [▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░] 44% 16 mins/36 mins 30.0 MiB Delayed Affiliate Commissions 13/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░] 48% 16 mins/33 mins 30.0 MiB Affiliate Reports 14/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░] 51% 16 mins/31 mins 30.0 MiB Email Marketer Rules 15/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░] 55% 16 mins/29 mins 30.0 MiB Credit Card Expiry Notices 16/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░] 59% 16 mins/27 mins 30.0 MiB SSL Sync 17/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░] 62% 16 mins/25 mins 30.0 MiB Server Usage Stats 18/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░] 66% 16 mins/24 mins 34.0 MiB Overage Billing Charges 19/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░] 70% 16 mins/22 mins 34.0 MiB Client Status Update 20/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░] 74% 16 mins/21 mins 34.0 MiB Domain Expiry 21/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░] 77% 16 mins/20 mins 34.0 MiB Ticket Escalation Rules 22/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░] 81% 16 mins/19 mins 34.0 MiB Data Retention Pruning 23/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░] 85% 16 mins/18 mins 34.0 MiB WHMCS Updates 24/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░] 88% 16 mins/18 mins 40.0 MiB Run Jobs Queue 25/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░] 92% 16 mins/17 mins 40.0 MiB Domain Transfer Status Synchronisation 26/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░] 96% 16 mins/16 mins 40.0 MiB Domain Expiry Synchronisation 27/27 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% 16 mins/16 mins 42.0 MiB Sending Daily Cron Digest email Executing System Queue ---------------------- 4/4 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% < 1 sec/< 1 sec 42.0 MiB [OK] Completed 0 Quote Link to comment Share on other sites More sharing options...
tuuni Posted March 26, 2019 Share Posted March 26, 2019 Found another issue, for some reason after Cron has (focefully) finished doing it's daily jobs, then Setup->General Settings "Domain" and "WHMCS System URL" is changing from https:// to http:// all the time and i cannot log in the use after this. Any ideas? Thanks! 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted March 26, 2019 Share Posted March 26, 2019 Well, the changing of URLs is a bit odd and leads me to wonder if you have custom hooks or other items that are causing that and potentially the daily cron not completing. Which at this point you may want to reduce any custom items you may have, including hooks, to see if that helps with both. 0 Quote Link to comment Share on other sites More sharing options...
Jon Erickson Posted March 27, 2019 Author Share Posted March 27, 2019 @steven99 and @WHMCS ChrisD, I’ve since changed from a shared hosting environment to a VPS and all issues have resolved. I’m just gonna chalk this up to a server config error. Thanks for the help! 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.