Answers.Body: <p>Maybe, you should check the profile settings, make sure you check the below input which updates the existing contact if profile finds a duplicate match -</p>
  
  <p><a href="https://i.sstatic.net/lj8kP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lj8kP.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-01T08:03:50.083Z
Answers.Text: Thanks for the suggestion but I already have done that. (I forgot to mention it in my post).
Answers.UserDisplayName: Evan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-01T06:08:28.337Z
Answers.LastActivityDate: 2018-03-01T06:08:28.337Z
Answers.UserDisplayName: jitendra - fuzion
Answers.Body: <p>That second error suggests that all may not be well with the DB</p>
  
  <blockquote>
    <p>Table 'our_database.civicrm_action_log' doesn't exist.</p>
  </blockquote>
  
  <p>Also if I read your Q right, could there be an issue if you are creating WP Users via the Profile too if there is already a civi contact AND a WP user? I don't know WP but it may be worth testing if you have a different outcome if</p>
  
  <p>a/ there is a civi contact but no WP user, and a form is submitted that 'matches' the civi contact</p>
  
  <p>b/ there is a civi contact with a WP user, and a form is submitted that 'matches' the civi contact</p>
  
  <p>c/ WP users are set 'off' for the profile and there is an existing matching civi contact but no WP user, and a form is submitted that 'matches' the civi contact</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-09T09:53:24.483Z
Answers.Text: Thanks. The missing table is odd. And like you said there's something wrong which is probably making my moving between staging/live sites a complete mess and currently impossible.
  
  I did test it similar to your suggestions - one thing to note is this only happens when there's no linked WP user:
  a) Failed merge
  b)Failed merge
  c) Haven't tested
  
  I appreciate the response but I've put this issue aside to find better ways to tackle the bigger problems like missing tables and cleaning the switching of servers/testing sites... Aye.
Answers.UserDisplayName: Evan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-29T00:57:49.327Z
Answers.Text: Hi @evan , did you solve this issue? I'm experiencing right now a pretty similar scenery and can´t figure a solution. Any help would be appreciated. Thanks!
Answers.UserDisplayName: jmaureiram
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-29T05:56:25.973Z
Answers.Text: don. unless yours is identical, and given this is > 3 y. old, i would open a new Question and reference this one, and of course add all the detail possible to help folk help you
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-03-22T18:47:54.783Z
Answers.LastActivityDate: 2018-03-22T18:47:54.783Z
Answers.UserDisplayName: petednz - fuzion
Body: <p>Running: CiviCRM 4.7.17, WordPress 4.9.4</p>
  
  <p>When an anonymous visitor tries to register for an event, we have them required to sign in or create an account via Civi's profile settings to keep our existing contact information to be relevant.</p>
  
  <ul>
  <li>The profile used in the event requires a WP account</li>
  <li>Duplicate Civi contact matching is set to merge with an existing contact in the profile's settings</li>
  <li>I've only tried with pay later option (is there a way to use the test digital payment without being signed in? I the test option limits the test to certain users which have to be signed in to try it).</li>
  <li>Existing users who sign-in don't receive the error</li>
  </ul>
  
  <p>The anonymous user enters creates a new WP account, as required. When the user enters the name and email which matches an existing contact in Civi, they are thrown the following, <em>DB Error: already exists</em> instead of the intended confirmation and contact merge. </p>
  
  <p>CiviCRM/WP seems to:</p>
  
  <ul>
  <li>create a new contact based on their name and email instead of merging new details with the existing contact.</li>
  <li>Payment (Pay later) and event registration is recorded under the existing contact.</li>
  <li>Send out 2 new WP user emails. One has the username and email, <em>the second is blank</em>.</li>
  </ul>
  
  <p>I've tried poking around but no results. Suggestions?</p>
  
  <pre><code>[info] $Fatal Error Details = Array (
      [callback] =&gt; Array
          (
              [0] =&gt; CRM_Core_Error
              [1] =&gt; handle
          )
  
      [code] =&gt; -5
      [message] =&gt; DB Error: already exists
      [mode] =&gt; 16
      [debug_info] =&gt; INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  44 , 'test@email.com' ,  1353 )  [nativecode=1062 ** Duplicate entry 'test@email.com-1' for key 'UI_uf_name_domain_id']
      [type] =&gt; DB_Error
      [user_info] =&gt; INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  44 , 'test@email.com' ,  1353 )  [nativecode=1062 ** Duplicate entry 'test@email.com-1' for key 'UI_uf_name_domain_id']
      [to_string] =&gt; [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  44 , 'test@email.com' ,  1353 )  [nativecode=1062 ** Duplicate entry 'test@email.com-1' for key 'UI_uf_name_domain_id']"] )
  </code></pre>
  
  <p>Update: Trying to merge the duplicate contacts made (one with name and email - another with the full profile details) returns a different DB error:</p>
  
  <pre><code>    [info] $Fatal Error Details = Array
  (
      [callback] =&gt; Array
          (
              [0] =&gt; CRM_Core_Error
              [1] =&gt; handle
          )
  
      [code] =&gt; -18
      [message] =&gt; DB Error: no such table
      [mode] =&gt; 16
      [debug_info] =&gt; UPDATE IGNORE civicrm_action_log SET contact_id = 1353 WHERE contact_id = 1415 [nativecode=1146 ** Table 'our_database.civicrm_action_log' doesn't exist]
      [type] =&gt; DB_Error
      [user_info] =&gt; UPDATE IGNORE civicrm_action_log SET contact_id = 1353 WHERE contact_id = 1415 [nativecode=1146 ** Table 'our_databse.civicrm_action_log' doesn't exist]
      [to_string] =&gt; [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE IGNORE civicrm_action_log SET contact_id = 1353 WHERE contact_id = 1415 [nativecode=1146 ** Table 'our_databse.civicrm_action_log' doesn't exist]"]
  )
  </code></pre>
  
Tags: <wordpress><civievent><database>
Title: Contacts not merged When creating Account on Event Page - DB Error: already exists
ThreadText: # Contacts not merged When creating Account on Event Page - DB Error: already exists
  
  (Asked by: username_0 on 2018-02-28)
  
  Running: CiviCRM 4.7.17, WordPress 4.9.4
  When an anonymous visitor tries to register for an event, we have them required to sign in or create an account via Civi's profile settings to keep our existing contact information to be relevant.
  
  The profile used in the event requires a WP account
  Duplicate Civi contact matching is set to merge with an existing contact in the profile's settings
  I've only tried with pay later option (is there a way to use the test digital payment without being signed in? I the test option limits the test to certain users which have to be signed in to try it).
  Existing users who sign-in don't receive the error
  
  The anonymous user enters creates a new WP account, as required. When the user enters the name and email which matches an existing contact in Civi, they are thrown the following, DB Error: already exists instead of the intended confirmation and contact merge. 
  CiviCRM/WP seems to:
  
  create a new contact based on their name and email instead of merging new details with the existing contact.
  Payment (Pay later) and event registration is recorded under the existing contact.
  Send out 2 new WP user emails. One has the username and email, the second is blank.
  
  I've tried poking around but no results. Suggestions?
  [info] $Fatal Error Details = Array (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              [1] => handle
          )
  
      [code] => -5
      [message] => DB Error: already exists
      [mode] => 16
      [debug_info] => INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  44 , 'test@email.com' ,  1353 )  [nativecode=1062 ** Duplicate entry 'test@email.com-1' for key 'UI_uf_name_domain_id']
      [type] => DB_Error
      [user_info] => INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  44 , 'test@email.com' ,  1353 )  [nativecode=1062 ** Duplicate entry 'test@email.com-1' for key 'UI_uf_name_domain_id']
      [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALUES ( 1 ,  44 , 'test@email.com' ,  1353 )  [nativecode=1062 ** Duplicate entry 'test@email.com-1' for key 'UI_uf_name_domain_id']"] )
  
  Update: Trying to merge the duplicate contacts made (one with name and email - another with the full profile details) returns a different DB error:
      [info] $Fatal Error Details = Array
  (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              [1] => handle
          )
  
      [code] => -18
      [message] => DB Error: no such table
      [mode] => 16
      [debug_info] => UPDATE IGNORE civicrm_action_log SET contact_id = 1353 WHERE contact_id = 1415 [nativecode=1146 ** Table 'our_database.civicrm_action_log' doesn't exist]
      [type] => DB_Error
      [user_info] => UPDATE IGNORE civicrm_action_log SET contact_id = 1353 WHERE contact_id = 1415 [nativecode=1146 ** Table 'our_databse.civicrm_action_log' doesn't exist]
      [to_string] => [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE IGNORE civicrm_action_log SET contact_id = 1353 WHERE contact_id = 1415 [nativecode=1146 ** Table 'our_databse.civicrm_action_log' doesn't exist]"]
  )
  
  **Tags:** wordpress, civievent, database
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-03-01. Score: 2
  
  Maybe, you should check the profile settings, make sure you check the below input which updates the existing contact if profile finds a duplicate match -
  
  [![enter image description here](https://i.sstatic.net/lj8kP.png)](https://i.sstatic.net/lj8kP.png)
  
  > **Comments:**
  > **username_0**: Thanks for the suggestion but I already have done that. (I forgot to mention it in my post).  
  
  ---
  
  ### Answer by username_2 on 2018-03-22. Score: 1
  
  That second error suggests that all may not be well with the DB
  
  > Table 'our\_database.civicrm\_action\_log' doesn't exist.
  
  Also if I read your Q right, could there be an issue if you are creating WP Users via the Profile too if there is already a civi contact AND a WP user? I don't know WP but it may be worth testing if you have a different outcome if
  
  a/ there is a civi contact but no WP user, and a form is submitted that 'matches' the civi contact
  
  b/ there is a civi contact with a WP user, and a form is submitted that 'matches' the civi contact
  
  c/ WP users are set 'off' for the profile and there is an existing matching civi contact but no WP user, and a form is submitted that 'matches' the civi contact
  
  > **Comments:**
  > **username_0**: Thanks. The missing table is odd. And like you said there's something wrong which is probably making my moving between staging/live sites a complete mess and currently impossible.  I did test it similar to your suggestions - one thing to note is this only happens when there's no linked WP user: a) Failed merge b)Failed merge c) Haven't tested  I appreciate the response but I've put this issue aside to find better ways to tackle the bigger problems like missing tables and cleaning the switching of servers/testing sites... Aye.  
  > **username_3**: Hi @evan , did you solve this issue? I'm experiencing right now a pretty similar scenery and can´t figure a solution. Any help would be appreciated. Thanks!  
  > **username_2**: don. unless yours is identical, and given this is > 3 y. old, i would open a new Question and reference this one, and of course add all the detail possible to help folk help you  
  
  ---
  
  