Answers.Body: <p>It means you a trying to create a new account with an email that is already in use for another account.</p>
  
  <p>Some CMS (drupal at least!?) don't allow two separate accounts with the same email, hence the (rather not too explicit) error message. </p>
  
  <p>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.</p>
  
  <p>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</p>
  
  <p>X+</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-25T13:13:02.573Z
Answers.Text: 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 :(
Answers.UserDisplayName: Robin Fenwick
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-25T13:34:00.170Z
Answers.Text: Are you sure rfenwick@googlemail.com isn't connected to ANY account in your civi?
Answers.UserDisplayName: Xavier
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-25T12:48:14.123Z
Answers.LastActivityDate: 2015-05-25T12:48:14.123Z
Answers.UserDisplayName: Xavier
Answers.Body: <p>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:</p>
  
  <pre><code>SELECT * FROM civicrm_uf_match WHERE uf_name like '%-1';
  </code></pre>
  
  <p>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).</p>
  
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-25T14:56:01.107Z
Answers.LastActivityDate: 2015-05-25T14:56:01.107Z
Answers.UserDisplayName: Joe Murray
Answers.Body: <p>This issue is recently fixed in civicrm later version 4.6.3 and here's the fix <a href="https://github.com/civicrm/civicrm-core/pull/5645/files" rel="nofollow">https://github.com/civicrm/civicrm-core/pull/5645/files</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-21T07:44:59.433Z
Answers.LastActivityDate: 2015-07-21T07:44:59.433Z
Answers.UserDisplayName: Monish Deb
Body: <p>I'm on civi 4.6.2, with Drupal 7</p>
  
  <p>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?</p>
  
  <p>Thank you!</p>
  
  <p>Robin</p>
  
  <p>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
          )</p>
  
  <pre><code>[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 ,  702 , 'rfenwick@googlemail.com' ,  7582 )  [nativecode=1062 ** Duplicate entry 'rfenwick@googlemail.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 ,  702 , 'rfenwick@googlemail.com' ,  7582 )  [nativecode=1062 ** Duplicate entry 'rfenwick@googlemail.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 ,  702 , 'rfenwick@googlemail.com' ,  7582 )  [nativecode=1062 ** Duplicate entry 'rfenwick@googlemail.com-1' for key 'UI_uf_name_domain_id']"]
  </code></pre>
  
  <p>)
  Return to home page.</p>
  
Tags: <civicontribute>
Title: DB error: already exists on contribute page
ThreadText: # DB error: already exists on contribute page
  
  (Asked by: username_0 on 2015-05-25)
  
  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!
  
  username_0
  
  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.
  
  **Tags:** civicontribute
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2015-05-25. Score: 2
  
  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
  
  X+
  
  > **Comments:**
  > **username_0**: Hi username_1 - 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 :(  
  > **username_1**: Are you sure rfenwick@googlemail.com isn't connected to ANY account in your civi?  
  
  ---
  
  ### Answer by username_2 on 2015-05-25. Score: 1
  
  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.
  
  
  ---
  
  ### Answer by username_3 on 2015-07-21. Score: 0
  
  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>
  
  
  ---
  
  