Hi. So we have our Biblio setup with the keyword option: [Use keywords from biblio entries as taxonomy "free tags"] -- Which has worked great on our test server. However, now once a biblio node is saved, it adds the taxonomy term just fine, but when going back and editing the node upon re-saving I am getting this error:
Duplicate entry 679-4893 for key 1 query: INSERT INTO term_node (nid, vid, tid) VALUES (2266, 4893, 679) in /home/httpd/pages/modules/taxonomy/taxonomy.module on line 716.
However, when duplicating the site on a test server the error is not coming up.
RJerome, you mentioned this as possibly being "a funky state the database got into" and there is a similar error in this post: http://drupal.org/node/501932#comment-1742276 -- You also mentioned you'd seen similar errors in your test environment, so perhaps you have more insight into this?
I have been reading up and some possibilities I've seen are that the Primary Key may have hit its limit and needs to be a larger INT, however, the primary key is set to unsigned int(10), and I don't think that would be it. it doesn't appear there's enough entries to support that. We have tried to optimize the table and defragment it, etc. Would like not to have to destroy and rebuild the table, as we are a production site -- Does anyone have any advice in how to resolve this problem?
Comments
Comment #1
ealtman commentedUpdate from a colleague of Frogtown's working on the same instance --
We looked through the MySQL log and found that the query produced when saving an edited Biblio node was in fact writing twice to the term_node table:
30041 Query INSERT INTO term_node (nid, vid, tid) VALUES (2259, 4886, 664)
30041 Query INSERT INTO term_node (nid, vid, tid) VALUES (2259, 4886, 664)
The error is occurring on our development server -- we just had to change the PHP logging settings to see it. We can configure the settings on our production server so users don't see the warning, but if this contributes to caching overhead, obviously it would be preferable to remove the duplicate INSERT. Please let us know if you have further suggestions or help.
Thanks!
Comment #2
Frogtown commentedSo -- figured out what was causing the problem. We had our taxonomy enabled for the Biblio content type in the edit menu/admin/content/taxonomy/edit/vocabulary/XXX -- Since it is using the free tagging system, for some reason having it enabled for the content type was causing it to try to insert the terms twice. Turned it off as enabled, and now it still saves any biblio keywords to the taxonomy, and doesn't result in the error, and now there's only one query listed in the MySQL log -- hopefully this will help anyone that might run into the same problem.
Comment #3
liam morlandThis version is no longer maintained. If this issue is still relevant to the Drupal 7 version, please re-open and provide details.