cancel
Showing results for
Did you mean:

## Foreign key constraint fails on new orders

I'm seeing the following error in the logs when a new order is placed.

Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`dbname`.`quote_address`, CONSTRAINT `QUOTE_ADDRESS_QUOTE_ID_QUOTE_ENTITY_ID` FOREIGN KEY (`quote_id`) REFERENCES `quote` (`entity_id`) ON DELETE CASCADE), query was: INSERT INTO `quote_address` (`save_in_address_book`, `firstname`, `lastname`, `company`, `street`, `city`, `region`, `postcode`, `country_id`, `telephone`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

The records exist in both the quote and quote address tables.

How can I fix this error?

Store is running Magento 2.3.4-p2

Data was migrated from a Magento 1 site.