-
Notifications
You must be signed in to change notification settings - Fork 51
Fatal error: Call to a member function get_data_store()... #49
Comments
Update: "Error: A database error occurred while migrating order 28597: Duplicate entry '28597' for key 'PRIMARY'." This is retuned almost immediately after running the migrate command. I see a new "wp_woocommerce_orders" table was created, and it contains just one row, the row contains an order with order_id 28597 Thanks again. |
@krif Thank you for the detailed report! The "Killed" error is typically the result of the process not getting enough memory, so I'll be sure to focus on memory management and garbage collection as I continue to revise the migration script. The data store issue was reported in #43 and resolved in #46, but is currently only in the As for the duplicate key issue, this looks like a good place to focus some testing, thanks for bringing it to our attention! :) |
@stevegrunwell Thank you for the reply. In case it helps troubleshoot, I'd like to mention that the entry '28597' in the duplicate key errror corresponds to the latest order in the database. Cheers :) |
Great information, thank you! |
I'm having the same "duplicate key" issue. Extending on @krif 's report, it's the first order in the batch it tries to process, not necessarily the latest order. In my debugging, it seems that the This has something to do with I've added a whole bunch of debug output all over the place, but I cannot see why a row is being inserted in the custom table before |
@stevegrunwell Here's some more information. To get this working, I flattened the code, pulling all the external methods inside the migrate method in the CLI class. Here's what I've found so far.
|
@dream-encode Thanks for digging into this!
The order refund stuff is being handled in #52 (originally reported in #45)
The issue isn't with the WooCommerce version at the time of the order, so much as WooCommerce having some hard-coded queries prior to 3.3.0 that we couldn't override via filter. 7c877ca is the commit where that was introduced, and the commit message holds a little more detail:
The filter in question was added in woocommerce/woocommerce@7606666de9.
I'll dig in further and see what I can find, thank you! |
I've spent the better part of the day trying to reproduce the issue locally, but haven't had much luck. I did add a few tests to reproduce some of the likely causes (#53). @dream-encode If you run the migration command against the current |
@stevegrunwell Due to the dumpster fire project I'm currently using this on, I can't really checkout anything. The version of WordPress is old, and WooCommerce is ~2.4. Needless to say, it's a mess. I've gotten the migration to run finally by flattening the script. I also hit on the issue in #55 very early, and hard-coded the $delete. It's running now, but two things happen along the way.
|
@stevegrunwell So, I pulled down the develop branch after seeing a few PRs lately. On first run, I get the "duplicate key" error: There are 28754 orders to be migrated. If I immediately run the command again, it cycles to the very next order: There are 28753 orders to be migrated. Also, I ran the command with the --debug flag each time, and it didn't give any more information on the actual error. |
Hello,
I tried the migrate command with the latest beta (3). About half way through, the process stopped with "Killed" being returned.
Trying the wp wc-order-table migrate command again to continue the process returned an error part way through.
"Fatal error: Call to a member function get_data_store() on boolean in /home/PATH-TO-SITE/wp-content/plugins/woocommerce-custom-orders-table/includes/class-woocommerce-custom-orders-table-cli.php on line 96"
Trying the command again results in the same error as above.
Running the backfill command after this also returns "Killed" part way through.
Anything I can do to remedy this?
P.S. Thank you for this project. Our wp_postmeta table as become big and is slowing down the orders backend, big time.
The text was updated successfully, but these errors were encountered: