Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
While cron has run I saw this error logged.
Duplicate entry '1005-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 (1005, 'taxonomy_term', '1', 'taxonomy/term/1005', '', 1, 1, 0, 0, 0.5, 0, 0, 0) in sites/all/modules/xmlsitemap/xmlsitemap.inc in Line 137.
Comment | File | Size | Author |
---|---|---|---|
#24 | modules.txt | 14.43 KB | trinsic |
Comments
Comment #1
hass CreditAttribution: hass commentedUps, I have hundreds of this errors...
Comment #2
hass CreditAttribution: hass commentedThis is a small part of warnings:
Comment #3
Dave ReidCan you add a debugging or debug_backtrace() before that line to see who's creating/calling/responsible for those duplicate links?
Comment #5
Vuds CreditAttribution: Vuds commentedI have this problem also... My taxonomy has more than 10,000 terms (8 thousand in just one vocabulary).
What is this function that you mention? Is it in Devel?
Thanks for attention!
Comment #6
hass CreditAttribution: hass commentedAlso, no idea what I should do.
Comment #7
enli CreditAttribution: enli commentedsubscribing
Comment #8
WildBill CreditAttribution: WildBill commentedI'm also seeing this error...
Comment #9
Dave ReidWhat kind of taxonomy-related modules does everyone have enabled? Maybe we can find the culprit somewhere as I don't get this problem with just XML sitemap + Drupal core.
Comment #10
Dave ReidAlso record any actions/triggers/rules working on taxonomy terms
Comment #11
hass CreditAttribution: hass commentedThe only modules I can currently think of that extend taxonomy specific functionalities on my site are taxonomy_breadcrumb, taxonomy_menu, taxonomy_title, term_fields... no actions, triggers or rules.
If it's a module I would guess taxonomy_menu could be a cause. I have a ~1200 terms menu based on taxonomy_menu. But I have not seen this issues with the previous alpha versions and have not updated taxonomy_menu!
Comment #12
WildBill CreditAttribution: WildBill commentedI'm just using the Taxonomy Manager module and Calais. No rules or triggers that are specifically about taxonomy.
But.... the issue has mysteriously disappeared for me. I saw HUNDREDS of these errors at one point, all at the same timestamp. Now they're gone (not occurring anymore). I haven't changed anything. Weird.
Comment #13
hass CreditAttribution: hass commentedI think you need to uninstall and reinstall or upgrade from earlier versions to see this happens again...
Comment #14
WildBill CreditAttribution: WildBill commentedWell if it only happens once, then I'm not really that concerned about it.
Comment #15
hass CreditAttribution: hass commentedIf something has failed and is now cluttered and defective it should affect something... Maybe you haven't seen it yet.
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedI know that autotag module does the wrong thing with taxonomy within the node object that causes this type of issue. See #361509: Duplicate entry for taxonomy SQL query for the issue.
Comment #17
hass CreditAttribution: hass commentedI do not have autotag installed. Never heard about it yet...
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedMaybe not but the comments in the issue point you to the problem caused by the module and how to resolve the issue. I even posted a patch for the autotag module that was ignored.
Comment #19
Anonymous (not verified) CreditAttribution: Anonymous commentedTo be clear, see the description at comment #361509-16: Duplicate entry for taxonomy SQL query. I go into detail of the issue with both an array of tids and objects of term data set in the data passed to taxonomy_node_save.
Comment #20
hass CreditAttribution: hass commentedGot the error again when saving a term. We only added a description to an existing term and saved the term.
Sum up - this is NOT a one time issue. Only as note - I'm using taxonomy menu 2.4 rc1 as newer versions are really broken.
Comment #21
hass CreditAttribution: hass commentedI've taken a look into the xmlsitemap table and now I have many duplicates per ID... or it looks so.
Comment #22
hass CreditAttribution: hass commentedOnly as a side note - uninstalling xmlsitemap taxonomy does not remove the taxonomy entries from the xmlsitemap table.
Comment #23
hass CreditAttribution: hass commentedI have uninstalled taxonomy and done a full rebuild - but the below entries are still in the tables.
Comment #24
trinsic CreditAttribution: trinsic commentedIm getting the same error when I try to enable xml sitemap for taxonomy terms:
Also I noted in the settings that its not actually indexing any terms into the sitemap because of the error:
A list of enabled modules is attached:
Comment #25
sp_key CreditAttribution: sp_key commentedThe problem affects me as well.
Happens every time I run Cron or update taxonomy terms.
Comment #26
Dave ReidCan someone lookup their databases schema definition for the {xmlsitemap}.type column and also the primary key on {xmlsitemap} ?
Comment #27
Danny EnglanderSubscribing
Comment #28
sp_key CreditAttribution: sp_key commentedHi Dave,
I'm happy to do this for you but can you please elaborate a bit?
What kind of information do you need and can you please help me with the query syntax?
Comment #29
hass CreditAttribution: hass commentedComment #30
Dave ReidI'm not sure how to make it a query. I use visual db editors to see the schemas.
Moving this to a support request since I can't still reproduce and we haven't found out what's at fault yet.
Comment #31
hass CreditAttribution: hass commentedThis IS a bug and many have it... and really annoying and critical nevertheless you cannot repro yourself.
Comment #32
Dave ReidPlease don't change the meta information again until #30 is addressed. I'm aware multiple people are having this problem, but it's not something I have been able to reproduce on a clean core install.
Comment #33
Dave ReidComment #34
sp_key CreditAttribution: sp_key commentedSo can someone have a look as requested in #26?
I don't know how to do what Dave is asking
Comment #35
talatnat CreditAttribution: talatnat commentedI am re-opening this issue because I am also getting this error. Per Dave's request at #26, Schema module reports the following mismatch for xmlsitemap:
column type - difference on: length
declared: array('description' => t('TODO: please describe this field!'), 'type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => '')
actual: array('description' => t('TODO: please describe this field!'), 'type' => 'varchar', 'length' => '12', 'not null' => TRUE, 'default' => '')
column subtype - differences on: not null, length, default
declared: array('description' => t('TODO: please describe this field!'), 'type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '')
actual: array('description' => t('TODO: please describe this field!'), 'type' => 'varchar', 'length' => '32', 'not null' => FALSE)
menu_name: unexpected column in database
indexes menu_name: unexpected (not an error)
The primary key is:
Keyname (BTREE), Type (PRIMARY), Unique (Yes), Packed (No), Field (id, type), Cardinality (0, 26751), Collation (A, A)
FYI, the user warning I get is:
user warning: Duplicate entry '461-taxonomy_ter' for key 'PRIMARY' query: INSERT INTO xmlsitemap (id, type, subtype, loc, language, access, status, status_override, lastmod, priority, priority_override, changefreq, changecount) VALUES (461, 'taxonomy_term', '53', 'taxonomy/term/461', '', 1, 0, 0, 0, 0.5, 0, 0, 0) in /media/data/3-www/dr620test/sites/all/modules/xmlsitemap/xmlsitemap.inc on line 137.
I am using xmlsitemap version 6.x-2.0-beta1, and have xmlsitemap taxonomy turned on. I just want to check whether I should manually correct the varchar lengths and the 'not null' setting to TRUE -- don't want to create any other problems here since I don't know what these changes will affect. Also, any hints on where the menu_name column and indexes menu_name came from -- is it from xmlsitemap menu (which I don't have turned on), and is it OK to delete these columns?
Thanks.
Comment #36
talatnat CreditAttribution: talatnat commentedI went ahead and made the changes to the column type and subtype, and the Duplicate entry warnings died. So, in my case, it just seems to be a case of database mismatch. I also upgraded to beta-2 and the changes I made are still in place. You can close this issue, thanks.
Comment #37
Anonymous (not verified) CreditAttribution: Anonymous commentedI think the manual intervention for this case is the only solution to the issue.
Comment #38
Anonymous (not verified) CreditAttribution: Anonymous commentedI realize this has been closed for a little while now, but for people who can't manually modify their DB, why not add a new update to the install to ensure type and subtype are using the correct field definitions. If your field definition is correct, you won't lose data. But if the definitions aren't correct, it will make them correct and stop the errors.
Adding the following to the install file would do it:
function xmlsitemap_update_6205() {
$ret = array();
db_change_field($ret, 'sitemap', 'type', 'type', array(
'description' => 'Primary key with id; the type of item (e.g. node, user, etc.).',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => ''
));
db_change_field($ret, 'sitemap', 'subtype', 'subtype', array(
'description' => 'A sub-type identifier for the link (node type, menu name, term VID, etc.).',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => ''
));
}