• Resolved vortac

    (@vortac)


    Hi!
    I am facing problems with installing WooCommerce on a live site (same site works on localhost). Tried everything: uninstall with complete removal, fresh install, PHP update, database cleanup, tweaking settings, deactivate actionscheduler, searching forums…I’m honestly lost…please help…

    Woocommerce is installed and active but I can’t configure it, settings are not saved, pages are not generated. I have deactivated the setup wizard with a hook because otherwise I was completely stuck in the wizard.

    This is the error message that is constantly poping up:
    Uncaught InvalidArgumentException: Unidentified action 0 in /live/wp-content/plugins/woocommerce/includes/libraries/action-scheduler/classes/ActionScheduler_wpPostStore.php:488 Stack trace: #0 /live/wp-content/plugins/woocommerce/includes/libraries/action-scheduler/classes/ActionScheduler_wpPostStore.php(475): ActionScheduler_wpPostStore->get_date_gmt(‘0’) #1 /live/wp-content/plugins/woocommerce/includes/libraries/action-scheduler/classes/ActionScheduler_wcSystemStatus.php(78): ActionScheduler_wpPostStore->get_date(‘0’) #2 /live/wp-content/plugins/woocommerce/includes/libraries/action-scheduler/classes/ActionScheduler_wcSystemStatus.php(52): ActionScheduler_wcSystemStatus->get_action_status_date(‘failed’, ‘oldest’) #3 /live/wp-content/plugins/woocommerce/includes/libraries/action-scheduler/classes/ in /live/wp-content/plugins/woocommerce/includes/libraries/action-scheduler/classes/ActionScheduler_wpPostStore.php on line 488

    Thanks for your help in advance!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • corsonr

    (@corsonr)

    Automattic Happiness Engineer

    Hi there,

    Based on this, and the error you shared that references the ActionScheduler, I’m thinking you could be having issues with the WP Cron; which is causing these processes to fail.

    The first thing I’d recommend would be to verify whether WP Cron is enabled on your website. You can verify this yourself by heading to WooCommerce > Status and, under the WordPress environment section, look for this option:

    https://cld.wthms.co/I8llC4

    If it is disabled, you’ll want to contact your host to get help in enabling it. If it shows as enabled, please install the plugin WP Crontrol. This will help you get a closer look at what could be causing these cron failures.

    Thread Starter vortac

    (@vortac)

    @saimonh Thanks for advising the plugin, tried it already and gave it a second try but didn’t help. The error message still pops up and woocommerce setup can’t be completed.

    @corsonr Hi, thanks also for your advise, WP Cron is enabled as shown in status, installed WP Crontrol but couldn’t figure out what is wrong. Manually triggering the action action_scheduler_run_queue returns a successful message but when I revisited the cron events table the following error showed up:
    There was a problem spawning a call to the WP-Cron system on your site. This means WP-Cron events on your site may not work. The problem was:
    cURL error 28: Operation timed out after 3000 milliseconds with 0 bytes received

    Any idea?

    Still woocommerce setup can’t be completed: pages do not install, settings data is not saved (like shop owner address and stuff), but the plugin is active.

    Thread Starter vortac

    (@vortac)

    Actually the list of scheduled actions lists one failed, otherwise it’s empty:
    List of Scheduled Actions, 1 Failed, Otherwise Empyt

    I have also installed Query Monitor as this was recommended somewhere to check for possible problems and found these when activating Woocommerce:
    Query Monitor Plugin: Database Errors
    Query Monitor: API Calls SSLverify error

    The database error might be a separate problem from Action Scheduler. Could the latter one have something to do with my provider/hosting settings? Possibly restricting loopbacks in wp-cron?

    madeincosmos

    (@madeincosmos)

    Automattic Happiness Engineer

    Hi @vortac,

    Looking at the screenshots you’ve sent, there’s a Duplicate entry '0' for key 'PRIMARY' error repeated a few times in Query Monitor. This error means that some database records have ID number 0, which should normally be never used as ID number in WordPress (and here we have several records like this!). Similarly, the scheduled action from the error message you’ve sent above seems to have ID 0 as well.

    We’ve seen problems like this in the past happen after site migration when indexes, foreign keys, and autoincrement weren’t set up correctly in the new site database. Here is an article that explains how you can add these after the migration:

    https://www.photographerstechsupport.com/tutorials/fixing-wordpress-indexes-foreign-keys-and-auto_increment-fields/

    When running this SQL code, you can replace the prefix wp_ in table names with gut_ which is used on this particular site.

    Once you fix the foreign keys and auto_increment properties, you can try clearing all database records from gut_posts and gut_terms tables that have ID number 0.

    If you’re not sure how to access your database or run SQL code there, I’d recommend you reach out to your hosting company for help.

    Cheers!

    Thread Starter vortac

    (@vortac)

    @madeincosmos You honestly saved my week-end with your post, pure gold. Thanks so much!

    The actual SQL scripts mentioned in your article didn’t help straight away as they are but your post and the article/discussion pointed me in the right direction: when migrating my database from localhost to the live server all auto_increment settings got lost – never had this before in years. As a result Action Scheduler placed events at index 0, same with session nonces and stuff, “corrupting” wp_posts and wp_terms (and other tables).
    What I did now was manually correcting/adding the auto_increment setting table by table in phpmyadmin – this worked straight away when there was no row with index 0 in the table. But when there was I had to delete the row at index 0 first or reassign it to a different index – comparing the tables to my localhost “orginal”. So far errors are gone and woocommerce keeps its settings. *whooooha*
    As a conclusion it wasn’t a problem with wp-cron but the Action Scheduler errors resulted from the corrupted database.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘ActionScheduler Error – Unable to get rid of’ is closed to new replies.