This may be a duplicate of this issue. This error is only occurring when ACL module is enabled.

Steps to reproduce the problem:

  1. Add new Rule:
    1. Add new condition:
      1. Set condition to add to "content is of type"
      2. Set value to any type, "basic page" works as a test
    2. Add new action:
      1. Set action to add to "set a data value"
      2. Set data selector to anything, "node:title" works as a test.
      3. Set value to anything, "test" works as a test.
  2. Add content of type "basic page", or whichever type you used in the prior steps.

Error message:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '526-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] => 526 [: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 3392 of /webdir/modules/node/node.module).

Comments

Peter Bex’s picture

Component: Rules Core » Rules Engine
Status: Active » Closed (duplicate)

Looks more like a duplicate of #1146248: Integrity constraint violation at node_access when saving a node on node insert to me (which might indeed have the same underlying cause as the one you linked to), which is related to core #1146244: node_access integrity constraint violation on module_invoke_all('node_' . $op, $node);.

The rule's event trigger is what matters, not the condition or action. Please reopen if you think it's a different issue after all.