Error on installing add-ons - ForeignKeyConstraintViolationException

Permalink
I get this error when installing add-ons like "Website Optimizer", "Easy Image Gallery", "Watermark NN", I will attach a screenshot of the error I get.

An exception occurred while executing 'ALTER TABLE atFile ADD CONSTRAINT FK_73D17D61A2A82A5D FOREIGN KEY (avID) REFERENCES AttributeValues (avID) ON DELETE CASCADE': SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`exrx_concreteTest0101`.`#sql-636c_2c9a8`, CONSTRAINT `FK_73D17D61A2A82A5D` FOREIGN KEY (`avID`) REFERENCES `AttributeValues` (`avID`) ON DELETE CASCADE)


Obviously it's something related to the database, but I'm not sure what is it, anyone has experienced this before?

I have found this answer on Stackoverflowhttps://stackoverflow.com/questions/1253459/mysql-error-1452-cannot-...

But I can't follow the first answer to do the same thing to my database. Can someone help me with this?

1 Attachment

 
Gondwana replied on at Permalink Reply
Gondwana
Are those add-ons compatible with the version of c5 that you're running?

Was your site developed on Windows and then moved to linux?
rempelmd replied on at Permalink Reply
I'm running C5 8.3.1, and all of the add-ons are compatible with version 8 but I'm not sure if they are compatible with 8.3.1, could this be the problem?

I contacted the "Website optimizer" add-on developer and gave him access to my website to test the add-on on my server, he also faced the same problem. Could it be a compatibility issue and he doesn't know about it?

I'm not sure about the Windows and Linux but I'm using the same host for years and nothing has changed lately.
Gondwana replied on at Permalink Reply
Gondwana
I think that rules out my earlier hypotheses. It seems like corruption in the database File (atFile) table, although the 'exrx_concreteTest0101' tag looks a bit strange.

Here's a long-shot: take new backups of your database and files (being careful NOT to overwrite your previous backups), and then try this:
https://www.concrete5.org/marketplace/addons/rescan-all-files...
rempelmd replied on at Permalink Reply
The 'exrx_concreteTest0101' is the database name, I'm not sure what you mean by 'tag'?

I tried this add-on before but it couldn't handle the amount of images I have on the website, (4500 images), it was very slow, so I did rescan all images manually multiple times when I upgraded C5, last time was 3 weeks ago.