-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Integrity constraint violation SQL Error on saving attributes #6198
Comments
@Asitis thank you for reporting that issue.
|
Me and a colleague have ran into this problem again on two separate occasions, I'll try to be more clear this time: The first time this error showed it was while saving a product on the English storeview (ID: 2):
I then found that whenever I edit anything else (like i.e. categories) in that storeview (ID:2) I get errors like "Something went wrong while saving the category". Checking in the logs I see the same Integrity constraint violation again. I'm pretty sure it has something to do with a mismatch of storeID in the database, but I don't know where (or better, how) to look exactly for the issue. The order went like this:
I found a lot of similar issues and topics about it, but I never changed anything in the database manually, nor did I import it from another server. I've tried to reindex, rebuild and redeploy but without success. The complete exception.log for this error whilst saving a category on storeview ID2:
|
@Asitis thank you for your details.
|
@picamator I found the culprit. For some reason a few database tables were corrupted.
It turned out there were duplicate entries for tables such as |
@Asitis If you fixed it like that then you probably have bad data now. An integrity constraint violation means that indexes are off or data is missing. Most likely caused by a module or a update that turns off constraints then data being added in. The only way to fix it is to find the data thats missing turn off constraints then re-add the data back in. If you did a fresh import it will make new indexes and you could have corrupt data or improperly index data somewhere. This is why I prefer UUID instead. |
For me it was having a record set with a store id that didn't exist anymore in eav_attribute_label table. So I just deleted all the records that had store id 4 and kept the ones that had store id 1. Problem solved :) |
Preconditions
Steps to reproduce
Expected result
The attribute saving correctly
Actual result
In a error-message box (page doesn't break):
I've seen other related issues of non-responsive contributors with this error popping up on other instances ( #5709 #6101 ). I already spoke to my sysadmin if it could be related to SQL versions, but this shouldn't be the case.
The text was updated successfully, but these errors were encountered: