Error in Log Table
-
Hey there, wondering if you can point me in the right direction here.
I’m using this as a library (v 3.5.4) for another plugin, and am seeing the following in the
wp_actionscheduler_logstable over and over:action failed via WP Cron: Scheduled action for MYACTION will not be executed as no callbacks are registered.The strange thing is, the
MYACTIONactually does fire off properly, and there is nothing in debug.log (yeah, i have debugging logged enabled)
-
Hi,
May I ask what was the MYACTION, what was the scheduled action? So that we can check better for you.
You can use Snipboard, https://snipboard.io, to send us a screenshot of the error on your end as well.
Looking forward to hearing from you.
It’s an action that runs a method to clear cache purging log file. And I apologize, it actually is not firing off as previosly stated
-
This reply was modified 2 years, 9 months ago by
Kevin Pirnie.
Error Screenshot: https://prnt.sc/7hg7r-51zjDs
And the associated code:
// let's see if we're already scheduled to do this if ( false === as_has_scheduled_action( 'kpcpc_the_log_purge' ) ) { add_action( 'kpcpc_the_log_purge', function( ) : void { // get the logs path $_l_path = ABSPATH . 'wp-content/purge.log'; // unfortunately we cannot utilize wordpress's built-in file methods, but let's clear the log file_put_contents( $_l_path, '', LOCK_EX ); } ); // get our schedule options $_bi_schedule = ( $_opts -> cron_log_purge_schedule ) ?? 'weekly'; // $timestamp, $interval_in_seconds, $hook, $args = array(), $group = '', $unique = false as_schedule_recurring_action( time( ), $_bi_schedule, 'kpcpc_the_log_purge' ); }Again, there is nothing in the debug.log about this erroring out, and it works when I manually clear it via a button in wp-admin: https://prnt.sc/jP_0l_i1yckh
$_bi_schedule populatesproperly, in this case it’s set to hourly (I made sure to var_dump it)Hi @kevp75
Thanks for sharing further information above.
Kindly be informed that custom coding is not something we can assist with directly. However, I’ll keep this thread open for a bit to see if anyone from the community can lend a hand.
If you have any other questions related to development or custom coding, don’t hesitate to reach out to some of the great resources we have available for support. The WooCommerce community is filled with talented open-source developers, and many of them are active on the channels listed below:
- WooCommerce Developer Resources Portal
- WooCommerce Advanced Facebook group
- WooCommerce Developer Slack Channel
- Hire a WooCommerce Expert
Hope this helps!
So in otherwords you refuse to support your own plugin?
Ok, good to know.
You can close this, I will go another route, and make sure any site I work on does not use this.
The same error even shows for WooCommerce, which if I’m not mistaken is also your plugin correct?
2023-03-15 11:59:34 +0000action created2023-03-21 18:20:05 +0000action started via WP Cron2023-03-21 18:20:05 +0000action failed via WP Cron: Scheduled action for woocommerce_cleanup_draft_orders will not be executed as no callbacks are registered.0
Screenshot: https://prnt.sc/lDCrRX9ZTEbG
Hi @kevp75
This message means that the scheduled action
woocommerce_cleanup_draft_ordersis not able to run because there are no callback functions registered to this action.In WooCommerce, scheduled actions like these are set to be executed at regular intervals (like cron jobs) to perform specific tasks such as cleaning up draft orders that were never finalized. These tasks are performed by a callback function registered to the action.
If no callbacks are registered for
woocommerce_cleanup_draft_orders, the system generates this message to indicate that this action was unable to perform its intended task since no function was associated with it.To resolve this, you may want to run a full conflict test to verify if a third-party plugin, your theme or a custom code is the root cause.
Hope this helps!
You obviously did not read what I posted.
This message means that the scheduled action woocommerce_cleanup_draft_orders is not able to run because there are no callback functions registered to this action.Is the exact message I am getting for mine… yet there is a callback registered to the action…
I have already run through all the “normal” diagnosis steps.
Again… good to know that you refuse to support your own plugin, I have made note of this for future reference.
The same error even shows for WooCommerce, which if I’m not mistaken is also your plugin correct?
2023-03-15 11:59:34 +0000action created2023-03-21 18:20:05 +0000action started via WP Cron2023-03-21 18:20:05 +0000action failed via WP Cron: Scheduled action for woocommerce_cleanup_draft_orders will not be executed as no callbacks are registered.0
Thanks for reporting this. I have created https://github.com/woocommerce/woocommerce/issues/37428 to address this
-
This reply was modified 2 years, 9 months ago by
The topic ‘Error in Log Table’ is closed to new replies.