A user of my project got the following error message and I cannot understand why it appeared - the mentioned nodes has nothing to do whith each other...

    * user warning: Duplicate entry '673' for key 1 query: INSERT INTO xmlsitemap_taxonomy (tid, vid, changed, previously_changed, priority_override) VALUES (673, 15, 1258049525, 0, -2) in /srv/www/vhosts/my-site.de/httpdocs/includes/common.inc on line 3468.
    * user warning: Duplicate entry '739' for key 1 query: INSERT INTO xmlsitemap_node (nid, changed, previously_changed, comment_ratio, priority_override) VALUES (739, 1258049526, 1258049526, 0, -2) in /srv/www/vhosts/my-site.de/httpdocs/includes/common.inc on line 3468.

Has anyone an idea? the last mentioned node is the node the user just saved when this message appeared.

Greez,
Tobias

Comments

Anonymous’s picture

My best guess here is that perhaps we're not using drupal_write_record correctly. Dave can you check it, please? I should have more time in Dec.

dave reid’s picture

I didn't see anything that looked bad or out of place on initial review.

mrfelton’s picture

subscribe

Starminder’s picture

subscribe

spangaroo’s picture

I'm also receiving the same error. For me it shows up upon successful creation of a new node.

user warning: Duplicate entry '5867' for key 1 query: INSERT INTO xmlsitemap_node (nid, changed, previously_changed, comment_ratio, priority_override) VALUES (5867, 1260261548, 1260261545, 0, -2) in /public_html/includes/common.inc on line 3468.

When I update the node to promote it to my front page using Workflow, there is no error.

Using 6.x-1.1 of xmlsitemap module.

Anonymous’s picture

Based on #5 this appears more a bug in Drupal core than here. It could be possible that the hook is called more than once during the node creation and that the first insert has the row or table locked and the update fails on the second call and then drupal_write_record will attempt an insert causing this error. Is there a workable method for this with operation parameters?

spangaroo’s picture

If there's anything I can do to help, please let me know. I don't know PHP very well but can help with testing and reporting back if there are any errors.

dankohn’s picture

I'm getting a couple hundred of these every hour with cron. And, I just uninstalled completely, confirmed that xmlsitemap, xmlsitemap_node, and xmlsitemap_taxonomy had been removed, deleted files/xmlsitemap directory, and then reinstalled.

Separately, I just deleted the sitemap cache from tools after seeing this error, but then got it again on the next cron.

I'm happy to give a maintainer admin access to my site if it would help you diagnose the issue.

Duplicate entry '2878' for key 1 query: INSERT INTO xmlsitemap_node (nid, changed, previously_changed, comment_ratio, priority_override) VALUES (2878, 1259905994, 1225315771, 0, -2) in /var/www/autism.healingthresholds.com/includes/common.inc on line 3468.

Duplicate entry '2877' for key 1 query: INSERT INTO xmlsitemap_node (nid, changed, previously_changed, comment_ratio, priority_override) VALUES (2877, 1259905994, 1225296682, 0, -2) in /var/www/autism.healingthresholds.com/includes/common.inc on line 3468.

alextronic’s picture

I also get this error.

Maybe it's because I created this module implementing hook_nodeapi??? But my module does not affect node tables. hmmmm

Alex

Anonymous’s picture

This is happening in the 2.x version as well and has a separate ticket for it.

Stephen Scholtz’s picture

subscribe

dave reid’s picture

@earnie: Not sure which 2.x ticket you're referring to. We haven't really had this problem reported in that version.

dave reid’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Assigned: Unassigned » dave reid

I might have been able to duplicate this when using devel_generate to make test nodes. I'll report back on what I find and if I've fixed it.

nirad’s picture

subscribing

been using the module for a couple of weeks and just got this for the first time:

user warning: Duplicate entry '1137' for key 1 query: INSERT INTO xmlsitemap_taxonomy (tid, vid, changed, previously_changed, priority_override) VALUES (1137, 2, 1264958141, 0, -2) in /home/nirad/www/siftangeles.com/includes/common.inc on line 3467.
user warning: Duplicate entry '351' for key 1 query: INSERT INTO xmlsitemap_node (nid, changed, previously_changed, comment_ratio, priority_override) VALUES (351, 1264958143, 1264958142, 0, -2) in /home/nirad/www/siftangeles.com/includes/common.inc on line 3467.
dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

I can't duplicate this anymore. I'll need to have exact conditions as to when this error occurs in order to help fix it.

omegas7’s picture

Subscribing. My error is a bit different, but yeah, it is related to the Taxonomy thingy.

dave reid’s picture

Component: xmlsitemap_node.module » xmlsitemap_taxonomy.module
lewcpe’s picture

I confirmed this bug has something related to the workflow module and it triggers Drupal to call nodeapi/insert for two times as earnie mentioned.

I fixed this bug on my site by check if the record exist in nodeapi/insert as in nodeapi/update.

nyl_auster’s picture

we had this issue to, for the reasons mentionned by lewcpe.
It seems to happen only if you put the action "save post" in a workflow in a "creation" trigger (that's to say, when you fire a node_save when a node is created; through the IU of workflow, using drupal actions.)

I suppose that in this case nodeapi "insert" is maybe called two times so xmlsite_map try two times to insert a new entry, and the second time fails every time.

I hope this can help.

sp_key’s picture

I receive exactly the same error and I'm not using the workflow module.

user warning: Duplicate entry '179-taxonomy_ter' for key 1 query: INSERT INTO xmlsitemap (id, type, subtype, loc, language, access, status, status_override, lastmod, priority, priority_override, changefreq, changecount) VALUES (179, 'taxonomy_term', '23', 'taxonomy/term/179', '', 1, 1, 0, 0, 0.5, 0, 0, 0) in /home/mysite/public_html/sites/all/modules/xmlsitemap/xmlsitemap.inc on line 137.

bedlam’s picture

subscribe

smoothk’s picture

subscribe

sp_key’s picture

Any update anyone?
I now get hundreds of these errors every single time I run cron

hanno’s picture

subscribe (not using workflow)

sp_key’s picture

Any updates?
It seems it's buggy. Still hundreds of errors every time I run cron.