0

During any event registration while the user is not logged in (i.e., if they are a new user) produces the following error. After doing a bunch of research, the consensus seemed to be that the issue was fixed in an earlier version of CiviCRM. I upgraded Civi to the most recent version to no avail. Here are the following steps I have taken:

  1. Cleared Cache
  2. Disabled every extension
  3. Disabled any custom module using civicrm
  4. Upgraded CiviCRM to the most recent version
  5. Restarted the entire server, upgraded the server (Probably unnecessary but figured I would since I was already there).

It appears to work fine if the user is already logged in.

CiviCRM: 5.50.1
Drupal: 9.3.16
Ubuntu: 20.04
PHP: 7.4.30
Server version: Apache/2.4.54 (Ubuntu)
MariaDB: 10.3.34

[error]  $Fatal Error Details = array:3 [   "message" => "DB Error: already exists"   "code" => null   "exception" => PEAR_Exception {#15678
    #cause: DB_Error {#15680
      +error_message_prefix: ""
      +mode: 16
      +level: 1024
      +code: -5
      +message: "DB Error: already exists"
      +userinfo: "INSERT INTO `civicrm_uf_match` (`domain_id` , `uf_id` , `uf_name` , `contact_id` ) VALUES ( 1 ,  1529 , 'awdawd@awdawd.com' ,  12102 )  [nativecode=1062 ** Duplicate entry 'awdawd@awdawd.com-1' for key 'UI_uf_name_domain_id']"
      +backtrace: array:41 [
        0 => array:6 [
          "file" => "/var/www/website.org/vendor/pear/db/DB.php"
          "line" => 997
          "function" => "__construct"
          "class" => "PEAR_Error"
          "type" => "->"
          "args" => array:5 [
            0 => "DB Error: already exists"
            1 => -5
            2 => 16
            3 => array:2 [
              0 => "CRM_Core_Error"
              1 => "exceptionHandler"
            ]
            4 => "INSERT INTO `civicrm_uf_match` (`domain_id` , `uf_id` , `uf_name` , `contact_id` ) VALUES ( 1 ,  1529 , 'awdawd@awdawd.com' ,  12102 )  [nativecode=1062 ** Duplicate entry 'awdawd@awdawd.com-1' for key 'UI_uf_name_domain_id']"
          ]
        ]

Any help would be greatly appreciated. Thank you!

1 Answer 1

3

Did you recently migrated from D7 to D9? If so please do the following below

  1. Log in as Admin into your website.
  2. Navigate to CiviCRM >> Contacts >> Find and Merge Duplicate Contacts.
  3. Check if the Unsupervised Individual rule is set to email only, if not create a new Unsupervised Individual rule with email only and make a not of old unsupervised rule.
  4. Take the site offline(maintenance mode ON).
  5. Log out from the website.
  6. Log in to mysql via phpmyadmin or terminal and run the truncate table command. TRUNCATE TABLE civicrm_uf_match;
  7. Log in as Admin into your website.
  8. Navigate to CiviCRM >> Administer >> Users and Permissions >> Synchronize Users to Contacts
  9. Click 'Ok' button.
  10. Take the site online(maintenance mode OFF).

HTH

Pradeep

1
  • Thank you for the detailed answer. I am concerned and a bit hesitant to truncate the uf match table as I have a lot of users, some of whom share an email (i.e., significant others, business partners, etc) and I do not want to lose their accounts / mismatch records.
    – Greyson
    Jun 16 at 20:08

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.