D7.22, PHP 5.4, Rules 7.2.3
When enabling CA module I can't save node due:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '474-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] => 474 [: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 ) w node_access_write_grants() (line 3551 from /home/mysite/modules/node/node.module).
Patch from this issue didn't help.
Disabling CA module allows me to add new content without problem.
Comments
Comment #1
anybodySame problem here within ERPAL install profile, while creating an erpal-date node:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '159-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] => 159 [: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 ) in node_access_write_grants() (line 3551 of ......./erpal/modules/node/node.module).
Rules not installed!
Comment #2
heatherwoz commentedSame error, doesn't affect most nodes except for certain types that have rules called after creation. The rules trigger on Before saving content and After saving new content.
Comment #3
ivansf commentedI ran into the same error, I also had to disable custom rules for that content type in order to fix it.
Comment #4
matthewgann commentedSame error.
It comes after save when I run a rule to change a field's data.
Comment #5
matthewgann commentedThis core patch fixed the issue for me.
https://drupal.org/files/node-access-records-1146244-110.patch
Comment #6
cgdrupalkwk commented#5 worked for me! Thanks!!!!!!! I spent hours trying to figure this out.
Comment #7
Topcheese commented#5 also worked for me to solve the issue. @Grzegorz Zbiński, what mySQL version are you using?
Comment #8
massiws commentedSame issue here:
#5 fix the problem!
Thank you.
Comment #9
Anurag Ashok commented#5 fixes it for me too
Comment #10
krystlc commentedditto, this is still an issue for 7.24 but #5 works thankfully~
Comment #11
ergophobe commentedAs the patch referenced in #5 indicates, this is a duplicate of #1146244: node_access integrity constraint violation on module_invoke_all('node_' . $op, $node);
Comment #12
lajpatdhingra commentedI am not a coder. How to use #5?
Comment #13
massiws commented@lajpatdhingra:
- click on link in #5;
- save all in a file "patch.patch" in [your_drupal_site]/modules/node/node.module folder;
- read this guide and follow your preferred method.