Skip to content
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

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

Open
arentsen opened this issue Nov 28, 2024 · 2 comments

Comments

@arentsen
Copy link

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
Copy link

idleog commented Dec 2, 2024

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
Copy link

idleog commented Dec 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants