• Resolved Kevin Pirnie

    (@kevp75)


    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_logs table 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 MYACTION actually does fire off properly, and there is nothing in debug.log (yeah, i have debugging logged enabled)

Viewing 10 replies - 1 through 10 (of 10 total)
  • 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.

    Thread Starter Kevin Pirnie

    (@kevp75)

    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 1 year, 8 months ago by Kevin Pirnie.
    Thread Starter Kevin Pirnie

    (@kevp75)

    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

    Thread Starter Kevin Pirnie

    (@kevp75)

    $_bi_schedule populates properly, 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:

    Hope this helps!

    Thread Starter Kevin Pirnie

    (@kevp75)

    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.

    Thread Starter Kevin Pirnie

    (@kevp75)

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

    Thread Starter Kevin Pirnie

    (@kevp75)

    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.

    Plugin Contributor Ron Rennick

    (@wpmuguru)

    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

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Error in Log Table’ is closed to new replies.