Back to Reports

Fatal Error in WooCommerce 10.2 Update Script Due to Missing Order

open Sep 19, 2025 PluginWoocommerce

Summary:

A fatal PHP error occurs during the execution of the WooCommerce 10.2 update script wc_update_1020_add_old_refunded_order_items_to_product_lookup_table. The error is triggered by a call to get_items() on a variable that is false instead of a valid order object.

The root cause is a race condition involving the Action Scheduler. The update script attempts to process an order that has been refunded and subsequently deleted from the database. However, the corresponding task to update the Analytics product lookup table was still pending in the scheduler. When the script runs, it fetches an order ID for processing, but the wc_get_order() function returns false because the order no longer exists, leading to the fatal error when the code tries to call a method on it.

This bug impacts site stability and prevents the database update from completing successfully, which may leave the product lookup table in an inconsistent state and cause issues with WooCommerce Analytics reports.

How to Replicate:

Replication steps not provided.