• Resolved therealgilles

    (@chamois_blanc)


    My posts systematically lose their cron event once cron runs. The log appears normal but clearly the plugin is not working anymore and hasn’t been for a while now:

    2023-01-22 15:05:49 DEBUG: 269377 -> CRON EVENT SCHEDULED at Thu, 26 Jan 2023 00:00:00 -0800 (1674720000) with options Array ( [expireType] => category-add [id] => 269377 [category] => Array ( [0] => 90 ) [categoryTaxonomy] => category ) , no errors found

    What is supposed to happen when a cron event runs when the expiration is set in the future? should it schedule a new event or leave the event in the list?

    Noting that this plugin used to run perfectly at some point in the past, so something got broken.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter therealgilles

    (@chamois_blanc)

    Looking at the debug log when I update the expiration date on a post (ID: 269377), it is referring to an incorrect ID (269378) that does not exist:

    2023-01-22 15:32:53	DEBUG: 269378 -> CRON EVENT SCHEDULED at Thu, 26 Jan 2023 00:01:00 -0800 (1674720060) with options Array ( [expireType] => category-add [category] => Array ( [0] => 90 ) [categoryTaxonomy] => [enabled] => 1 [id] => 269378 ) , no errors found
    2023-01-22 15:32:53	DEBUG: 269378 -> FOUND SCHEDULED CRON EVENT for the post
    2023-01-22 15:32:53	DEBUG: 269378 -> CLEARED SCHEDULED CRON EVENT, no errors found
    2023-01-22 15:32:53	DEBUG: 269378 -> EXPIRATION DATA REMOVED from the post
    2023-01-22 15:32:53	DEBUG: 269378 -> CRON EVENT SCHEDULED at Thu, 26 Jan 2023 00:01:00 -0800 (1674720060) with options Array ( [expireType] => category-add [category] => Array ( [0] => 90 ) [categoryTaxonomy] => [enabled] => 1 [id] => 269378 ) , no errors found
    2023-01-22 15:32:53	DEBUG: 269377 -> CRON EVENT SCHEDULED at Thu, 26 Jan 2023 00:01:00 -0800 (1674720060) with options Array ( [expireType] => category-add [category] => Array ( [0] => 90 ) [categoryTaxonomy] => category [enabled] => 1 [id] => 269377 ) , no errors found

    Seems like a bug.

    Thread Starter therealgilles

    (@chamois_blanc)

    Here is what I see before cron runs:
    https://ibb.co/64YcbHJ

    You can see the correct and incorrect post IDs. Then once cron has run, the events are gone, instead of remaining there because it’s not their due time.

    Thread Starter therealgilles

    (@chamois_blanc)

    Interestingly, while I can see the cron events for a short time through the admin interface, they never appear when listing with wp cron event list.

    Thread Starter therealgilles

    (@chamois_blanc)

    I also added an error_log() call to onActionRunPostExpiration and I don’t see anything in the debug.log, so either it’s never called or outputting to debug.log is disabled when running cron?

    Thread Starter therealgilles

    (@chamois_blanc)

    This is the command associated with the hook:

    PublishPressFuture\Modules\Expirator\Controllers\ExpirationController->onActionRunPostExpiration()

    Not sure if it’s correct, but I’m not sure it actually gets called.

    • This reply was modified 2 years, 2 months ago by therealgilles.
    Thread Starter therealgilles

    (@chamois_blanc)

    It looks like this is a conflict between this plugin and the caching plugin I use, LiteSpeed Cache. My best guess so far is that it is related to object caching, I’ll try to narrow it down.

    Thread Starter therealgilles

    (@chamois_blanc)

    I noticed LSCache object cache indicated that my redis extension was disabled, which was odd. Then I found out that I had switch my site to PHP 8.0 but had left the cron job running on PHP 7.4.

    I switched everything to PHP 8.1 (as I’m not sure the redis php extension is available for 8.0 on my machine). Everything looks good so far but it will take a bit to see if all the issues are sorted out.

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    Hi @chamois_blanc

    Caching plugins and services and the most common cause of problems with PublishPress Future.

    As you said now it looks good, I’ll close this thread. Feel free to reopen the discussion if the issue persists or you can open a new discussions.

    Thread Starter therealgilles

    (@chamois_blanc)

    To clarify, in my case, it wasn’t so much the caching plugin as the fact that something has gone wrong with the object cache setup. Maybe an OS package update disabled the redis extension for php. And then my using the wrong version of PHP for cron jobs was probably not helping.

    Thank you for the plugin and for fixing recent issues via the 2.8.3 release, much appreciated. And sorry for the false alarm.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Cron events disappear’ is closed to new replies.