Jump to content

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '41-0' for key 'PRIMARY'


Zeka
 Share

Recommended Posts

Hi.

I have several sites on which I periodically get this exception 

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '41-0' for key 'PRIMARY' (in /wire/core/FieldtypeMulti.php line 295)

All exceptions go from URLs http404 or 404.

I understand what this exception means, but can't found out what is causing it.

Do you have any suggestions? 

  • Like 1
Link to comment
Share on other sites

  • 3 years later...

I get a very similar issue (repeatedly)

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4612-0' for key 'PRIMARY'

(4612 being the highest page-id, I think)

I get the above error message (just 4612-0, 4612-1, 4612-16, …  would vary like that) a couple of times when uploading multiple images to an images-field when I upload multiple images at once.

It happens on every PW-installation I run on easyname.com webhosting so I doubt it has to do with any modules because the website-installations are quite different and even on the simplest of them it still happens (no hooks or ->save() commands in my php code).

Doesn't happen on local though for the same websites and databases. And unfo I don't have any other webhost to compare it with.

I talked to the host, they advised me to address ProcessWire.

I guess it has to be some basic database structure configurations but it's beyond me and I'm hesitant to mess with it. Might it have to do with the incremental number? Do I need to reset it? How do I? Why is in in conflict?

I very much appreciate any help!

Link to comment
Share on other sites

  • 2 years later...
On 4/6/2017 at 5:30 AM, Zeka said:

Hi.

I have several sites on which I periodically get this exception 

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '41-0' for key 'PRIMARY' (in /wire/core/FieldtypeMulti.php line 295)

All exceptions go from URLs http404 or 404.

I understand what this exception means, but can't found out what is causing it.

Do you have any suggestions? 

Make a static page 404.html
Fix the line in the .htaccess file
From
ErrorDocument 404 /index.php
to
ErrorDocument 404 /404.html

Also, it would be useful to read the article "Optimizing 404 requests in Processwire"

  • Like 2
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...