error received upon installing xml sitemaps
| Project: | XML Sitemap |
| Version: | 5.x-1.4 |
| Component: | xmlsitemap |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | by design |
Jump to:
Hi, I'm receiving the following error after enabling the module:
user warning: Duplicate entry '19' for key 1 query: xmlsitemap_node_enable INSERT INTO xmlsitemap_node (nid, pid, last_changed, last_comment, previous_comment) SELECT n.nid, ua.pid, n.changed, s.last_comment_timestamp, MAX(c.timestamp) FROM node n LEFT JOIN node_comment_statistics s ON s.nid = n.nid LEFT OUTER JOIN comments c ON c.nid = n.nid AND c.timestamp < s.last_comment_timestamp LEFT JOIN xmlsitemap_node xn ON xn.nid = n.nid LEFT JOIN url_alias ua ON ua.src = CONCAT('node/', n.nid) WHERE xn.nid IS NULL GROUP BY n.nid, ua.pid, n.changed, s.last_comment_timestamp in /usr/www/users/harry100/includes/database.mysql.inc on line 172.
I previously had gsitemaps module installed - I'm not sure if this could be affecting it.
I'm runnign drupal 5.1 with MySQL database 4.1.20 and
PHP 4.3.10
Any suggestions on fixes are greatly appreciated. Thanks.

#1
This may be a repeat of http://drupal.org/node/212948 . I believe lefnire had a similar issue when having gsitemaps installed. He fixed it by manually dropping the gsitemap tables. You can check out his solution here.
http://drupal.org/node/212948#comment-706898
Hopefully this helps.
ash
#2
I dropped the gsitemaps table, but am still seeing the same error message.
It sounds like this patch: http://drupal.org/node/199413#comment-680050
might be relevant to this error. Is that correct? should i try the patch?
Thanks
#3
I'm not sure if it is a good idea to apply that patch. It doesn't look like that specific one got committed and it also doesn't look like it solved the problem. If you read on in that thread, it looks like darren oh had helped fix that thread's issue and posted his changes in cvs.
You can see his changes here
http://drupal.org/node/199413#comment-682904
You can get a copy of dev here
http://ftp.drupal.org/files/projects/xmlsitemap-5.x-1.x-dev.tar.gz
ash
#4
I tried the new dev version, but it is not recreating the database tables. I'm also receiving this message upon activating it:
* user warning: Table 'harry100_drupaltest.xmlsitemap_node' doesn't exist query: xmlsitemap_node_enable UPDATE xmlsitemap_node xn INNER JOIN node n ON xn.nid = n.nid LEFT JOIN node_comment_statistics s ON s.nid = xn.nid SET xn.previously_changed = xn.last_changed, xn.last_changed = n.changed, xn.last_comment = s.last_comment_timestamp WHERE xn.nid = n.nid AND (xn.last_changed <> n.changed OR xn.last_comment <> s.last_comment_timestamp) in /usr/www/users/harry100/test/includes/database.mysql.inc on line 172.
* user warning: Table 'harry100_drupaltest.xmlsitemap_node' doesn't exist query: xmlsitemap_node_enable INSERT INTO xmlsitemap_node (nid, pid, last_changed, last_comment, previous_comment) SELECT n.nid, MAX(ua.pid), n.changed, s.last_comment_timestamp, MAX(c.timestamp) FROM node n LEFT JOIN node_comment_statistics s ON s.nid = n.nid LEFT OUTER JOIN comments c ON c.nid = n.nid AND c.timestamp < s.last_comment_timestamp LEFT JOIN xmlsitemap_node xn ON xn.nid = n.nid LEFT JOIN url_alias ua ON ua.src = CONCAT('node/', n.nid) WHERE xn.nid IS NULL GROUP BY n.nid, n.changed, s.last_comment_timestamp in /usr/www/users/harry100/test/includes/database.mysql.inc on line 172.
Is there maybe something else I have to clear out first?
#5
After you disable modules do you uninstall them with /admin/build/modules/uninstall ? Maybe after you install the dev file an update.php needs to be run. I'm not quite sure what is going on here. I can't replicate it at all on my side.
ash
#6
I'm getting the same error, though I should note this involves a 4.7.x->5.x site overhaul.
I first tried installing XML Sitemap and got all the DB errors listed above. I have since uninstalled (via the Uninstall tab) and re-enabled the module many times with the same results. All legacy gsitemap tables have been dropped from our DB.
I tried installing the dev version of the XML Sitemap module linked above, but I still got two of the errors I used to see. (Two's better than three, I guess, but I'm still having problems.) Here are the errors:
#7
Those two error messages are displayed when you have dropped the gsitemap tables without uninstalling gsitemap. They're harmless.
#8
I can accept some harmless error messages, but the module still isn't working. I'm not seeing a table in the database for xml sitemaps.
Like Todd, I enabled/re-enabled the module several times. I also used to have gsitemaps, and unfortunately didn't use the uninstall when I removed it.
Is there no way to perform some sort of reset which will allow this module to work properly?
Thanks again