Using "Attached Images", on Browsing and selecting an image to upload, on pressing Submit, I get a warning message that mentions xmlsitemap_node:

user warning: Duplicate entry '2463' for key 1 query: INSERT INTO xmlsitemap_node (nid, pid, last_changed, priority_override) SELECT 2463, ua.pid, 1213532785, NULL FROM node n LEFT JOIN url_alias ua ON ua.src = CONCAT('node/', CAST(2463 AS CHAR)) LIMIT 1 in /home/752/../public_html/includes/database.mysql.inc on line 172.

My thumbnail and image both seem to have uploaded fine, so I don't know whether this message is serious.

Comments

avpaderno’s picture

It just means that XML Sitemap is trying to insert in its table a value that is already present. It's not critical, but it's surely a serious bug.

avpaderno’s picture

Version: 5.x-1.6 » 5.x-2.x-dev

I am changing the referring version.

mikeytown2’s picture

Version: 5.x-2.x-dev » 6.x-1.x-dev
Component: xmlsitemap_node » xmlsitemap_node.module

Error showed up in the 6.x version

Error happens right before the node is successfully created via watchdog.

Duplicate entry '431' for key 1 query: INSERT INTO xmlsitemap_node (nid, changed, previously_changed, comment_ratio, priority_override) VALUES (431, 1240693277, 1240693261, 0, -2) in /includes/common.inc on line 3422.

I have the rules module set up to save the node again because various tokens don't get set correctly, so this is a cheap trick that makes all my tokens work. FYI Error appears only in 3 modules out of about 80 modules.
#444947: Duplicate entry error
#445034: Duplicate entry error when saving a node with rules.module

avpaderno’s picture

Title: Duplicate entry when saving a node with rules.module » Duplicate entry

I guess it depends on the method used from Rules to save the node.
xmlsitemap_node.module implements hook_nodeapi(), and when the operation is update it first checks if a database row already exists; it doesn't check that when the operation is insert, which is supposed to be invoked when a node is being inserted in the database, not when the node data are being updated in the database.

It seems more a issue with Rules, rather then with the modules you have opened an issue for.

avpaderno’s picture

Title: Duplicate entry » Duplicate entry when saving a node with rules.module

I am changing the title to something more appropriate; as the error doesn't appear in all cases, but just when saving a node through Rules, I am making the title more descriptive.

avpaderno’s picture

Title: Duplicate entry » Duplicate entry when saving a node with rules.module

As I reported in http://drupal.org/node/445084#comment-1529778, I am not able to reproduce this issue in the test site I am using.

andypost’s picture

So maybe this issue is related to Rules?

avpaderno’s picture

If it would be an issue with this project, the problem would not appear only when saving again the node with Rules.

avpaderno’s picture

Category: bug » support
Status: Active » Fixed

As I thought, the module causing the issue was Rules. The issue is being fixed in that module.

mikeytown2’s picture

thanks for helping out in all the threads I made :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.