Support » Plugin: In Stock Mailer for WooCommerce » Local Install – Restored – ‘wptg_ism_out_of_stock_request’ error

  • Resolved KoolPal

    (@koolpal)


    Hi,

    I am not sure of this is related to https://wordpress.org/support/topic/plugin-bug-after-backup-save-data-when-plugin-is-desactived/

    My local install had issues and I restored my LIVE installation using Updraft Plus Premium

    With debug log enabled on local, I am seeing the below error:

    
    [08-Aug-2020 07:58:08 UTC] WordPress database error Can't write; duplicate key in table 'wptg_ism_out_of_stock_request' for query   CREATE TABLE  wptg_ism_out_of_stock_request  (   id  bigint(20)   NOT NULL AUTO_INCREMENT,   product_id  int(11)   NOT NULL,   email  varchar(254)   NOT NULL,   created_at  timestamp NOT NULL DEFAULT current_timestamp,   sent_id  INT(11) DEFAULT NULL,   PRIMARY KEY id (id),   CONSTRAINT uc_prod_email_sent UNIQUE (product_id , email, sent_id),   CONSTRAINT sent_id FOREIGN KEY (sent_id) REFERENCES wptg_ism_sent_email(id) ON DELETE CASCADE ON UPDATE SET NULL ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci made by activate_plugin, do_action('activate_in-stock-mailer-for-woocommerce/in-stock-mailer-for-wc.php'), WP_Hook->do_action, WP_Hook->apply_filters, activation_loader::init_activation, activation_loader::create_db_table, dbDelta
    [08-Aug-2020 07:58:10 UTC] WordPress database error Table 'zephyrs.wptg_ism_out_of_stock_request' doesn't exist for query  SELECT wptg_ism_out_of_stock_request.id, GROUP_CONCAT(wptg_ism_out_of_stock_request.id SEPARATOR '-*_' ) as ids,
                                       GROUP_CONCAT( wptg_ism_out_of_stock_request.product_id SEPARATOR '-*_' ) as product_id ,
                                       GROUP_CONCAT( wptg_posts.post_title SEPARATOR '-*_' ) as product_name,
                                       wptg_ism_out_of_stock_request.email, wptg_users.ID as user_ID, wptg_users.display_name as user_name FROM wptg_ism_out_of_stock_request
                                 INNER JOIN wptg_posts ON ( wptg_posts.ID = wptg_ism_out_of_stock_request.product_id )
                                 INNER JOIN wptg_postmeta ON (wptg_ism_out_of_stock_request.product_id = wptg_postmeta.post_id)
                                 LEFT JOIN wptg_users ON (wptg_ism_out_of_stock_request.email = wptg_users.user_email)
                                 WHERE ( wptg_posts.post_type = 'product' OR wptg_posts.post_type = 'product_variation' ) AND
                                       wptg_postmeta.meta_value = 'instock' AND
                                       wptg_ism_out_of_stock_request.sent_id IS NULL
                                 GROUP BY wptg_ism_out_of_stock_request.email  made by do_action_ref_array('in_stock_email_event'), WP_Hook->do_action, WP_Hook->apply_filters, inStockManager::emailRequestsAsync, inStockManager::get_email_list_to_email

    I uninstalled, deleted and reinstalled the plugin multiple times on local install but each time I find that the table ‘wptg_ism_out_of_stock_request’ is not getting created and I get the above error.

    On my LIVE site, I see no issues and I can see the table ‘wptg_ism_out_of_stock_request’ using

    Please guide.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    If it helps, I went through the Updraft Plus restore log and found the below error recorded during restoration for this:

    0024.749 (R) [notice] An error (1) occurred: – Can’t write; duplicate key in table ‘wptg_ism_out_of_stock_request’ – the database query being run was: CREATE TABLEwptg_ism_out_of_stock_request(idbigint(20) NOT NULL AUTO_INCREMENT,`product_i …
    0024.750 (R) [notice] An error (2) occurred: – Table ‘zephyrs.wptg_ism_out_of_stock_request’ doesn’t exist – the database query being run was: INSERT INTO wptg_ism_out_of_stock_request VALUES (1, 1121, ‘testingemailone@gmail.com’, ‘2020-04-0 …

    Sorry! Error between keyboard and chair 🤯

    I was trying to restore a backup under PHP 7.3 into a local instance with PHP 7.4

    Took a fresh backup under PHP 7.4 and restored into a local instance with PHP 7.4 and all is well!

    Leaving this here for others who might report a similar issue!!

    Thanks

    Plugin Author Frank

    (@frankspress)

    Hi, feels more like a constraint key “sent_id” was the cause of the error. I’m gonna rename it so that other users won’t face the same issue.
    Thanks for the insight, really appreciated!
    Frank

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.