Please explain what the error message quoted below means and how to fix it:

Duplicate entry '85' for key 1 query: INSERT INTO gsitemap (nid, last_changed, last_comment) VALUES(85,1132801436,0) in /home/s16dntn/public_html/includes/database.mysql.inc on line 66.

Comments

SamAMac’s picture

It means that the module is attempting to insert a duplicate entry for a node.

When do you receive this error?

clickdeveloper’s picture

I just see the error in the sitemap itself at mydomain.com/?q=gsitemap and in the Drupal log files. I don't know how and when I got this error. Any recommendations on fixing it?

SamAMac’s picture

That is strange. The query specifically looks for nodes that are not already in the gsitemap table.

Are you using mySQL or postgreSQL, and which version?

clickdeveloper’s picture

mySQL

I've removed entry '85' from the gsitemap table in the DB. The module works fine now. Anyway, thanks for the great module.

clickdeveloper’s picture

MySQL 4.1.13

SamAMac’s picture

Status: Active » Closed (fixed)

OK.

I don't know what caused it in the first place, but I'm glad it's working for you now.

he_who_shall_not_be_named’s picture

If you update/remove comments that error appears.

he_who_shall_not_be_named’s picture

Category: support » bug
Status: Closed (fixed) » Active
SamAMac’s picture

Assigned: Unassigned » SamAMac
Status: Active » Fixed

The problem was that Drupal doesn't populate every row in the node_comment_statistics table, just the rows for nodes that have comments. This caused a problem with a join that caused the module to try to reinsert existing rows. It should be fixed in the version now in CVS.

he_who_shall_not_be_named’s picture

I installed it but I have got: "Unknown column 'last_comment_timestamp' in 'field list' query: SELECT node.nid, changed, last_comment_timestamp FROM node LEFT JOIN gsitemap USING(nid) WHERE gsitemap.nid IS NULL - /home/vrencian/public_html/includes/database.mysql.inc"

SamAMac’s picture

Oops. My mistake. I have fixed that.

Anonymous’s picture

Status: Fixed » Closed (fixed)