I have recently upgraded a website from 4.7.x to 5.1.
Now when a uer try to post as story it get following error.

user warning: Duplicate entry '4-4' for key 1 query: INSERT INTO node (nid, vid, title, type, uid, status, created, changed, comment, promote, sticky) VALUES (4, 4, 'Aussies savour hat-trick', 'story', 1, 1, 1177868566, 1177868566, 2, 0, 0) in /mounted-storage/home50c/sub008/sc34239-FQOW/ims/includes/database.mysqli.inc on line 151.

------
Sharique

Comments

jgodfrey’s picture

We are seeing a similiar error and it is listed below. It appears that the InnoDB table is not performing the auto_increment correctly. As per the MySQL website, the auto_increment is being handled in memory until the server restarts. However, this appears to be more of an issue with the application (Drupal) wherein it is trying to send the node id or the quiz id to the table to insert it with, rather than relying upon the auto_increment settings from the db.


http://dev.mysql.com/doc/refman/5.0/en/innodb-auto-increment-column.html


Duplicate entry '18-18' for key 1 query: INSERT INTO node (nid, vid, title, type, uid, status, created, changed, comment, promote, sticky) VALUES (18, 18, '..', 'story', 2, 1, 1179183981, 1179183981, 2, 1, 0) in D:\clients\site\includes\database.mysql.inc on line 172.


Duplicate entry '78' for key 1 query: INSERT INTO quiz_result (rid, quiz_nid, uid, time_start) VALUES (78, 79, 2, 1179183627) in D:\clients\site\includes\database.mysql.inc on line 172.


Luckily, it is not overwriting the data that we have in the tables. I am not for sure what the solution to this issue may be. If there are any suggestions, it would be greatly appreciated. Thanks!!!


- John -

sharique’s picture

This error is due to sequencer.
The solution is
U need to manually update sequences table.
For Example if u have last nid in nodes table is 100, than in sequences set node_nid to 100.
--------
Sharique uddin Ahmed Farooqui
IT head, Managefolio.com

Sharique Ahmed Farooqui

jgodfrey’s picture

Thank you for the tip and idea. I went in and manually adjusted the table and everything is working like it should again. Thanks again for your help with this. It was greatly appreciated.

mechdrupal’s picture

i got this problem too, in my package_kit ubercart. error just pops out. I'm new with handling databases. Can anyone tell how to this? how to adjust in the table? thanks