Cron events disappear | WordPress.org

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.

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.

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.

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?

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.

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.

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.

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.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer