Solved ActionScheduler files Fatal error in a Woocommerce installation


Solved in Woocommerce. Fatal error: Uncaught RuntimeException: Error saving action: Error saving action: Database error. in /home/abcdefgh/public_html/yourwebsite.com/wp-content/plugins/woocommerce/packages/action- scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php:44

Having issues with a Woocommerce installation? Due to ActionScheduler files? Don’t worry we will help you to get rid of these problems in a few steps.

The problem also emerged in the form of a large table of wp_actionscheduler_logs. Sometimes or in some environment it creates 500 entries in a second, due to this server may be crashed and waste your many hours or days to resolve it.

We got this fatal error after update on 4+ WooCommerce and now as you understand the site doesn’t work on WooCommerce anymore. Sometimes this issue also counters from the other plugins.

Fatal error: Uncaught RuntimeException: Error saving action: Error saving action: Database error. in /home/abcdefgh/public_html/yourwebsite.com/wp-content/plugins/woocommerce/packages/action- scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php:44 Stack trace: #0 /home/abcdefgh/public_html/yourwebsite.com/wp- content/plugins/woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php(242): ActionScheduler_DBStoreMigrator->save_action(Object(ActionScheduler_Action), NULL) #1 /home/abcdefgh/public_html/yourwebsite.com/wp-content/plugins/woocommerce/packages/action-scheduler/classes/ActionScheduler_ActionFactory.php(177): ActionScheduler_HybridStore- >save_action(Object(ActionScheduler_Action)) #2 /home/abcdefgh/public_html/yourwebsite.com/wp-content/plugins/woocommerce/packages/action-scheduler/classes/ActionScheduler_ActionFactory.php(84): ActionScheduler_ActionFactory->store(Object(ActionScheduler_Action)) #3 /home/abcdefgh/public_html/yourwebsite.com/wp- content/plugins/woocommerce/packages/action-schedu in /home/abcdefgh/public_html/yourwebsite.com/wp-content/plugins/woocommerce/packages/action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php on line 44

It takes many days to resolve the issue, searched each and every forum on Google, but we did not get the perfect solution.

The problem comes from woocommerce/packages/action-scheduler/…

So we are going to resolve the issue by accessing phpMyAdmin.

Open your WP database by accessing through the phpMyAdmin and first thing we need to do is backup your Database (Click on the Export button to backup your database). Now, deactivate the WooCommerce plugin once the process completed just activate or update the WooCommerce plugin.

WP Database Table We Need To Check

Woocommerce installation due to ActionScheduler files
ActionScheduler Tables

There are four tables we want to check. All these four tables start with wp_ or maybe a little bit different, it depends on the installation process and setup of WordPress. But all four tables have _actionscheduler_ in the name. For the reference please see below image.

wp_actionscheduler_actions
wp_actionscheduler_claims
wp_actionscheduler_groups
wp_actionscheduler_logs

Start Deleting Corrupt Data From the Four ActionScheduler Tables

The data in the tables are not in the form that the table required. We need to delete the data from the table. When you click on the browse button next to the four tables with _actionscheduler_.

AtionScheduler Browse

You will find all the entries comes with 0 below the action_id. If it comes with 1,2,3,4, or so on in numeric form as shown in below image then, skip for next stepActionScheduler files Action Id

If found all the entries comes with 0 below the action_id, now we need to empty all four tables one by one. Click Empty next to the table. Make sure we don’t have any 0 under action_id table.

ActionScheduler files Empty

Setup four ActionScheduler tables correctly

wp_actionscheduler_actions,wp_actionscheduler_claims,wp_actionscheduler_groups, wp_actionscheduler_logs

Now, we need to setup all the four tables correctly by clicking structure next to browse in the table. Once the table is correctly structured WooCommerce start adding new entries when the plugin will activate.Structure

Once you clicked on the structure your wp_actionscheduler_actions table will look like as shown in the image belowWoocommerce ActionScheduler files Structure

Don’t worry if you don’t have those silver and gold keys in your table. We will get that in the next step.

Keys

For the silver key, you need to select that table and click on the indexIndex ActionScheduler files

For example, if you need silver key on the 2 number which is hook in the wp_actionscheduler_actions you need to select the check box and click on the index icon.

Click to all the tables as shown in the screenshot shared in the proper format for all the table at the end of this post.

For the Gold key, you need to select that table and click on the primaryWoocommerce installation due to ActionScheduler files

For example, if you need gold key on the 1 number which is action_id in the wp_actionscheduler_actions you need to select the check box and click on the primary icon.

Do this process for all the four ActionScheduler Tables (Follow attached screenshots at the end of this post)

AUTO_INCREMENT

In this process, we only select primary or gold key table and click on changeCHANGE_ ActionScheduler filesfor all the four ActionScheduler tables in phpMyAdmin. Once you clicked on the change icon you will see screen like this:AI

Check the A_I box (left to the comments AI) and then click on the Save and you are ready to sale your products from the WooCommerce. Cheers!

Wait! If you have encountered with the warning box in WP Database when you clicked on save, please deactivate the WooCommerce plugin and do this process again.

FOR KEYS & AUTO_INCREMENT

wp_actionscheduler_actionsActionScheduler Actions

wp_actionscheduler_claimsActionScheduler Claim

wp_actionscheduler_groups ActionScheduler groups

wp_actionscheduler_logs ActionScheduler logs

READ MORE: How To Build High-Quality Backlinks To Website

Good Luck! 🙂 If you liked this article, then please subscribe to our YouTube Channel. You can also search for the latest tech news and follow us on TwitterFacebook, and LinkedIn

LEAVE A REPLY

Please enter your comment!
Please enter your name here