Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

action_scheduler/migration_hook will not be executed as no callbacks are registered. #1019

Closed
majidempire opened this issue Dec 20, 2023 · 4 comments
Labels
needs feedback The issue/PR needs a response from any of the parties involved in the issue.

Comments

@majidempire
Copy link

Gm

I noticed that sometimes I get failed task like this:

acerror

and in the Log section is like this error:

2023-12-18T22:18:14+00:00 CRITICAL Uncaught InvalidArgumentException: Invalid action ID. No status found. in /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php:1173 Stack trace: #0 /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/action-scheduler/classes/ActionScheduler_ListTable.php(631): ActionScheduler_DBStore->get_status() #1 /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php(751): ActionScheduler_ListTable->prepare_items() #2 /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/action-scheduler/classes/ActionScheduler_AdminView.php(96): ActionScheduler_Abstract_ListTable->display_page() #3 /var/www/vhosts/domain.com/httpdocs/wp-includes/class-wp-hook.php(324): ActionScheduler_AdminView->render_admin_ui() #4 /var/www/vhosts/domain.com/httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #5 /var/www/vhosts/domain.com/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action() #6 /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/woocommerce/includes/admin/views/html-admin-page-status.php(41): do_action() #7 /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-status.php(23): include_once('...') #8 /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-menus.php(362): WC_Admin_Status::output() #9 /var/www/vhosts/domain.com/httpdocs/wp-includes/class-wp-hook.php(324): WC_Admin_Menus->status_page() #10 /var/www/vhosts/domain.com/httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #11 /var/www/vhosts/domain.com/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action() #12 /var/www/vhosts/domain.com/httpdocs/wp-admin/admin.php(259): do_action() #13 {main} thrown in /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php on line 1173

if you need more information let me know
Thanks

@lsinger
Copy link
Contributor

lsinger commented Jan 8, 2024

Thanks for the report, @majidempire! We'd like to know more about this so we can try to reproduce and fix it.

  • How did this task get created? We'd like to understand why no callback was associated with it.
  • The exception should be caught. Can you provide any additional details about how you executed the action?

@lsinger lsinger added the needs feedback The issue/PR needs a response from any of the parties involved in the issue. label Jan 8, 2024
@gin0115
Copy link

gin0115 commented Apr 22, 2024

Not sure if this helps, but I have this as an event on the dev site I am working on also. It self-re-creates after failure.

This is using AS as a lib in its own plugin.

lib/action-scheduler/classes/migration/Scheduler.php

The event is created, but it seems Scheduler::hook() is never actually called. (this registered its add_action())

However, if you do call (new Scheduler())->hook(); from the Migration\Controller's init method (assuming elsewhere would work too 🤷🏼), just once, it will not create itself again and not result in a failure.

This is included as mentioned in the docs (including action-scheduler.php)

Hope this helps in some way

@coreymckrill
Copy link
Contributor

@gin0115 it's a bit confusing why the Action Scheduler migration is trying to run, since that is from a pretty old version. Did you upgrade it recently?

Can you tell us:

  • What version you're currently running (and what you had before if recently upgraded)
  • What output you get if you run get_class( ActionScheduler_Store::instance() )
  • What value you have in the data base for the option schema-ActionScheduler_StoreSchema

@barryhughes
Copy link
Member

Closing due to lack of information/no further updates from the reporter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs feedback The issue/PR needs a response from any of the parties involved in the issue.
Projects
None yet
Development

No branches or pull requests

5 participants