• Resolved inforota

    (@inforota)


    Hi!,
    Since last update, the back-end is showing an error:

    WooCommerce XXXwc_reserved_stock table creation failed. Does the DATABESERUSER user have CREATE privileges on the DATABASENAME database?

    The user has all the privileges
    Thanks for your help

Viewing 15 replies - 1 through 15 (of 15 total)
  • You are not on your own. I have the same message on the backend of my site as well.
    Deactivate the plugin and no message.

    • This reply was modified 4 years, 2 months ago by wptechnitec.
    Nobel0

    (@dealshoptime)

    I don’t get this error!
    Maybe it is a plugin conflict or something ?

    This message should only be showing up when something failed with creating the table when the plugin was activated. You can read more about what this custom table is and what it is for in this release post.

    We’d love to know more about why the notification is appearing for you. I noticed that the original poster mentioned their user has all the necessary privileges for creating a new database table. I’m wondering if we could confirm that.

    To be clear, the user this notification message is referring to, is not the WordPress site user, but the database user your WordPress install is configured to use. Some hosts do not allow custom tables to be created by this database user which would cause this notification.

    We show the notification so you’re aware this table did not get created as it will help with preventing race conditions with low stock on busy sites.

    One thing you could do is check with your host if the database user configured with your WordPress site is allowed to create tables and if not, if that could be changed. Once that user does get permissions the plugin will automatically retry creating the table and you should see the notice go away.

    Same issue on all of my WooCommerce websites!

    From what i see, none of them has the wc_reserved_stock table and the DB user has all of the required permissions.

    Googling “wc_reserved_stock” shows this info https://woocommerce.wordpress.com/2020/04/22/woocommerce-4-1-release-candidate-available-now/
    as well as other info.

    Query monitor shows the query error:
    CREATE TABLE XXX_wc_reserved_stock ( order_id bigint(20) NOT NULL, product_id bigint(20) NOT NULL, stock_quantity double NOT NULL DEFAULT 0, timestamp datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, expires datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (order_id, product_id) ) DEFAULT CHARACTER
    SET utf8mb4 COLLATE utf8mb4_unicode_ci;

    Caller:
    Automattic\W\B\Installer->maybe_create_table()
    Automattic\W\B\Installer->maybe_create_tables()
    wp-content/plugins/woo-gutenberg-products-block/src/Installer.php:64
    Automattic\W\B\Installer->install()
    wp-content/plugins/woo-gutenberg-products-block/src/Installer.php:27
    do_action(‘admin_init’)
    wp-includes/plugin.php:478
    Plugin: woo-gutenberg-products-block Invalid default value for ‘timestamp’ 1067

    Component:
    Plugin: woo-gutenberg-products-block

    Error Message:
    Invalid default value for ‘timestamp’

    Error code:
    1067

    • This reply was modified 4 years, 2 months ago by Filipe Costa.
    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Thanks @filipecostacom thats very helpful. I’ll take a look at this on our end and see if we can prepare a patch.

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    It seems the current table schema requires MySql 5.6.5 or above. If you are able to update that via your hosting provider the error should go away, otherwise you can try this patch:

    https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/2590

    This will remove the default value to one which is compatibility with older versions of MySql.

    Hi @mikejolley,

    thanks, i already updated one server with few websites and it seems ok.

    Will wait a fews day before update other servers, but the error is gone!

    Thanks

    • This reply was modified 4 years, 2 months ago by Filipe Costa.

    Hi there,

    The just released WooCommerce 2.6.1 contains the fix for the issue reported in this thread. With this version of the plugin, the new table creation should only fail if the database user does not have create privileges for the database your site is using.

    For whose with this issue, you should just have to update the plugin and the table will get created automatically.

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    – Joey

    diegpl

    (@diegpl)

    I do not get an error but a slow query through Query Monitor plugin, and I do not even work with Gutenberg, I even have the “No Gutenberg – Disable Block Editor – Back to Classic Editor” active.

    Automattic\W\B\Installer->maybe_create_table()
    wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Installer.php:93
    Automattic\W\B\Installer->maybe_create_tables()
    wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Installer.php:64
    Automattic\W\B\Installer->install()
    wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Installer.php:27
    do_action(‘admin_init’)
    wp-includes/plugin.php:478

    That is happening in the last version (4.3.0).

    Is there a way to fix this slow query I believe should not even run actually? Does someone know if the team is already taking a look or should we talk about how to improve the code ourselves and give it to the team? Tks! 😉

    Plugin Author Darren Ethier (nerrad)

    (@nerrad)

    Hi @diegpl

    It’s best to start new threads rather than add to an existing thread, that way we can give your issue the proper attention.

    The code you are referencing should only run once unless there is an issue with creating the table (in which you’ll see a notice). The query is checking for the presence of the table and if it is present then it doesn’t create the table. When the table is present then the table check should not run again.

    Are you seeing this slow query being reported when you load any admin page again?

    diegpl

    (@diegpl)

    Yes, in every WordPress dashboard page. I though it might be because of “No Gutenberg – Disable Block Editor – Back to Classic Editor”, however, even with it disabled the problem persists. How can I fix that? Thank you! 😉

    diegpl

    (@diegpl)

    This guy have the same problem as well https://wordpress.org/support/topic/causing-slow-query-in-woocommerce-plugin/#post-13136060
    It seems to be related to big networks. If someone here is facing the same issue, please let me know. I will keep investigating and will let you guys now about any news 😉

    diegpl

    (@diegpl)

    @nerrad I just realized this form is not for Woocommerce, but one of its addon, which I am not even using. So, it seems this issue is really a bug. I`ve opened another thread just about it as you requested: https://wordpress.org/support/topic/slow-query-issue-create-table-for-woocommerce-blocks/
    Tks! 😉

    diegpl

    (@diegpl)

    https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/2885 – the solution is here, please, request it there as well to be implemented. My partner, who is a great programmer, proposed it and it worked very well in our server 🙂
    Tks! 😉

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘2.6.0 Update bug’ is closed to new replies.