-
Notifications
You must be signed in to change notification settings - Fork 635
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
[4.x]: Craft cant prune matrix block revisions #15843
Comments
This can happen if the revision Matrix block gets orphaned, because its parent revision was deleted. The extra data should be harmless though. Are you seeing a correlation with these revisions and your Craft 5 upgrade issues? |
I think their is a correlation. This page only has 1 section and a single page homepage. Which use the same matrix.
This only happens on certaint entries. 2024-10-09 06:09:11 [web.ERROR] [yii\db\IntegrityException] SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`aerni_craft3`.`elements_owners`, CONSTRAINT `craft_fk_ceaqebrrnpcqgrfcdqyumrbitblcnnaveldu` FOREIGN KEY (`elementId`) REFERENCES `elements` (`id`) ON DELETE CASCADE) The SQL being executed was: INSERT INTO `elements_owners` (`elementId`, `ownerId`, `sortOrder`) SELECT `o`.`elementId`, 48816, `o`.`sortOrder` FROM `elements_owners` AS `o` WHERE `o`.`ownerId` = 18 {"trace":["#0 /vendor/yiisoft/yii2/db/Command.php(1325): yii\\db\\Schema->convertException()","#1 /vendor/yiisoft/yii2/db/Command.php(1120): yii\\db\\Command->internalExecute()","#2 /vendor/craftcms/cms/src/services/Drafts.php(183): yii\\db\\Command->execute()","#3 /vendor/craftcms/cms/src/controllers/ElementsController.php(1505): craft\\services\\Drafts->createDraft()","#4 [internal function]: craft\\controllers\\ElementsController->actionSaveDraft()","#5 /vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()","#6 /vendor/yiisoft/yii2/base/Controller.php(178): yii\\base\\InlineAction->runWithParams()","#7 /vendor/yiisoft/yii2/base/Module.php(552): yii\\base\\Controller->runAction()","#8 /vendor/craftcms/cms/src/web/Application.php(350): yii\\base\\Module->runAction()","#9 /vendor/craftcms/cms/src/web/Application.php(649): craft\\web\\Application->runAction()","#10 /vendor/craftcms/cms/src/web/Application.php(312): craft\\web\\Application->_processActionRequest()","#11 /vendor/yiisoft/yii2/base/Application.php(384): craft\\web\\Application->handleRequest()","#12 /web/index.php(29): yii\\base\\Application->run()","#13 {main}"],"memory":30391696,"exception":"[object] (yii\\db\\IntegrityException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`aerni_craft3`.`elements_owners`, CONSTRAINT `craft_fk_ceaqebrrnpcqgrfcdqyumrbitblcnnaveldu` FOREIGN KEY (`elementId`) REFERENCES `elements` (`id`) ON DELETE CASCADE)\nThe SQL being executed was: INSERT INTO `elements_owners` (`elementId`, `ownerId`, `sortOrder`)\nSELECT `o`.`elementId`, 48816, `o`.`sortOrder`\nFROM `elements_owners` AS `o`\nWHERE `o`.`ownerId` = 18 at /vendor/yiisoft/yii2/db/Schema.php:676)\n[previous exception] [object] (PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`aerni_craft3`.`elements_owners`, CONSTRAINT `craft_fk_ceaqebrrnpcqgrfcdqyumrbitblcnnaveldu` FOREIGN KEY (`elementId`) REFERENCES `elements` (`id`) ON DELETE CASCADE) at /vendor/yiisoft/yii2/db/Command.php:1320)"} FYI: Running crafts |
@brandonkelly I just saw that the mentioned issues is talking about the "supertableplugin". We are not using it. |
@brandonkelly this will not be realted to the super-table plugin. |
Would either of you be able to share your Craft 5 database backup and Composer files, so we can reproduce locally and fix this? If so, please send them into [email protected] |
What happened?
Description
We had a problem with a Craft 5 Update and started researching. Right now we found out that downgraded back to Craft
4.12.5
. We are not able to clean all revisions from the DB.Steps to reproduce
Expected behavior
All revisions all cleaned / or marked to delete for the 'garbage collector'
Actual behavior
Craft CMS version
4.12.5
PHP version
8.2
Operating system and version
No response
Database type and version
MySQL 8.0.32
Image driver and version
GD 8.2.24
Installed plugins and versions
The text was updated successfully, but these errors were encountered: