1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 1.2.3 Cron Entries Not Running

Discussion in 'Troubleshooting and Problems' started by Divvens, Nov 25, 2013.

  1. Divvens

    Divvens Well-Known Member

    One of my users told me that he should have received a trophy, and for the past 12 hours even though he reached the criteria he hasn't received the trophy.

    I'm running 1.2.3, and it seems my cron entries are all stuck in the past, it's currently 4:16 AM GMT (24th), I'm given to believe that cron entries are shown in GMT Was mistaken about it, it was stuck in 4:16 AM my local time.

    However, all of them have a next update time of 24th (past), and the cron entries don't seem to be running
    Last edited: Nov 25, 2013
  2. Divvens

    Divvens Well-Known Member

    I've got it to work after reading a few other threads, I see that the time in Cron Entries actually shows my local time setting,

    I disabled one of the crons and re-enabled it, it has since updated and not stuck in the past anymore.

    Any reasons why this would happen? My page_container template isn't modified, and the only add-on that adds a cron entry is Sitemaps by @Rigel Kentaurus which has been working without problems since installation.
  3. Divvens

    Divvens Well-Known Member

    I have tried to see if the cron created by the add-on caused this problem by running the cron out of its scheduled time, after the cron was run the other crons also run properly. So it seems this issue isn't related to the add-on (it never had a problem to begin with).

    Did something possibly change from 1.2.2 to 1.2.3, or maybe this is a issue that is effecting only my board? If so, how do I debug to find out the possible causes of the issue?

    Found an issue here in this thread that said the feeder cron was causing an issue, would like to clarify that I do not have any RSS Feeds that create content, so the issue is not similar.

    Edit 2:
    I have disabled the feeder cron entry, it isn't used on our board and I'll notice if that was the one causing the problem.
    Last edited: Nov 25, 2013
  4. Mike

    Mike XenForo Developer Staff Member

    I spent a while debugging this for someone over the weekend (the linked thread). As far as I could tell, the script was being semi-randomly killed while it was running. The cron script would start to run actually be killed before anything had actually run in it, but enough had been started such that other parts of the system thought it had run. If that's what's happening here, it's really rather nightmarish to sort in code because nothing can truly be trusted to run.

    So I'd check if there's any info logged at the server level regarding processes being killed or the like.

    1.2.3 starts the cron and immediately tells it to run in 5 minutes in case there's a fatal error. Then it runs the pending cron(s). If they run successfully, it then automatically detects the correct next run time. (The script was getting killed between starting and setting the next run time -- very hard to deal with from a code perspective.)
    Divvens likes this.
  5. Divvens

    Divvens Well-Known Member

    I run on a shared host, can I access the logs of processes being killed via cPanel, or should I get my host to check it for me?
  6. Mike

    Mike XenForo Developer Staff Member

    You might be able to see something in the Apache error log, but I would ask your host (though if I'm honest, I wouldn't expect much from them).
  7. Divvens

    Divvens Well-Known Member

    Our server runs LiteSpeed, the error log is clean in cPanel, I've contacted my host, what they said is that processes getting killed is unlikely since that only happens in an event if we exceed the given resources (which we haven't).

  8. Mike

    Mike XenForo Developer Staff Member

    Well, please let me know if it happens again then. I really see no reason for it to happen unless a process gets killed.

    Just to double check, are there any errors logged in the control panel that might be related?
  9. Divvens

    Divvens Well-Known Member

    I'll let you know if this repeats again Mike, it hasn't since this morning after I disabled and enabled + refreshed one of the cron entries.

    There are no errors logged either in ACP (xF) or in the cPanel error log, double checked it :)
  10. Luke F

    Luke F Well-Known Member

    I've had this happen on my live board - was resolved by setting next_run manually in the database. For some reason the next run times were all several days in the past - surely the logic should handle this?

    If it makes a difference I am using the RSS feeder and a system cron calling deferred.php via curl every minute
    Divvens likes this.
  11. Divvens

    Divvens Well-Known Member

    Just had the problem repeat, it looks like for the past 9 hours the cron stopped running. Since its a weekend I didn't submitted a ticket, I just disabled and enabled a cron entry and refreshed to fix it.

    If it occurs again during a week day I'll open a ticket on xenForo. All error logs are clean and nothing has been logged (xenforo or control panel error log).
  12. Mike

    Mike XenForo Developer Staff Member

    I've spent extensive time debugging this for someone and the only reason I could see for it was the process getting killed (very quickly after it started actually). There's very little that we can do to truly prevent that if this is the case.
    The only way it fails is if the cron actually starts successfully but stops before one of the first lines in it (before any actions are actually run).

    There are a couple more tweaks coming in 1.2.4, but we're definitely getting into diminishing returns here.
    Divvens likes this.
  13. Divvens

    Divvens Well-Known Member

    @Mike 1.2.4 seems to have fixed any problems that we were facing with Cron Entries :) Was running 1.2.4 from the day it released, and the Cron Entries haven't bugged out even once.

Share This Page