First thank you for a really nice module. I've set it up at http://www.meingi.com/ early this month, and have since tested it pretty intensely. And then suddenly, tonight I get this warning:

user warning: Duplicate entry '2-73' for key 1 query: INSERT INTO history (uid, nid, timestamp) VALUES (2, 73, 1158787875) in /XXXX/XXXX/XXXX/meingi.com/includes/database.mysql.inc on line 120.

I remember having this problem in April, when it reset the categories in already posted storylinks. We discussed it then (http://drupal.org/node/51789), but I must admin that I gave up on Drupal for a while, tried some other solution, and first late this summer did a complete reinstall, with the new versions of Drupal and all these modules.

The warning doesn't seem to do any harm now, but of course doesn't look good either. Any ideas ?

CommentFileSizeAuthor
bug (Medium).JPG63.21 KBjackdaw

Comments

frjo’s picture

Component: User interface » Miscellaneous
Category: bug » support

Sorry no idea, I have never seen this error message. Anyone else who have any tips?

jackdaw’s picture

Eeh, you posted something similar on March 1, 2006 here: http://drupal.org/node/51789

Warning: Duplicate entry '1-18' for key 1 query: INSERT INTO term_node (nid, tid) VALUES (18, 1) in /home/u1145/xdeb.org/web/vigillar/includes/database.mysql.inc on line 120

And I then confirmed the problem with:

Duplicate entry '1-12' for key 1 query: INSERT INTO term_node (nid, tid) VALUES (12, 1) in...

But okay, those were inserted into term_node instead of history

My version list is by the way:

Drupal 4.7.3, 2006-08-02
$Id: actions.module,v 1.20 2006/06/13 18:55:16 jvandyk Exp $ */
$Id: links.module,v 1.15 2006/08/01 14:56:19 syscrusher Exp $
$Id: taxonomy.module,v 1.275.2.11 2006/07/18 11:42:09 killes Exp $
$Id: vote_storylink.module,v 1.14 2006/05/01 13:43:33 frjo Exp $
$Id: vote_up_down.module,v 1.7 2006/05/01 13:43:33 frjo Exp $ */
$Id: votingapi.module,v 1.38 2006/07/01 14:07:46 eaton Exp $ */

And I ran the update.php yesterday, after having updated the video-module. This is by the way the one thing that I feel most insecure about. When running the update.php, it warns that I shouldn't run it twice. But I have to do that, don't I, if I'm to run it everytime I replace some module files with newer versions ?

jackdaw’s picture

Anyway, it seems that it was a single hickup. I only got that one warning, have been posting since, and everything seems normal.

jackdaw’s picture

Hmm, now I got the same message just by installing another module ...

user warning: Duplicate entry 'modules/google_analytics/googleanalytics.module' for key 1 query: INSERT INTO system (name, description, type, filename, status, throttle, bootstrap) VALUES ('googleanalytics', 'Adds tracking code to all pages of your site', 'module', 'modules/google_analytics/googleanalytics.module', 0, 0, 0) in /XXX/XXX/XXXX/meingi.com/includes/database.mysql.inc on line 120.

I'm still confused, but at least now the problem seem to be with Drupal, rather than just the vote up/down module. I searched a bit more here on Drupal, and found this nice page in the handbook: http://drupal.org/node/69722

The likely problem (short form): At some point, the sequence table in your Drupal database was not updated.

The solution

1. Access your database. Check the affected table. In this case, the error tells us that it is the node table (query: INSERT INTO node). This also happens with other tables, modify these instructions accordingly.
2. This is the node table, so the problem is the node id (nid). Each node has a unique id. Look at your table, and find the highest node id (nid). If you have many nodes, it may help to sort your table by nid to find the highest one.
3. Go to your sequences table. Change the node id in the sequences table to a number higher than the id you found in step 2.

Eeh right, still seriously nerdy, but I'll try.

frjo’s picture

Status: Active » Closed (fixed)