I'm on civi 4.6.2, with Drupal 7

I have a contribution page which is a contribution on behalf of an organisation, and also creates a user account for the website. I'm getting the error below on submit. Some searching suggests truncating the civicrm_uf_match table - but if I do that will the link between all the Drupal accounts on my site and their CiviCRM profiles be broken?

Thank you!


Sorry but we are not able to provide this at the moment. DB Error: already exists Error Details Database Error Code: Duplicate entry 'rfenwick@googlemail.com-1' for key 'UI_uf_name_domain_id', 1062 Additional 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 ,  702 , 'rfenwick@googlemail.com' ,  7582 )  [nativecode=1062 ** Duplicate entry 'rfenwick@googlemail.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 ,  702 , 'rfenwick@googlemail.com' ,  7582 )  [nativecode=1062 ** Duplicate entry 'rfenwick@googlemail.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 ,  702 , 'rfenwick@googlemail.com' ,  7582 )  [nativecode=1062 ** Duplicate entry 'rfenwick@googlemail.com-1' for key 'UI_uf_name_domain_id']"]

) Return to home page.


It means you a trying to create a new account with an email that is already in use for another account.

Some CMS (drupal at least!?) don't allow two separate accounts with the same email, hence the (rather not too explicit) error message.

The simple solution is either to change the existing account so it uses another email address or create the new account with an email that isn't used already.

The not so simple but would be awesome for your karma solution is to contribute a patch to display an "end user friendly" error message and the option to put another email in the form if its invalid


  • 1
    Hi Xavier - that isn't it unfortunately. If you try and use an email that already exists, you get a friendly error saying "The email address xyz@acenterprises.org.uk is already registered." - this error is only happening when you try to create a genuinely new user :( – Robin Fenwick May 25 '15 at 13:13
  • Are you sure rfenwick@googlemail.com isn't connected to ANY account in your civi? – Xavier May 25 '15 at 13:34

There is a previously created entry in the table with rfenwick@googlemail.com**-1** as the uf_name, which is normally the same as the Drupal account email. Could you check using phpMyAdmin or mysql from the command line for other entries in this field:

SELECT * FROM civicrm_uf_match WHERE uf_name like '%-1';

In some other parts of CiviCRM one sometimes sees '-1' added to a machine name field that needs to be unique if the key being inserted is the same as an existing entry. Perhaps there is a bug in here somewhere doing the same (surprising since this functionality is so well used).

Could you delete any entries with -1, then try again with a new email. You might want to review at Contact > Find and Merge Duplicate Contacts, that the Unsupervised rule for Individual contacts is reasonable and will catch any problems with the contacts that will be created using your Contribution form.


This issue is recently fixed in civicrm later version 4.6.3 and here's the fix https://github.com/civicrm/civicrm-core/pull/5645/files


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.