2

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}
5

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.