Answers.Body: <p>This issue is logged here:  <a href="https://issues.civicrm.org/jira/browse/CRM-16234">https://issues.civicrm.org/jira/browse/CRM-16234</a>
  The fix is implemented in this PR: <a href="https://github.com/civicrm/civicrm-core/pull/5645">https://github.com/civicrm/civicrm-core/pull/5645</a></p>
  
  <p>You can apply the fix now, CiviCRM 4.6.3 will have this included.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-06T16:55:04.177Z
Answers.Text: I had a feeling Kevin would be the guy to ask.
Answers.UserDisplayName: universalhandle
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-07T17:45:24.700Z
Answers.Text: You are the man Kevin! I will test the patch and confirm
Answers.UserDisplayName: Christopher Mosure
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-07T19:37:28.243Z
Answers.Text: Patch works. Cheers.
Answers.UserDisplayName: Christopher Mosure
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-06T16:25:27.423Z
Answers.LastActivityDate: 2015-05-06T16:25:27.423Z
Answers.UserDisplayName: Kevin Cristiano
Body: <p><strong>SUMMARY:</strong>
  I am using CiviCRM 4.6.2 on WordPress 4.2.1 for a membership sign and renewal site and keep hitting this wall on this <em>DB Error: already exists</em> related to user registration on a membership contribution page.</p>
  
  <p>It's worth noting that this is a relatively fresh install with no contacts (besides the administrative account and the membership organization contact), authorize.net set up and some custom fields added via a custom profile (the profile forces user registration). </p>
  
  <p><strong>Here is the log and backtrace: (email removed..)</strong></p>
  
  <pre><code>May 06 15:28:46  [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 ,  2 , 'email@example.com' ,  4 )  [nativecode=1062 ** Duplicate entry 'email@example.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 ,  2 , 'email@example.com' ,  4 )  [nativecode=1062 ** Duplicate entry 'email@example.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 ,  2 , 'email@example.com' ,  4 )  [nativecode=1062 ** Duplicate entry 'email@example.com-1' for key 'UI_uf_name_domain_id']"]
  )
  
  
  May 06 15:28:46  [info] $backTrace = #0 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(235): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
  #2 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
  #3 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(976): PEAR_Error-&gt;PEAR_Error("DB Error: already exists", -5, 16, (Array:2), "INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
  #4 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error-&gt;DB_Error(-5, 16, (Array:2), "INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
  #5 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR-&gt;raiseError(NULL, -5, NULL, NULL, "INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...", "DB_Error", TRUE)
  #6 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(899): DB_common-&gt;raiseError(-5, NULL, NULL, NULL, "1062 ** Duplicate entry 'email@example.com-1' for key 'UI_uf_name_domain_id'")
  #7 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(328): DB_mysql-&gt;mysqlRaiseError()
  #8 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql-&gt;simpleQuery("INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
  #9 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2442): DB_common-&gt;query("INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
  #10 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1060): DB_DataObject-&gt;_query("INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
  #11 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(450): DB_DataObject-&gt;insert()
  #12 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/UFMatch.php(56): CRM_Core_DAO-&gt;save()
  #13 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CMSUser.php(247): CRM_Core_BAO_UFMatch::create((Array:3))
  #14 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/Contribution/Utils.php(478): CRM_Core_BAO_CMSUser::create((Array:53), "email-5")
  #15 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1526): CRM_Contribute_BAO_Contribution_Utils::createCMSUser((Array:53), "4", "email-5")
  #16 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/Contribution/Utils.php(120): CRM_Contribute_Form_Contribution_Confirm::processContribution(Object(CRM_Contribute_Form_Contribution_Confirm), (Array:53), NULL, "4", Object(CRM_Financial_DAO_FinancialType), TRUE, TRUE, FALSE, (Array:1))
  #17 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php(1338): CRM_Contribute_BAO_Contribution_Utils::processConfirm(Object(CRM_Contribute_Form_Contribution_Confirm), (Array:53), (Array:33), "4", "2", "membership", (Array:0), FALSE, TRUE)
  #18 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1903): CRM_Member_BAO_Membership::postProcessMembership((Array:47), "4", Object(CRM_Contribute_Form_Contribution_Confirm), (Array:33), (Array:0), (Array:0), (Array:11), (Array:1), TRUE, NULL, FALSE, "2", (Array:0), TRUE)
  #19 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1019): CRM_Contribute_Form_Contribution_Confirm-&gt;processMembership((Array:47), "4", (Array:0), (Array:0), (Array:33), (Array:0), TRUE)
  #20 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(345): CRM_Contribute_Form_Contribution_Confirm-&gt;postProcess()
  #21 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(164): CRM_Core_Form-&gt;mainProcess()
  #22 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine-&gt;perform(Object(CRM_Contribute_Form_Contribution_Confirm), "next", "Next")
  #23 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next-&gt;perform(Object(CRM_Contribute_Form_Contribution_Confirm), "next")
  #24 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller-&gt;handle(Object(CRM_Contribute_Form_Contribution_Confirm), "next")
  #25 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page-&gt;handle("next")
  #26 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller-&gt;run((Array:3), NULL)
  #27 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:15))
  #28 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
  #29 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm.php(1133): CRM_Core_Invoke::invoke((Array:3))
  #30 /home/cac2member/public_html/wp-content/plugins/civicrm/includes/civicrm.basepage.php(134): CiviCRM_For_WordPress-&gt;invoke()
  #31 [internal function](): CiviCRM_For_WordPress_Basepage-&gt;basepage_handler(Object(WP))
  #32 /home/cac2member/public_html/wp-includes/plugin.php(571): call_user_func_array((Array:2), (Array:1))
  #33 /home/cac2member/public_html/wp-includes/class-wp.php(622): do_action_ref_array("wp", (Array:1))
  #34 /home/cac2member/public_html/wp-includes/functions.php(877): WP-&gt;main("")
  #35 /home/cac2member/public_html/wp-blog-header.php(14): wp()
  #36 /home/cac2member/public_html/index.php(17): require("/home/cac2member/public_html/wp-blog-header.php")
  #37 {main}
  </code></pre>
  
Tags: <wordpress><contribution-page><user-account>
Title: WordPress user account registration issues using membership contribution page
ThreadText: # WordPress user account registration issues using membership contribution page
  
  (Asked by: username_0 on 2015-05-06)
  
  **SUMMARY:**
  I am using CiviCRM 4.6.2 on WordPress 4.2.1 for a membership sign and renewal site and keep hitting this wall on this *DB Error: already exists* related to user registration on a membership contribution page.
  
  It's worth noting that this is a relatively fresh install with no contacts (besides the administrative account and the membership organization contact), authorize.net set up and some custom fields added via a custom profile (the profile forces user registration).
  
  **Here is the log and backtrace: (email removed..)**
  
  ```
  May 06 15:28:46  [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 ,  2 , 'email@example.com' ,  4 )  [nativecode=1062 ** Duplicate entry 'email@example.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 ,  2 , 'email@example.com' ,  4 )  [nativecode=1062 ** Duplicate entry 'email@example.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 ,  2 , 'email@example.com' ,  4 )  [nativecode=1062 ** Duplicate entry 'email@example.com-1' for key 'UI_uf_name_domain_id']"]
  )
  
  May 06 15:28:46  [info] $backTrace = #0 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(235): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
  #2 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
  #3 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: already exists", -5, 16, (Array:2), "INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
  #4 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-5, 16, (Array:2), "INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
  #5 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -5, NULL, NULL, "INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...", "DB_Error", TRUE)
  #6 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(899): DB_common->raiseError(-5, NULL, NULL, NULL, "1062 ** Duplicate entry 'email@example.com-1' for key 'UI_uf_name_domain_id'")
  #7 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
  #8 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
  #9 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2442): DB_common->query("INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
  #10 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1060): DB_DataObject->_query("INSERT INTO civicrm_uf_match (domain_id , uf_id , uf_name , contact_id ) VALU...")
  #11 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(450): DB_DataObject->insert()
  #12 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/UFMatch.php(56): CRM_Core_DAO->save()
  #13 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CMSUser.php(247): CRM_Core_BAO_UFMatch::create((Array:3))
  #14 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/Contribution/Utils.php(478): CRM_Core_BAO_CMSUser::create((Array:53), "email-5")
  #15 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1526): CRM_Contribute_BAO_Contribution_Utils::createCMSUser((Array:53), "4", "email-5")
  #16 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/Contribution/Utils.php(120): CRM_Contribute_Form_Contribution_Confirm::processContribution(Object(CRM_Contribute_Form_Contribution_Confirm), (Array:53), NULL, "4", Object(CRM_Financial_DAO_FinancialType), TRUE, TRUE, FALSE, (Array:1))
  #17 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Member/BAO/Membership.php(1338): CRM_Contribute_BAO_Contribution_Utils::processConfirm(Object(CRM_Contribute_Form_Contribution_Confirm), (Array:53), (Array:33), "4", "2", "membership", (Array:0), FALSE, TRUE)
  #18 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1903): CRM_Member_BAO_Membership::postProcessMembership((Array:47), "4", Object(CRM_Contribute_Form_Contribution_Confirm), (Array:33), (Array:0), (Array:0), (Array:11), (Array:1), TRUE, NULL, FALSE, "2", (Array:0), TRUE)
  #19 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contribute/Form/Contribution/Confirm.php(1019): CRM_Contribute_Form_Contribution_Confirm->processMembership((Array:47), "4", (Array:0), (Array:0), (Array:33), (Array:0), TRUE)
  #20 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(345): CRM_Contribute_Form_Contribution_Confirm->postProcess()
  #21 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(164): CRM_Core_Form->mainProcess()
  #22 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Contribute_Form_Contribution_Confirm), "next", "Next")
  #23 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Contribute_Form_Contribution_Confirm), "next")
  #24 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contribute_Form_Contribution_Confirm), "next")
  #25 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page->handle("next")
  #26 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller->run((Array:3), NULL)
  #27 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:15))
  #28 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
  #29 /home/cac2member/public_html/wp-content/plugins/civicrm/civicrm.php(1133): CRM_Core_Invoke::invoke((Array:3))
  #30 /home/cac2member/public_html/wp-content/plugins/civicrm/includes/civicrm.basepage.php(134): CiviCRM_For_WordPress->invoke()
  #31 [internal function](): CiviCRM_For_WordPress_Basepage->basepage_handler(Object(WP))
  #32 /home/cac2member/public_html/wp-includes/plugin.php(571): call_user_func_array((Array:2), (Array:1))
  #33 /home/cac2member/public_html/wp-includes/class-wp.php(622): do_action_ref_array("wp", (Array:1))
  #34 /home/cac2member/public_html/wp-includes/functions.php(877): WP->main("")
  #35 /home/cac2member/public_html/wp-blog-header.php(14): wp()
  #36 /home/cac2member/public_html/index.php(17): require("/home/cac2member/public_html/wp-blog-header.php")
  #37 {main}
  
  ```
  
  **Tags:** wordpress, contribution-page, user-account
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-05-06. Score: 5 | Accepted answer
  
  This issue is logged here: <https://issues.civicrm.org/jira/browse/CRM-16234>
  The fix is implemented in this PR: <https://github.com/civicrm/civicrm-core/pull/5645>
  
  You can apply the fix now, CiviCRM 4.6.3 will have this included.
  
  > **Comments:**
  > **username_2**: I had a feeling username_1 would be the guy to ask.  
  > **username_0**: You are the man username_1! I will test the patch and confirm  
  > **username_0**: Patch works. Cheers.  
  
  ---
  
  