-
Notifications
You must be signed in to change notification settings - Fork 66
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: Duplicate entry […] INSERT INTO revisions #813
Comments
I'm unable to reproduce this right now, but I've seen it come up rarely in the past. I suspect it isn't a Neo bug since Craft controls the value of I can't rule out that Neo is doing something to make Craft set the wrong |
Thanks for your quick response – Your explanation makes absolute sense. We do now have another possible option for a fix, based on suggestions from the craft support team.
If the error reoccurs after that, I can only report here again and let you take a closer look. (Thank you so much for the offer!) Fortunately, I can save us all the time at the moment. |
No worries - will leave this issue open for a while in case it happens again. |
@Abromeit Are you using the Site Copy plugin? |
No. Site Copy hasn't been considered for any of our systems. Here is our list of plugins:
Just to let you know - the issue came back. Several days after we applied everything that craft support suggested. So we put the website live with revisions disabled. |
I’m helping someone with this issue, and the steps from the previous comments help. In the case that I’m working on, it seems to be caused by this: https://github.com/craftcms/cms/blob/develop/src/services/Revisions.php#L88-L96 not returning any results and therefore going with For newly created blocks & then their revisions, the I’m not quite sure what could be causing it, but I thought I’d share just in case you know why this could happen. |
@ttempleton Should I send you our DB, in our case it is very easy to reproduce the scenario? |
Thanks @i-just, sounds like some revision Neo block data has somehow incorrectly been deleted. Yes @alexanderloewe, please send the database backup and composer files to [email protected] and let us know the steps to reproduce the error, and we'll have a look at it. |
We reproduced this again today, on a project where I have determined that the core of the issue is that the garbage collection event is triggered after the deletion of orphaned draft and revision data, meaning that orphaned Neo revision data is not cleared out. I tested moving the deletion of partial Matrix block data after the deletion of orphaned draft and revision data, and confirmed that the same error occurs. So I believe the proper fix to this error is for Craft to delete orphaned draft and revision data after the event has been triggered. As a short term solution, running Closing this issue in favour of craftcms/cms#14309. |
Bug Description
The specific problem is as follows.
We create a new page in the admin panel and fill it with initial content.
If additional content is added later on, the page can sometimes no longer be saved.
(Regardless of whether we have actually added further content or not. A simple click on the "Save" button is usually enough to trigger the error on the affected pages).
We usually receive feedback from our content team such as "I edited the page two days ago and everything was fine. Today I wanted to add something there and got the error."
We have since observed that the error sometimes disappears by itself after a few days. However, it then resurfaces in new places (pages).
Here is a dump of the error:
Some of the things we already tried, without success:
./craft gc/run
./craft resave/neo-blocks
./craft utils/fix-element-uids/index
./craft utils/fix-field-layout-uids/index
./craft utils/prune-provisional-drafts/index
./craft utils/repair/section-structure produkte
./craft utils/repair/project-config
Further information:
There is no custom PHP code in our system. We work exclusively with the field builders of the admin area and also with Twig.
Temporary fixes we've found:
So far, we have found two (unfavorable) solutions that allow pages in question to be saved correctly again:
Steps to reproduce
Unfortunately, we have not yet found a direct way to reproduce the error.
Information about errors like these is therefore passed on to us by our content team as they occur.
Please let us know if there is anything else we can do to help. For example, the provision of a DB dump, repository access or the deployment of an additional server instance with the affected system wouldn't be a problem.
Expected behaviour
No response
Neo version
3.9.8
Craft CMS version
4.5.11
What is the affected Neo field's propagation method?
Only save blocks to the site they were created in ("none")
Does this issue involve templating, and if so, is eager-loading used?
This is not a templating issue
The text was updated successfully, but these errors were encountered: