Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Loss During Database Upgrade #47512

Closed
5 tasks done
natestone opened this issue May 15, 2024 · 3 comments
Closed
5 tasks done

Data Loss During Database Upgrade #47512

natestone opened this issue May 15, 2024 · 3 comments
Assignees
Labels
focus: order Issues related to orders. needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. status: can't reproduce Issues that can't be reproduced. status: stale Issues that have no had any activity for some time. team: Proton type: community contribution

Comments

@natestone
Copy link

Prerequisites

  • I have carried out troubleshooting steps and I believe I have found a bug.
  • I have searched for similar bugs in both open and closed issues and cannot find a duplicate.

Describe the bug

After the upgrade to Woocommerce 8.9.0, the database upgrade process ran. Unfortunately, we had two orders that were open and locked. These orders no longer exist after the upgrade completed. I've checked the database manually and the posts that were the orders are completely removed from the system.

I don't have an easy way to replicate the process. I do have the database states before and after the database upgrade. it just so happens that these two orders were being reviewed when the database upgrade started. We were not warned to close all orders before doing the database upgrade.

Expected behavior

The database upgrade process should check if orders are open and locked. Additionally, it should allow upgrading orders that are locked or should warn the user and not run until all orders are closed and unlocked.

Actual behavior

It appears that locked orders were not properly upgraded by the database upgrade process and were deleted due to being locked during the upgrade.

Steps to reproduce

Load of version of commerce prior to 8.9.0.
Create an order.
Keep the order open and locked.
Upgrade the plug into 8.9.0.
Run the database upgrader.
Order will no longer exist.

WordPress Environment

`

WordPress Environment

WordPress address (URL): https://graysignandbanner.com
Site address (URL): https://graysignandbanner.com
WC Version: 8.9.0
REST API Version: ✔ 8.9.0
Action Scheduler Version: ✔ 3.7.4
Log Directory Writable: ✔
WP Version: 6.5.3
WP Multisite: –
WP Memory Limit: 512 MB
WP Debug Mode: –
WP Cron: ✔
Language: en_US
External object cache: ✔

Server Environment

Server Info: Apache/2.4.41 (Ubuntu)
PHP Version: 7.4.3-4ubuntu2.20
PHP Post Max Size: 128 MB
PHP Time Limit: 300
PHP Max Input Vars: 1000
cURL Version: 7.68.0
OpenSSL/1.1.1f

SUHOSIN Installed: –
MySQL Version: 8.0.36-0ubuntu0.20.04.1
Max Upload Size: 128 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ❌ Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected.
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Database

WC Database Version: 8.9.0
WC Database Prefix: wp_
Total Database Size: 29.78MB
Database Data Size: 24.71MB
Database Index Size: 5.07MB
wp_woocommerce_sessions: Data: 0.06MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_order_items: Data: 0.05MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_order_itemmeta: Data: 0.17MB + Index: 0.19MB + Engine InnoDB
wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_actions: Data: 0.20MB + Index: 0.17MB + Engine InnoDB
wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_actionscheduler_logs: Data: 0.13MB + Index: 0.09MB + Engine InnoDB
wp_aioseo_cache: Data: 0.11MB + Index: 0.03MB + Engine InnoDB
wp_aioseo_crawl_cleanup_blocked_args: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_aioseo_crawl_cleanup_logs: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_aioseo_notifications: Data: 0.20MB + Index: 0.06MB + Engine InnoDB
wp_aioseo_posts: Data: 0.19MB + Index: 0.02MB + Engine InnoDB
wp_commentmeta: Data: 0.06MB + Index: 0.03MB + Engine InnoDB
wp_comments: Data: 0.20MB + Index: 0.09MB + Engine InnoDB
wp_e_events: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_e_notes: Data: 0.02MB + Index: 0.17MB + Engine InnoDB
wp_e_notes_users_relations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_e_submissions: Data: 0.02MB + Index: 0.23MB + Engine InnoDB
wp_e_submissions_actions_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_e_submissions_values: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_gla_attribute_mapping_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_gla_budget_recommendations: Data: 0.19MB + Index: 0.14MB + Engine InnoDB
wp_gla_merchant_issues: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_gla_shipping_rates: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_gla_shipping_times: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_jetpack_sync_queue: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_options: Data: 14.02MB + Index: 0.25MB + Engine InnoDB
wp_postmeta: Data: 6.30MB + Index: 1.84MB + Engine InnoDB
wp_posts: Data: 1.42MB + Index: 0.13MB + Engine InnoDB
wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_usermeta: Data: 0.13MB + Index: 0.03MB + Engine InnoDB
wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wc_admin_note_actions: Data: 0.06MB + Index: 0.02MB + Engine InnoDB
wp_wc_admin_notes: Data: 0.08MB + Index: 0.00MB + Engine InnoDB
wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_addresses: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_operational_data: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_orders: Data: 0.02MB + Index: 0.11MB + Engine InnoDB
wp_wc_orders_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wp_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wp_wcuf_upload_sessions: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wpforms_logs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wpforms_payment_meta: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wp_wpforms_payments: Data: 0.02MB + Index: 0.14MB + Engine InnoDB
wp_wpforms_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wpmailsmtp_debug_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wp_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB

Post Type Counts

attachment: 214
custom_css: 2
elementor_library: 3
nav_menu_item: 15
page: 13
post: 2
product: 11
product_variation: 63
revision: 163
shop_coupon: 4
shop_order: 92
shop_order_refund: 2
wp_global_styles: 3
wpforms: 1

Security

Secure connection (HTTPS): ✔
Hide errors from visitors: ✔

Active Plugins (20)

Akismet Anti-spam: Spam Protection: by Automattic - Anti-spam Team – 5.3.2
All in One SEO: by All in One SEO Team – 4.6.2
Astra Pro: by Brainstorm Force – 4.6.9
Starter Templates: by Brainstorm Force – 4.2.3
Checkout Plugins - Stripe for WooCommerce: by Checkout Plugins – 1.8.1
Elementor Pro: by Elementor.com – 3.21.2
Elementor: by Elementor.com – 3.21.5
Google Listings and Ads: by WooCommerce – 2.6.8
Invoice Gateway For WooCommerce: by Rymera Web Co – 1.1.3
Jetpack: by Automattic – 13.3.1
Pages with category and tag: by YAHMAN – 0.9.0
Role and Customer Based Pricing for WooCommerce: by Meow Crew – 1.5.3
Spectra: by Brainstorm Force – 2.13.2
W3 Total Cache: by BoldGrid – 2.7.2
WooCommerce Shipping & Tax: by WooCommerce – 2.5.4 (update to version 2.5.7 is available)
WooCommerce Upload Files: by Lagudi Domenico – 73.6
WooCommerce: by Automattic – 8.9.0
WP Mail SMTP: by WP Mail SMTP – 4.0.1
WPForms Lite: by WPForms – 1.8.8.3
XPS Ship Integration: by XPS Ship – 1.1.74

Inactive Plugins (0)

Dropin Plugins ()

advanced-cache.php: advanced-cache.php
db.php: db.php
object-cache.php: object-cache.php

Settings

API Enabled: –
Force SSL: –
Currency: USD ($)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)

Connected to WooCommerce.com: –
Enforce Approved Product Download Directories: ✔
HPOS feature enabled: –
Order datastore: WC_Order_Data_Store_CPT
HPOS data sync enabled: –

Logging

Enabled: ✔
Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2
Retention period: 30 days
Level threshold: –
Log directory size: 103 KB

WC Pages

Shop base: #997 - /shop/
Cart: #998 - /cart/
Checkout: #999 - /checkout/
My account: #1000 - /my-account/
Terms and conditions: ❌ Page not set

Theme

Name: GSB Astra Child
Version: 1.0.0
Author URL: http://wpastra.com/about/
Child Theme: ✔
Parent Theme Name: Astra
Parent Theme Version: 4.6.13 – 4.6.14 is available
Parent Theme Author URL: https://wpastra.com/about/?utm_source=theme_preview&utm_medium=author_link&utm_campaign=astra_theme
WooCommerce Support: ✔

Templates

Overrides: –

Admin

Enabled Features: activity-panels
analytics
product-block-editor
coupons
core-profiler
customize-store
customer-effort-score-tracks
import-products-task
experimental-fashion-sample-products
shipping-smart-defaults
shipping-setting-tour
homescreen
marketing
mobile-app-banner
navigation
onboarding
onboarding-tasks
product-variation-management
product-virtual-downloadable
product-external-affiliate
product-grouped
product-linked
product-pre-publish-modal
product-custom-fields
remote-inbox-notifications
remote-free-extensions
payment-gateway-suggestions
shipping-label-banner
subscriptions
store-alerts
transient-notices
woo-mobile-welcome
wc-pay-promotion
wc-pay-welcome-page

Disabled Features: minified-js
new-product-management-experience
settings
async-product-editor-category-field
launch-your-store

Daily Cron: ✔ Next scheduled: 2024-05-15 18:47:34 +00:00
Options: ✔
Notes: 116
Onboarding: completed

Action Scheduler

Complete: 435
Oldest: 2024-04-14 19:03:37 +0000
Newest: 2024-05-15 14:53:10 +0000

Failed: 2
Oldest: 2023-07-18 18:52:03 +0000
Newest: 2024-04-11 03:04:59 +0000

Pending: 13
Oldest: 2024-05-15 15:08:10 +0000
Newest: 2024-05-22 12:39:26 +0000

Status report information

Generated at: 2024-05-15 15:04:06 +00:00
`

Isolating the problem

  • I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
  • This bug happens with a default WordPress theme active, or Storefront.
  • I can reproduce this bug consistently using the steps above.
@tammullen tammullen added focus: order Issues related to orders. team: Proton labels May 15, 2024
@barryhughes barryhughes added the priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. label May 17, 2024
@barryhughes barryhughes self-assigned this May 17, 2024
@barryhughes
Copy link
Member

Thanks for reporting this, @natestone.

Unfortunately, we had two orders that were open and locked.

To be absolutely sure I'm understanding, you mean locked in the user interface sense (ie, if another user opened the same order for editing they'd see a message reading something like, "Another user is currently editing this order. Do you want to take over?"

I don't have an easy way to replicate the process.

OK, it's not always easy (and, so far, I also cannot replicate). Approximately how often are you encountering this, though?

It appears that locked orders were not properly upgraded by the database upgrade process and were deleted due to being locked during the upgrade.

Perhaps, but I don't think so. You haven't stated which version you updated from, but I can't think of any recent migration logic (that is, routines that execute during database updates) that would have triggered this. In fact, the very most recently added migrations don't touch order data at all.

Is it at all possible that human error was to blame? Could the order editor have been opened in order to manually create some orders, but were closed without being saved first of all?

@barryhughes barryhughes added the needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. label May 21, 2024
Copy link
Contributor

As a part of this repository's maintenance, this issue is being marked as stale due to inactivity. Please feel free to comment on it in case we missed something.

After 7 days with no activity this issue will be automatically be closed.

@github-actions github-actions bot added the status: stale Issues that have no had any activity for some time. label May 29, 2024
Copy link
Contributor

github-actions bot commented Jun 6, 2024

This issue was closed because it has been 14 days with no activity.

@github-actions github-actions bot added the status: can't reproduce Issues that can't be reproduced. label Jun 6, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: order Issues related to orders. needs: author feedback The issue/PR needs a response from any of the parties involved in the issue. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. status: can't reproduce Issues that can't be reproduced. status: stale Issues that have no had any activity for some time. team: Proton type: community contribution
Projects
None yet
Development

No branches or pull requests

3 participants