• Resolved travelavenger

    (@travelavenger)


    Hi there,

    I got this fatal error after upgraded to 7.9, the following log is from apache error log:

    WordPress database error Unknown column ‘priority’ in ‘field list’ for query \nINSERT INTO wp_actionscheduler_actions ( hook, status, scheduled_date_gmt, scheduled_date_local, schedule, group_id, priority, args )

    PHP Fatal error: Uncaught RuntimeException: Error saving action: Unknown column ‘priority’ in ‘field list’ in woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php:126

    Please help, Thank you for your assistance!

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi @travelavenger

    I got this fatal error after upgraded to 7.9, the following log is from apache error log:

    WordPress database error Unknown column ‘priority’ in ‘field list’ for query \nINSERT INTO wp_actionscheduler_actions ( hook, status, scheduled_date_gmt, scheduled_date_local, schedule, group_id, priority, args )

    PHP Fatal error: Uncaught RuntimeException: Error saving action: Unknown column ‘priority’ in ‘field list’ in woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php:126

    From what I understand, you’ve run into a fatal error after upgrading to version 7.9. Looking at the error log you’ve shared, it appears the problem is due to an unknown ‘priority’ column in your database. This issue can sometimes crop up if the database doesn’t update correctly during an upgrade.

    Let’s try updating your WooCommerce database, which might solve the problem. Here’s how you can do it:

    1. Navigate to your WordPress dashboard.
    2. Go to WooCommerce → Status → Tools.
    3. Here, you should see an option called ‘Update database‘. Click on this.

    Image Link: https://snipboard.io/YJHE2i.jpg

    This action will start the database update process. Please be patient as it might take a few minutes to complete. Once done, it should hopefully fix the ‘Unknown column’ error you’re facing. ?? You can read more about Updating the WooCommerce Database Here.

    ?? Please ensure that you have a good backup of your full site and database in place before doing the updates, so that, should something go wrong, you are able to easily restore your site to a functioning state.

    If the issue remains even after updating the database, it might be due to a conflict with a plugin or theme. I’d suggest deactivating all your plugins except WooCommerce and switching to a default WordPress theme like Storefront to see if that helps.

    Here’s a helpful guide on how to test for conflicts: ?? How to Test for Plugin and Theme Conflicts

    In case none of the above steps work, could you send us a copy of your site’s System Status? This will give us a clearer picture of your site’s setup and help us pinpoint the problem. You can find it via WooCommerce > Status. Select Get system report and then Copy for support.

    Additionally, could you also provide us with the fatal error logs (if any) under WooCommerce > Status > Logs.

    Once you’ve got that, you can paste them right here in your reply, or use https://pastebin.com/ to paste it there and share it with us.

    Thanks for your patience and cooperation. I’m looking forward to your response so we can resolve this issue for you.

    Thread Starter travelavenger

    (@travelavenger)

    Hi there,

    Thank you for the advise, but the table schema remains the same after clicking the update tables. and at apache error log when I click the update table button:

    PHP Warning: Undefined property: stdClass::$priority in …………/plugin/woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php on line 379

    Wondering if there is any reference I could find out the tables’ schema of version 7.9 or a sql could add the column ‘priority’ in table ‘field list’ ?

    Many thank for your help!

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @travelavenger

    If the WooCommerce > Status > Tools > Update Database doesn’t work, you might need to reinstall WooCommerce. Please ensure you have a backup before proceeding. Deactivate and delete the WooCommerce plugin, then download and install it again. This should prompt WordPress to create any missing tables in the database.

    Also, Sometimes, other plugins can cause conflicts. To check this, disable all your plugins except WooCommerce and see if the issue persists. If it doesn’t, reactivate your plugins one by one until you find the one causing the conflict. You can find a more detailed explanation of conducting a conflict test here.

    Alternatively, you can install and activate the Action Scheduler plugin. Once it’s active, go to Tools > Scheduled Actions > Failed/Pending. You should see a notice indicating that it attempted to create the tables for you.

    Unfortunately, we don’t provide a specific version of the WooCommerce table schema because it dynamically generates based on your site’s configuration and the plugins you’ve installed. But don’t worry, you can still view your current table schema using a database management tool like phpMyAdmin.

    I hope this helps. Please let us know if you have any other questions or need further assistance.

    Thanks!

    Thread Starter travelavenger

    (@travelavenger)

    Hi there,

    thank you for the advise. Understand that reinstall woocommerce will create any missing tables in the database, but in my case it is missing a “column” within a table, would that fix the issue as well?

    Also, since the function WooCommerce > Status > Tools > Update Database doesn’t work in some cases, would it be fixed in the future version? Maybe add some more checking and included more condition in order to update the database.

    Thank you!

    Saif

    (@babylon1999)

    Hello @travelavenger,

    thank you for the advise. Understand that reinstall woocommerce will create any missing tables in the database, but in my case it is missing a “column” within a table, would that fix the issue as well?

    Thank you for trying our previous suggestions! :?)

    This is actually a known bug and it’s caused by a missing database column.

    As a workaround, you can simply run this WP-CLI command to rebuild the database tables: wp action-scheduler fix-schema

    Please note, your hosting providers may not allow access to the WP-CLI so you might need to get in touch with them first

    Let us know if you have any other questions.

    Thread Starter travelavenger

    (@travelavenger)

    Hi there,

    Thank you for the solution, I have several wordpress site in the server, just want to confirm if I should run the command at the root folder of the wordpress haing the issue and it will not affect the other sites?

    Thank you!

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @travelavenger

    Yes, you are correct. To apply the solution, you should run this command in the root folder of the WordPress site that is having the issue.

    Additionally, ensure you gave the database user full admin permission before running this command.

    Do let us know how it goes. Thanks!

    In the root directory of my WordPress install

    wp action-scheduler fix-schema --allow-root

    This solution worked fine for me, I just needed to enable the database user with Global privileges?via PhpMyAdmin for the table rebuild to complete.

    Thanks for the solution ??

    Fatal error: Uncaught RuntimeException: Error saving action: Error saving action: Unknown column ‘priority’ in ‘field list’ in /home/SITENAME/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php:44 Stack trace: #0 /home/SITENAME/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php(242): ActionScheduler_DBStoreMigrator->save_action() #1 /home/SITENAME/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/ActionScheduler_ActionFactory.php(327): ActionScheduler_HybridStore->save_action() #2 /home/SITENAME/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/ActionScheduler_ActionFactory.php(315): ActionScheduler_ActionFactory->store() #3 /home/SITENAME/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/functions.php(102): ActionScheduler_ActionFactory->create() #4 /home/SITENAME/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/migration/Scheduler.php(89): as_schedule_single_action() #5 /home/SITENAME/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/migration/Controller.php(119): Action_Scheduler\Migration\Scheduler->schedule_migration() #6 /home/SITENAME/public_html/wp-includes/class-wp-hook.php(310): Action_Scheduler\Migration\Controller->schedule_migration() #7 /home/SITENAME/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters() #8 /home/SITENAME/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #9 /home/SITENAME/public_html/wp-settings.php(654): do_action() #10 /home/SITENAME/public_html/wp-config.php(116): require_once(‘…’) #11 /home/SITENAME/public_html/wp-load.php(50): require_once(‘…’) #12 /home/SITENAME/public_html/wp-admin/admin.php(34): require_once(‘…’) #13 /home/SITENAME/public_html/wp-admin/network/admin.php(13): require_once(‘…’) #14 /home/SITENAME/public_html/wp-admin/network/plugins.php(11): require_once(‘…’) #15 {main} thrown in?/home/SITENAME/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php?on line?44

    I also face this problem from yesterday, but does not yet solved.

    Saif

    (@babylon1999)

    Hello @waseemabs,

    I’m sorry to know you’re still experiencing this issue. The team is already aware of it but we don’t have an estimate on when a fix will be released.

    You can run the following WP-CLI command as a workaround: wp action-scheduler fix-schema

    If you have any other questions about this, please create your own thread from here.

    Thank you!

    Thread Starter travelavenger

    (@travelavenger)

    I solved the issue by running the following sql at phpmyadmin:

    ALTER TABLE wp_actionscheduler_actions
    ADD priority tinyint(10) unsigned NOT NULL;

    which will create the missing column.

    Hope this helps and hope the woocommerce team could make use of this and add a fix in the future version

    Saif

    (@babylon1999)

    Thank you for sharing your solution with the community, @travelavenger!

    I’m sure merchants who don’t have access to the WP-CLI will appreciate it. :?)

    Since the cause of the issue is now clear, I’ll go ahead and mark the thread as solved. Feel free to create a new one if you have any other questions.

    Cheers!

    I was facing the same issue, @travelavenger with some modifications seems to work

    ALTER TABLE wp_actionscheduler_actions ADD priority tinyint(10) unsigned NOT NULL AFTER extended_args;
    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hello @sujaysreedhar

    I’m glad you were able to find a solution to your inquiry here, and thanks for sharing it with the community too! ????

    Should you have further inquiries, kindly create a new topic here.

    Thanks!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Fatal error missing column priority’ is closed to new replies.