Jump to content

Daily Cron not running unless using --force


Recommended Posts

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!

Link to comment
Share on other sites

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 by Kian
Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

@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...

278534322_ScreenShot2019-03-23at11_43_04AM.thumb.png.527832ca51752f44d933884d0fb0db3c.png

 

Link to comment
Share on other sites

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!!

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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!  

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated