thetuningspoon Posted March 31, 2015 Share Posted March 31, 2015 I recently upgraded a few of my older ProcessWire sites to 2.5.23. Soon thereafter I've been getting the following error report sent to me from several of the sites: Page: .../http404/ User: guest Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '41-0' for key 'PRIMARY' (in .../wire/core/FieldtypeMulti.php line 261) I can't seem to replicate the issue, and I'm not even sure where it's happening because reportedly it is happening on the 404 page? Any ideas? Link to comment Share on other sites More sharing options...
LostKobrakai Posted March 31, 2015 Share Posted March 31, 2015 It's an error that prevents saving of data to the database with the same unique field, e.g. same id. So it's most likely a pagefield or something else which is multi value. Also check your modules if they could be the issue. Link to comment Share on other sites More sharing options...
thetuningspoon Posted March 31, 2015 Author Share Posted March 31, 2015 Why would this be triggered by a guest on the site, though? I don't recall any of these sites saving or creating fields or pages from within templates. Edit: I also know for certain that at least one of them didn't have any changes made on the backend by the client during this time, either. Link to comment Share on other sites More sharing options...
Soma Posted March 31, 2015 Share Posted March 31, 2015 http404 doesn't necessarely mean it was on 404. Guest because it is triggered by a visitor. But can be amything. A cron script or a template or module. Link to comment Share on other sites More sharing options...
cstevensjr Posted March 31, 2015 Share Posted March 31, 2015 One thing to always keep in mind, if you are on a shared hosting plan, your website can get probed by other users that share the same server you are hosted on. You can also get probed by bots and other scripts running on that server. Link to comment Share on other sites More sharing options...
thetuningspoon Posted April 1, 2015 Author Share Posted April 1, 2015 Can the '41-0' provide me with any clue towards debugging this? If that is a pointer to an entry in the database, I could look it up in the database. I'm just not sure how that number maps to entries. Link to comment Share on other sites More sharing options...
LostKobrakai Posted April 2, 2015 Share Posted April 2, 2015 It's like it's mentioned in the error message. There's already an entry with the primary key 41-0 in any of your tables and some code is trying to save another entry with this primary key to this exact same table. For me this error was most of the time caused by (own) modules, which did stuff they weren't supposed to do. But basically you could also just search your site folder for "->save(" as this is the part which will result in the error. 2 Link to comment Share on other sites More sharing options...
thetuningspoon Posted April 2, 2015 Author Share Posted April 2, 2015 Thanks for the ->save() tip. I'll see what I can find. I was hoping there was some way to tell what table or row the error pertained to. Link to comment Share on other sites More sharing options...
cstevensjr Posted April 2, 2015 Share Posted April 2, 2015 FYI, I routinely use Piwik for my web analytics on all my websites and any client's properties that I maintain. I can usually correlate the errors you are referring about to guest activity (i.e. unknown individuals or bots). If it's related to my own activity, I can look at the page affected (Piwik gives me this information) and then troubleshoot what PW template is associated with the problem (page). I'm quite sure there are other ways of tracking down this information, however that has worked for me. What I'm glad about is that PW gives up the error for me to troubleshoot. 1 Link to comment Share on other sites More sharing options...
Soma Posted April 2, 2015 Share Posted April 2, 2015 FieldtypeMulti hints to fields like a image, comments or pagetable field. The http404 hints at it's either the 404 page. Or a URL that is called that doesn't exist and that renders the 404 page but I'm not sure if that would result in a /http404/ (but could be). I have had errors shown and searched for hours until I realized it's a $page->render() I use in templates and the path the error logs was the url of the rendered page (partial) and not the viewed page. Or it's a export or import script (cron script) or bootstrap script. I think those also would end in a /http404/ as I had lots of these in the past. It might be a page name "41-0" in "pages" table. But since that not a PRIMARY it might be a language name field like "name1038" where 1038 would be the language id. See if you can find a page with that name maybe it's in any of the fields. Does it happen frequently, how many times, when. What modules have you installed. What fields. All might be a hint at where to look for. 1 Link to comment Share on other sites More sharing options...
Soma Posted April 2, 2015 Share Posted April 2, 2015 Strange is that: - Duplicate entry '41-0' for key 'PRIMARY' - Doesn't look like "pages" db table. Its primary key is "id" and that can't be "41-0". So I'm not sure. There's also indexes for parent_id and page_id maybe it's one of those. But then 41 would be "admin" and not guest. I got lot's of these when doing multilanguage back then when it was relatively new and had some bugs that took a while to get me into. /http404/ and "guest" definately hints at a script or module that is run via a layzcron or real cron, in a template etc. Sure a search for a "->save(" in your site folder might help to narrow it down. Link to comment Share on other sites More sharing options...
thetuningspoon Posted April 24, 2015 Author Share Posted April 24, 2015 Still getting this on about 6 of my upgraded sites and am still at a loss. I disabled all 3rd party modules on one of the sites. No crons or lazy crons running... and I'm still getting the errors! I get them at least once a week, often a group of them every couple days or so, but no visible regularity to which sites they come from. Quite vexing. Link to comment Share on other sites More sharing options...
thetuningspoon Posted May 27, 2015 Author Share Posted May 27, 2015 Okay, I think I've FINALLY narrowed this down to an issue with the new System Notifications module, which I have enabled on all of these sites. I disabled it on one of the sites and have not seen any errors from it since. It is the only module that uses FieldtypeMulti that is shared by all of the sites that are reporting the issue, and it is of course something that has changed/been added since 2.5. Link to comment Share on other sites More sharing options...
chriswthomson Posted June 18, 2015 Share Posted June 18, 2015 Hello, I'm getting this exact error after launching a site using 2.6.1 for the first time. I ran the site through Xenu link checker to try and trigger the error message, but it ran fine, suggesting to me that the problem doesn't lie in the site templates. The System Notifications module appears to create a table in the database called field_notifications, which holds the data that is used for the notifications. It would appear that the error is being caused by a 404 error trying to be added to this table without a unique pages_id and sort. 41 is the superuser ID I believe. So essentially what is happening is the system is trying to add another record (pages_id = 41, sort = 0) when it already exists. However, I can't seem to replicate this however many times I generate a 404! Any ideas what might be generating the 404 that is causing the error? (PS - Going to disable the 404 notifications for the time being) 3 Link to comment Share on other sites More sharing options...
rst Posted June 29, 2017 Share Posted June 29, 2017 i am having the same issue on the 3.0.62 version. i disabled system notifications module, but it doesn't seem to be helping Link to comment Share on other sites More sharing options...
Peter Knight Posted February 7, 2019 Share Posted February 7, 2019 I'm getting this too Quote Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '41-0' for key 'PRIMARY' (in /var/www/vhosts/domain.com/httpdocs/wire/core/FieldtypeMulti.php line 295) I have notifications turned on too. I wonder has @ryan any advice here if it is notifications. It's hard to replicate. Link to comment Share on other sites More sharing options...
szabesz Posted February 7, 2019 Share Posted February 7, 2019 @Peter Knight Do you have the System Notifications module installed? As far as I know the module cannot be uninstalled so you need to live with this error. I have it too and I also get the message from time to time, however it seems to be "harmless". 1 Link to comment Share on other sites More sharing options...
adrian Posted February 7, 2019 Share Posted February 7, 2019 18 minutes ago, szabesz said: As far as I know the module cannot be uninstalled It can be if you persist hard enough with DB modifications and other trickery, but that module is the devil incarnate for sure ? 1 1 Link to comment Share on other sites More sharing options...
nikoka Posted February 8, 2019 Share Posted February 8, 2019 This comes up time and again, usually harmless, but what's now happened three times (on two different sites) is that at the same time this error pops up, something happens to the cache. The sites HTML and CSS is wiped and all you can see is the sites text content. Once the cache is wiped clean all is back to normal. Don't know if these problems are related, but the timing is peculiar. Both sites are running ProCache 3.18. and PW 3.0.98. Link to comment Share on other sites More sharing options...
benbyf Posted April 10, 2019 Share Posted April 10, 2019 Having this same issue and I'm running System Notifications module, shame, as I hoped the module would be really useful but is mostly a desaster. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now