So i'm not sure what happened but the importing was working fine up until I updated views. And I'm not sure how that would even affect Feeds. This issue happens when I'm trying to import new nodes into the system from my mailbox. I have no other nodes in the system other than the importer.
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'node-284' for key 'PRIMARY': INSERT INTO {feeds_item} (entity_type, entity_id, id, feed_nid, imported, url, guid, hash) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 284 [:db_insert_placeholder_2] => feedback_importer [:db_insert_placeholder_3] => 55 [:db_insert_placeholder_4] => 1363973130 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => 725208b7e0c7068d723d1488df2ffc31 ) in drupal_write_record() (line 7106 of E:\inetpub\wwwroot\MoxiesFeedback\includes\common.inc).
Comment | File | Size | Author |
---|---|---|---|
#8 | Feeds_error.txt | 3.81 KB | thetech249 |
Comments
Comment #1
jmichelgarcia CreditAttribution: jmichelgarcia commentedSame here.
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'node-25654' for key 'PRIMARY'
Comment #2
fox_01 CreditAttribution: fox_01 commentedDon't exactly know if it is the reason but i have the same error after reimporting an xml. After the first import i deleted the created nodes and now i can't import them again with the error. If so there would be a need to delete old feed items from the database if the nodes are delted.
Comment #3
supriyarajgopal CreditAttribution: supriyarajgopal commentedSubscribing..same issue :'(
Comment #4
fox_01 CreditAttribution: fox_01 commentedI tried completly uninstalling the module and reviewed the database if there are some tables after the uninstallation from this module, but nothing. i reinstalled the module and the issue happens again. i can't import any feed anymore.
Comment #5
oscardax CreditAttribution: oscardax commentedSame issue here. Has been importing several times with no problems, but today this is a show-stopper : /
Error details from registry log are as follows:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '799-0-all' for key 'PRIMARY': INSERT INTO {node_access} (nid, realm, gid, grant_view, grant_update, grant_delete) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 799 [:db_insert_placeholder_1] => all [:db_insert_placeholder_2] => 0 [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 0 ) en node_access_write_grants() (línea 3548 de /home/ensancar/public_html/aidea.ensancarlos.es/modules/node/node.module).
This issue aside, I want to thank to maintainers and contributors for this super helpful module!! : )
Comment #6
thetech249 CreditAttribution: thetech249 commentedSame thing here.
Comment #7
twistor CreditAttribution: twistor commented@oscardax, that looks like a different problem.
@thetech249, can you provide an export of your feed importer?
Comment #8
thetech249 CreditAttribution: thetech249 commentedHere is the export from feeds.
Comment #9
chilligroup CreditAttribution: chilligroup commentedsubscribe
Comment #10
Max1 CreditAttribution: Max1 commentedComment #11
a.gursoy CreditAttribution: a.gursoy commentedIs there any solution, same here too.
Comment #12
YanBoudreau CreditAttribution: YanBoudreau commentedI just solved this issue in my case.
I was trying all update combinations inside my procesor mapper settings. None of them where working with only 2 products while testing.
Running my import from the /import path was just getting me "SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry "
Drush was getting me much more details through a sandbox module for "drush feeds-import --feed-id=daily10000"
WD commerce_product: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry [error]
'100TUBES-CWBK-6H' for key 'sku': INSERT INTO {commerce_product} (revision_id, sku, title,
Why INSERT when I want to update?
Then I found this function by luck in FeedsCommerceProductProcessor.inc
protected function existingEntityId(
in it
$product_id = db_query("SELECT product_id FROM {commerce_product} WHERE sku
Then I thought about my Mapper
I noted that my XML file had a row called product_id, and I mapped it to the Mapper value product_id instead of my own field_product_id.
Bad move, in phpmyadmin, table commerce_product, I noted that product_id is an automated increasing # value
I may wrongly believe that Mapping data to product_id (me), entity_id (issuie creator), nid (#5) or revision_id is causing this 1062 error.
As soon as I deleted/modified this Mapper, everything started to update normally.
Comment #13
remory CreditAttribution: remory commentedI'm also having this issue -- 1062 Duplicate entry '557' for key 'vid'. I'm not using vid anywhere in my mappings, so not sure how this is happening.
Comment #14
MegaChriz CreditAttribution: MegaChriz as a volunteer commentednode_save()
does an insert when$node->is_new == TRUE
, even when$node->nid
is set. The node module does not check whether or not a node with that ID already exists. If it finds the "is_new" property, it tries to do an insert.After the insert, insert hooks are invoked:
hook_node_insert()
,hook_entity_insert()
andfield_attach_insert()
. The node object still has the "is_new" property during that phase. That property is removed after all insert hooks are invoked. So when a node object is saved within such an insert hook, the error reported in this issue will occur. Feeds doesn't save nodes from within such an insert hook. Therefore, I don't think this is a Feeds problem.Comment #15
iyyappan.govindSame thing here, I don't what to do? Is there any solution??
Comment #16
abrlam CreditAttribution: abrlam commentedI agree with @YanBoudreau (Comment #12) that you should review your mapping settings. Also, check your tamper settings too. I got the same error and when I reviewed the mapping and tamper settings, I noticed I was using Tamper PHP (which I had it disabled during the module upgrade) in one of the fields and that caused the Feeds to throw an error. The Feeds starts again (without error) as soon as I removed the PHP plugin in the tamper settings.
Comment #17
fab971 CreditAttribution: fab971 commentedI had the same issue. After 7 hours testing, downgrading, disabling some modules installed since the last time i used feeds and other thinks like that i found this article: https://www.drupal.org/node/1241042#comment-5276196 (that saved my day !).
I had a rule configured to act after saving node and when i disabled this rule everything run correctly.
Comment #18
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedI think my comment in #14 tells us the cause of the issue and that the problem is not in Feeds.
To debug it, search for modules that implement
hook_node_insert()
orhook_entity_insert()
. Temporary disable the code or the module to find where the problem starts and then try to find anode_save()
orentity_save()
call from there.Also, as said in #17, it could be a good idea to check your rules configurations for node save actions.
To find modules that implement
hook_node_insert()
orhook_entity_insert()
, you can use themodule_implements()
function:Setting this issue to "fixed" because I think there are enough answers here that should help in finding the culprit (and because the problem does not seem to be in Feeds).
Comment #19
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedAlso a good idea for debugging is to add a
debug_backtrace()
innode_save()
and log its output to a text file for example. The last debug output before the error occurs, is the one you want to inspect.Comment #21
pennywilerra CreditAttribution: pennywilerra commentedHow can i fix this problem
PDOException : SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'commerce_order-279-0-0-und' for key 'PRIMARY': INSERT INTO {field_data_commerce_order_total} (entity_type, entity_id, revision_id, bundle, delta, language, commerce_order_total_amount, commerce_order_total_currency_code, commerce_order_total_data) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8); Array ( [:db_insert_placeholder_0] => commerce_order [:db_insert_placeholder_1] => 279 [:db_insert_placeholder_2] => 5108 [:db_insert_placeholder_3] => commerce_order [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => EUR [:db_insert_placeholder_8] => a:1:{s:10:"components";a:1:{i:0;a:3:{s:4:"name";s:10:"base_price";s:5:"price";a:3:{s:6:"amount";i:0;s:13:"currency_code";s:3:"EUR";s:4:"data";a:0:{}}s:8:"included";b:1;}}} ) dans field_sql_storage_field_storage_write() (ligne 514 dans /home/linomatfr/public_html/modules/field/modules/field_sql_storage/field_sql_storage.module).
Comment #22
MegaChriz CreditAttribution: MegaChriz as a volunteer commented@pennywilerra
My first thought that this error is caused in a similar way as the original reported about nodes. A module reacting on the insert of a commerce order may be saving the commerce order again, triggering another insert. The field of 'commerce_order_total' is of type 'commerce_price'. What you perhaps could do is adding a
debug_backtrace()
incommerce_price_field_storage_pre_insert()
and log its output to a text file. Something like this:The last debug output before the error occurs could give you a hint on where stuff goes wrong.
Or, maybe even better, you could add a try-catch block around the query insert in
field_sql_storage_field_storage_write()
and add the debug_backtrace there.The extra insert could be caused by any module, so when you want to fix a problem like this, you have two options:
Sorry if I talk so much in code, not sure if you are a coder, but to effectively solve this problem I think you need to be a coder (or else know a coder that has access to your site and wants to solve the problem for you).
Comment #23
lule75 CreditAttribution: lule75 commentedIn my case it was Just as simple as mapping a node id to my value which had duplicates! thanks to #12
YanBoudreau’s detailed explanation, I got insight in my issue