Jump to content

With the http404 page I sometimes get a SQL-Error notification


horst
 Share

Recommended Posts

Every now and then (once a week or lesser) I get emailed the following error notification on one site that's running PW 2.6:
 

Page: http://example.com/http404/
User: guest

Error: 
Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '41-0' for key 'PRIMARY' (in /www/htdocs/example.com/wire/core/FieldtypeMulti.php line 261)

Does someone know what I may have missconfigured or what is responsible for it / where I should look into?

  • Like 1
Link to comment
Share on other sites

If you have some import script/bootstrap or maybe or alike that will result sometimes in a /http404/, I'm seeing that since long time in logs when errors occur. Meaning there's no page with a url. Bootstraped scripts also result in a "guest" user.  Or if it is triggered by a lazycron by a guest visit.


A little annoying in that you need to know it or assume it's happening on the 404 page, which is not true. I wonder if it would be possible to fix this.

  • Like 1
Link to comment
Share on other sites

If you have some import script/bootstrap or maybe or alike that will result sometimes in a /http404/, I'm seeing that since long time in logs when errors occur. Meaning there's no page with a url. Bootstraped scripts also result in a "guest" user.  Or if it is triggered by a lazycron by a guest visit.

A little annoying in that you need to know it or assume it's happening on the 404 page, which is not true. I wonder if it would be possible to fix this.

Oh, thanks, thats very helpful. I have a cron running there that starts a bootstrapped script two times per day. I think I put in some code to make it first login as a special user to be sure that it is the script that produces sometimes the errors.

A bit weird with the error message is, that a page with ID 1062 exists, but it get not touched with the bootstrapped script. Also I have dumped the complete DB into an editor and searched for the string '41-0', but it isn't present, not only one times.

And yes, it is a little annoying if one do not know this. The first thing I have done was uninstalling a module (jumplinks) that can be configured to deal with 404s. I've put all redirects into the htaccess file and after that for two weeks no error occured. But than it occured again without any further change on the site.

Link to comment
Share on other sites

"41-0"  PRIMARY

I think it is an indize of pages_id and sort or alike. FieldtypeMulti can be a lot. It could also be a page field etc.


1062 is the #id of the error not a page :)

Welcome to advanced PW. I've been there since a long time.

  • Like 1
Link to comment
Share on other sites

"41-0"  PRIMARY

I think it is an indize of pages_id and sort or alike. FieldtypeMulti can be a lot. It could also be a page field etc.

1062 is the #id of the error not a page :)

Ah, ok. It's an error ID.

 Welcome to advanced PW. I've been there since a long time.

Feels like "thin air", :)

Link to comment
Share on other sites

  • 3 months later...

The error essentially means something is trying to insert a record in the database with the unique key being one, that's already present. Not very helpful on it's own, but the db doesn't have any more knowledge about what you're trying to do at that point.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

I'm getting the same error and quite often.

Maybe it's about the admin/superuser account? Cause Soma said indice of pages_id and sort in this case, or at least in my case it should be about language or roles field of the superuser, but I'm not changing my own language or roles any where via api only having a few $user->isSuperuser conditionals...installation is quite new PW 2.7.1 just a few module manually imported from another PW installation and re-modeled almost everything

Would love to fix this, but as long as nobody else will be annoyed by this error visibly it's not too bad.. ;-)

Link to comment
Share on other sites

  • 8 months later...

+1 (I am seeing this error once a day (I think) on a site).

I assume it's when my hosting are doing a backup and SQL is momentarily offline - no reason, other than a hunch.

I was about to (using jumplinks) point /http404/ at / in the hope it cured it, but I suspect it would not.

Link to comment
Share on other sites

  • 9 months later...

i am having this issue as well. it happens when i try to save certain pages on the back end. i click save, it takes me to the error page, when i go back to the page i was trying to save, the content i added is missing.

 

 

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Hi, Even I am facing the same issue, do we have any solution for this?

I have a field which holds multi language called hotel name when it tries to change the Arabic name to some other value and save it says the below error and Arabic field value not saved.

Quote

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '88-14191' for key 'name1056_parent_id'

 
 

When I checked in DB pages table has unique key   

Quote

UNIQUE KEY `name1056_parent_id` (`name1056`,`parent_id`),

as shown in the attachment.

The value for field name1056 is null but It has value saved for Arabic text already.

Now, I am stuck with this issue, anyone has any solution to this?

 

Screen Shot 2017-07-24 at 1.52.43 PM.png

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...