Closed roberttolton closed 5 years ago
Strangely I cannot replicate this and no other reports of it have come in. Are you using MySQL or Pestgres? Can you try uninstalling the plugin and installing it again to ensure that the tables are recreated with the correct cascading rules in place and retest?
I also added some code to help prevent this in future in version 2.0.2.
It's MySQL. I haven't tried re-installing yet, but do you have an ETA on 2.0.2
?
2.0.3 is already available.
This seems to match the issues I have been troubleshooting, as documented in #69, and can confirm similar Integrity constraint violation: 1062 Duplicate entry
messages and failure to break the cache. This is on version 1.11.5 - we're hoping to do an upgrade of Craft to 3.1+ and Blitz in early April and am hopeful that this issue will be resolved.
@roberttolton, curious to know if this has been fixed with the updates?
I forgot to mention I'm only on Craft 3.0.x
and so my latest available version is 1.11.5
.
If you are still on Blitz 1 and this issue is still cropping up then you can check if the relationships are set up correctly in the database.
blitz_caches_siteId_fk
in the blitz_caches
table.blitz_elementcaches_cacheId_fk
and one called blitz_elementcaches_elementId_fk
in the blitz_elementcaches
table.If any of these relationships do not exist then I would recommend uninstalling and reinstalling Blitz to ensure that the tables have the correct relationships in place.
Hi,
I'm seeing a few more of these popup:
It happens for posts and other pages such as a posts listing. Usually right after, or when the cache is meant to be cleared. Any other information I can give to help?
-EDIT-
So I can randomly reproduce an issue which might be caused by the above once it occurs, and that's any edits I make to a post don't break the cache. I have to clear the cache manually, and then the cache-break-on-save works again until the next time it doesn't.
When the issue occurs, the row that represents the page in question is no longer in the
craft_blitz_caches
table, indicating it has yet to be cached. However, the static file still remains on disk - so going to the post in the browser loads up this file and not one with the changes. If I rename, move or delete this static file and visit the post, the changes show-up, a row is inserted and a new file is written to disk.So perhaps it's the cache-warming process that's going wrong? But I'm not getting any errors, and it's really intermittent. I'm not sure if which the duration between hitting 'Save' on the post and trying to view it online makes a difference.
-EDIT-
Ok, so it seems to indeed be the
Integrity constraint violation: 1062 Duplicate entry
error which causes an Error 500 status on my front-end for that single request - it's just a matter of whether I got to the error first or the warming job did. Looking at my BugSnag reports, I can see the times that the warmer hit the error:And when I hit the error:
Considering that it results in an Error 500 I'm figuring the warming job doesn't finish properly.