This error occured after trying to update Magento to a new version.
The problem occurs during the shopping process for users that shop as guest. (The shopping process is working if you are logged in.)
When confirming items in the shopping basket you click next for payment. Here the payment module should be loaded. Now users get an error message: saying that there has been a problem, please come back later.
Then I get an email with this code:
SQLSTATE: Integrity constraint violation: 1452 Cannot add
or update a child row: a foreign key constraint fails
`FK_SALES_ORDER_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES
`customer_entity` (`entity_id`) ON DELETE SET NULL ON UPDATE
You need to be a Magento expert in order to solve this problem