barrelstrength / sprout

Sprout Marketing Suite modules for Craft CMS applications
https://sprout.barrelstrengthdesign.com
Other
2 stars 9 forks source link

Creating a redirect on live site gives "Integrity constraint violation" error #339

Open arentsen opened 4 days ago

arentsen commented 4 days ago

Description

The plugin works locally, but on the live website I can't add any new redirect in the admin. Error code:

Integrity constraint violation – [yii\db\IntegrityException](https://www.yiiframework.com/doc-2.0/yii-db-integrityexception.html)
SQLSTATE[23000]: Integrity constraint violation: 1216 Cannot add or update a child row: a foreign key constraint fails
The SQL being executed was: INSERT INTO `structureelements` (`structureId`, `dateCreated`, `dateUpdated`, `uid`, `lft`, `rgt`, `level`) VALUES (0, '2024-11-28 20:17:38', '2024-11-28 20:17:38', '80f2f836-76b9-4b32-af82-a81054235ec5', 1, 2, 0)
Error Info: Array
(
    [0] => 23000
    [1] => 1216
    [2] => Cannot add or update a child row: a foreign key constraint fails

How to reproduce

I installed Sprout Redirects instead of Redirects Manager (disabling it).

Sprout Version

4.47.2

Craft Version

4.13.3

Database Type Version

MYSQL

idleog commented 11 hours ago

I have the same issue. Locally it works, not on live site CraftCMS: 5.5.3 Sprout Redirects Lite: 5.0.1 Database: MariaDB 10.6

idleog commented 11 hours ago

update I was playing around a little bit and here is what helped me: Deinstalling and reinstalling the plugin on the live site made the bug disappear.

But As soon as I deploy the project config files of local environment to the live site and apply them, the bug reappears.

Cheers Peter