CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Duplicate e-mail error adding a Drupal user
Pages: [1]

Author Topic: Duplicate e-mail error adding a Drupal user  (Read 4336 times)

alexlyn

  • Guest
Duplicate e-mail error adding a Drupal user
July 29, 2008, 09:40:15 pm
In a case where there is a CiviCRM contact for a member, but no corresponding Drupal user, users get the following error trying to create a Drupal user account:

Sorry. A non-recoverable error has occurred.

Database Error Code: Duplicate entry 'useremail@verizon.net-1' for key 4, 1062

Return to home page.

Error Details:


Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -5
    [message] => DB Error: already exists
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_uf_match (uf_id , uf_name , contact_id , domain_id ) VALUES ( 471 , 'useremail@verizon.net' ,  1181 ,  1 )  [nativecode=1062 ** Duplicate entry 'useremail@verizon.net-1' for key 4]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_uf_match (uf_id , uf_name , contact_id , domain_id ) VALUES ( 471 , 'useremail@verizon.net' ,  1181 ,  1 )  [nativecode=1062 ** Duplicate entry 'useremail@verizon.net-1' for key 4]
    [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 (uf_id , uf_name , contact_id , domain_id ) VALUES ( 471 , 'useremail@verizon.net' ,  1181 ,  1 )  [nativecode=1062 ** Duplicate entry 'useremail@verizon.net-1' for key 4]"]
)

Some additional background...

The site is running Drupal 5.7 and CiviCRM 2.03.

There are two custom profiles for capturing additional information.

The behavior I am expecting is for Drupal to create the user account, then associate it with the appropriate CiviCRM contact based on matching e-mail addresses.

Can anyone help me out?

Thanks,
Alex.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Duplicate e-mail error adding a Drupal user
July 29, 2008, 10:53:56 pm
Generally this error means that there is already a Drupal user with the same email address. I think we've made a fix for 2.1 to handle this better.
Protect your investment in CiviCRM by  becoming a Member!

alexlyn

  • Guest
Re: Duplicate e-mail error adding a Drupal user
July 30, 2008, 08:51:54 am
Dave, I appreciate your help...

I checked the Drupal users table and there is just one user with the e-mail address in question.

However, there is a record with that e-mail address in CiviCRM's civicrm_uf_match table. I'm not sure if I am interpreting the meaning of the columns correctly, but the uf_id value is different from the Drupal user ID. For other accounts, this field matches.

Is my interpretation correct? Is there any harm in deleting the offending record in civicrm_uf_match?

Alex.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Duplicate e-mail error adding a Drupal user
July 30, 2008, 09:41:51 am
You can delete that record - it will get recreated when that user logs in.

However, I'm not sure I understand the sequence of events.... Your original post I think implies that a new user is registering and entering 'useremail@verizon.net' as their email address - which would cause a problem if "there is already a user w/ that email address" ??
Protect your investment in CiviCRM by  becoming a Member!

alexlyn

  • Guest
Re: Duplicate e-mail error adding a Drupal user
July 30, 2008, 09:51:43 am
i'm not sure of the full sequence of events either. The end user tried to create the account a few times, then other administrators deleted the account and also attempted to re-create it.

So I guess the follow-on question is: What happens when Drupal users are deleted if they are linked to CiviCRM contacts?  Is the link automatically deleted too?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Duplicate e-mail error adding a Drupal user
July 30, 2008, 10:05:34 am
Expected behavior is that the entry in uf_match for that user -> contact linkage is deleted. The civicrm_contact record and all other CiviCRM records related to that contact are not modified.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Duplicate e-mail error adding a Drupal user

This forum was archived on 2017-11-26.