I have field in content type called field_new_author which is User reference field.

I need to make a Rule to change Node author field to match value in field_new_author.
I tryed this solution: https://drupal.stackexchange.com/questions/43936/change-node-author-on-node-save-with-rules#comment45083_43940

But I'm getting database error:
<code>
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4141-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] => 4141 [: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 3440 of /home2/test/modules/node/node.module).</code>

I also tryed different setups in Rules but could not find anything that would work.