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 »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Error importing users in Drupal
Pages: [1]

Author Topic: Error importing users in Drupal  (Read 4672 times)

Jorisvt

  • Guest
Error importing users in Drupal
May 02, 2007, 09:07:50 am
First I imported a large group of contacts in CiviCRM. That worked. Now I want to import them as a user in Drupal (5.1). I have the user import module installed and when I import from a .cvs file I get the error:

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 , contact_id , domain_id , email ) VALUES ( 12 ,  496 ,  1 , 'fake@email.com' )  [nativecode=1062 ** Duplicate entry '496' for key 3]
    [type] => db_error
    [user_info] => INSERT INTO civicrm_uf_match (uf_id , contact_id , domain_id , email ) VALUES ( 12 ,  496 ,  1 , 'fake@email.com' )  [nativecode=1062 ** Duplicate entry '496' for key 3]
    [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 , contact_id , domain_id , email ) VALUES ( 12 ,  496 ,  1 , 'fake@email.com' )  [nativecode=1062 ** Duplicate entry '496' for key 3]"]
)

This means CiviCRM cant import the user because of a duplicate entry.

How do I solve this? Please help? 

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Error importing users in Drupal
May 02, 2007, 09:21:22 am
Might be safer to import Drupal users first, synchronise them to contact records afterwards and import additional information to CiviCRM at the end.

However, it seems like the problem might have something to do with Drupal <-> CiviCRM synchronisation and it might potentially be a bug. Can you please file an issue (http://issues.civicrm.org/) with description of steps that led you to this error, attaching a small sample of csv data similar to what you were importing?

Thx,
m
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

Jorisvt

  • Guest
Re: Error importing users in Drupal
May 02, 2007, 10:22:55 am
What about disabling the CiviCRM module, import the users and turning the module back on. Is that a safe way to do it?

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Error importing users in Drupal
May 02, 2007, 02:28:57 pm
From the import point of view - I guess yes, but I'm not sure what would happen. From data integrity point of view - no, since I assume you want to have some kind of connection between Drupal user and CiviCRM contact record?

michau
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

Jorisvt

  • Guest
Re: Error importing users in Drupal
May 03, 2007, 05:22:52 am
Are the users in Drupal not automatically connected through their email address.

Look at this info http://wiki.civicrm.org/confluence/display/CRM/Creating+a+Drupal+user+for+every+CiviCRM+contact:
Quote
If a Drupal User registers before her details have been entered into CiviCRM, a new CiviCRM contact profile is created and matched with the Drupal User profile. If a Drupal User registers after her details have been entered in CiviCRM, the information in her CiviCRM contact is automatically associated with her Drupal User Profile. This is done through the primary email address

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Error importing users in Drupal
May 03, 2007, 05:50:29 am
The problem is that this excerpt from documentation describes the process that happens upon registration - and import is slightly different. I don't think we have the your case approached in the documentation, however it would be good to do something about it.

That's the reason why I asked you to report a bug - this way it will go under investigation and if it's an erratic behaviour, it will be fixed, if it's not, proper process will be described by person investigating the issue. Additionally, in both cases we'll have all the necessary information to create proper documentation entry.

michau
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

Jorisvt

  • Guest
Re: Error importing users in Drupal
May 03, 2007, 06:09:27 am
Further below that page (excerpt) is the exact process, that I followed, described. I read this before I decided to install CiviCRM. Allthough it is tested on an old version (1.2) of CiviCRM I hoped it would work.

I shall report it as a bug....

The correct order now for importing would be; import drupal users, sync (create) them to contacts and then import other infomation. But how can I import additional information for contacts in CiviCRM.

Michał Mach

  • Ask me questions
  • ****
  • Posts: 748
  • Karma: 59
    • CiviCRM site
  • CiviCRM version: latest
  • CMS version: Drupal and Joomla latest
  • MySQL version: numerous
  • PHP version: 5.3 and 5.2
Re: Error importing users in Drupal
May 03, 2007, 06:40:49 am
Ah, sorry - since there was 1.2 mentioned on top of the page, I didn't bother to read through the whole document and perhaps I should have. Than it looks like definitely a bug.

When importing, you can choose to update existing records with imported information - did you try that?

michau
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

My absolute favourite: Wordpress Integration!.

Donate Now!

Jorisvt

  • Guest
Re: Error importing users in Drupal
May 04, 2007, 06:26:22 am
I'm gonna try that...

Could it be that the bug in the new 1.7 version is resolved?
Maybe when I ugrade first the import will succeed.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Error importing users in Drupal

This forum was archived on 2017-11-26.