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 Profiles (Moderator: Dave Greenberg) »
  • Can't Create CiviCRM Profiles
Pages: [1]

Author Topic: Can't Create CiviCRM Profiles  (Read 1060 times)

DaveBagler

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
    • Dave Bagler
  • CiviCRM version: CiviCRM 3.x, 4.x
  • CMS version: Drupal 6.x, 7.x
  • MySQL version: MySQL 5
  • PHP version: PHP 5
Can't Create CiviCRM Profiles
June 20, 2012, 12:47:10 pm
Hi,
I have a new CiviCRM installation (4.1.3) using Drupal 7.  Everything seems to be working fine except that I can't create or edit profiles.  When creating a profile I receive the following error after hitting save:

Code: [Select]
Sorry. A non-recoverable error has occurred.
DB Error: constraint violation

Return to home page.

I've tried emptying my cache table, refreshing the sessions, and refreshing the back end.  Has anyone else run into this issue and have found a work around or who think might know the solution?

Thanks,
- Dave

Update 2012-06-21, here's the detailed error message:


Code: [Select]
Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`630312_db_civicrm`.`civicrm_uf_group`, CONSTRAINT `FK_civicrm_uf_group_created_id` FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL), 1452
Additional Details:

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

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_uf_group (is_active , title , help_pre , help_post , limit_listings_group_id , post_URL , add_to_group_id , add_captcha , is_map , is_edit_link , is_uf_link , is_update_dupe , cancel_URL , is_cms_user , notify , name , created_id , created_date , is_proximity_search ) VALUES ( 1 , 'Email Address Only' ,  NULL ,  NULL ,  2 , '/' ,  2 ,  0 ,  0 ,  0 ,  0 ,  0 , '/' ,  NULL , 'davebagler@gpo.ca' , 'Email_Address_Only' ,  1 ,  20120621165751 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`630312_db_civicrm`.`civicrm_uf_group`, CONSTRAINT `FK_civicrm_uf_group_created_id` FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_uf_group (is_active , title , help_pre , help_post , limit_listings_group_id , post_URL , add_to_group_id , add_captcha , is_map , is_edit_link , is_uf_link , is_update_dupe , cancel_URL , is_cms_user , notify , name , created_id , created_date , is_proximity_search ) VALUES ( 1 , 'Email Address Only' ,  NULL ,  NULL ,  2 , '/' ,  2 ,  0 ,  0 ,  0 ,  0 ,  0 , '/' ,  NULL , 'davebagler@gpo.ca' , 'Email_Address_Only' ,  1 ,  20120621165751 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`630312_db_civicrm`.`civicrm_uf_group`, CONSTRAINT `FK_civicrm_uf_group_created_id` FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_uf_group (is_active , title , help_pre , help_post , limit_listings_group_id , post_URL , add_to_group_id , add_captcha , is_map , is_edit_link , is_uf_link , is_update_dupe , cancel_URL , is_cms_user , notify , name , created_id , created_date , is_proximity_search ) VALUES ( 1 , 'Email Address Only' ,  NULL ,  NULL ,  2 , '/' ,  2 ,  0 ,  0 ,  0 ,  0 ,  0 , '/' ,  NULL , 'davebagler@gpo.ca' , 'Email_Address_Only' ,  1 ,  20120621165751 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`630312_db_civicrm`.`civicrm_uf_group`, CONSTRAINT `FK_civicrm_uf_group_created_id` FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL)]"])
« Last Edit: June 21, 2012, 02:00:40 pm by DaveBagler »

DaveBagler

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
    • Dave Bagler
  • CiviCRM version: CiviCRM 3.x, 4.x
  • CMS version: Drupal 6.x, 7.x
  • MySQL version: MySQL 5
  • PHP version: PHP 5
Re: Can't Create CiviCRM Profiles
June 21, 2012, 09:40:25 am
I've tried uninstalling and reinstalling CRM, but it didn't fix the issue.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Can't Create CiviCRM Profiles
June 21, 2012, 01:39:27 pm
Can you enable debugging and try again and post the details?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

DaveBagler

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
    • Dave Bagler
  • CiviCRM version: CiviCRM 3.x, 4.x
  • CMS version: Drupal 6.x, 7.x
  • MySQL version: MySQL 5
  • PHP version: PHP 5
Re: Can't Create CiviCRM Profiles
June 21, 2012, 01:59:21 pm
Sorry, thanks for the heads up, here's the detailed error message:

Code: [Select]
Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`630312_db_civicrm`.`civicrm_uf_group`, CONSTRAINT `FK_civicrm_uf_group_created_id` FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL), 1452
Additional Details:

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

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_uf_group (is_active , title , help_pre , help_post , limit_listings_group_id , post_URL , add_to_group_id , add_captcha , is_map , is_edit_link , is_uf_link , is_update_dupe , cancel_URL , is_cms_user , notify , name , created_id , created_date , is_proximity_search ) VALUES ( 1 , 'Email Address Only' ,  NULL ,  NULL ,  2 , '/' ,  2 ,  0 ,  0 ,  0 ,  0 ,  0 , '/' ,  NULL , 'davebagler@gpo.ca' , 'Email_Address_Only' ,  1 ,  20120621165751 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`630312_db_civicrm`.`civicrm_uf_group`, CONSTRAINT `FK_civicrm_uf_group_created_id` FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_uf_group (is_active , title , help_pre , help_post , limit_listings_group_id , post_URL , add_to_group_id , add_captcha , is_map , is_edit_link , is_uf_link , is_update_dupe , cancel_URL , is_cms_user , notify , name , created_id , created_date , is_proximity_search ) VALUES ( 1 , 'Email Address Only' ,  NULL ,  NULL ,  2 , '/' ,  2 ,  0 ,  0 ,  0 ,  0 ,  0 , '/' ,  NULL , 'davebagler@gpo.ca' , 'Email_Address_Only' ,  1 ,  20120621165751 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`630312_db_civicrm`.`civicrm_uf_group`, CONSTRAINT `FK_civicrm_uf_group_created_id` FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_uf_group (is_active , title , help_pre , help_post , limit_listings_group_id , post_URL , add_to_group_id , add_captcha , is_map , is_edit_link , is_uf_link , is_update_dupe , cancel_URL , is_cms_user , notify , name , created_id , created_date , is_proximity_search ) VALUES ( 1 , 'Email Address Only' ,  NULL ,  NULL ,  2 , '/' ,  2 ,  0 ,  0 ,  0 ,  0 ,  0 , '/' ,  NULL , 'davebagler@gpo.ca' , 'Email_Address_Only' ,  1 ,  20120621165751 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`630312_db_civicrm`.`civicrm_uf_group`, CONSTRAINT `FK_civicrm_uf_group_created_id` FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL)]"])

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Can't Create CiviCRM Profiles
June 21, 2012, 02:02:00 pm

can you log out and log back in

seems like its using a stale session or something

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

DaveBagler

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
    • Dave Bagler
  • CiviCRM version: CiviCRM 3.x, 4.x
  • CMS version: Drupal 6.x, 7.x
  • MySQL version: MySQL 5
  • PHP version: PHP 5
Re: Can't Create CiviCRM Profiles
June 21, 2012, 02:09:03 pm
Wow,
I was septicemic about that working as I had visited the URL that was supposed to refresh my sessions, and I was able to add groups, tags and contacts without issue, but it worked.

I should have thought of that, thanks Lobo!

And thanks Hershel for pointing me in the right direction.
« Last Edit: June 21, 2012, 02:14:34 pm by DaveBagler »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Can't Create CiviCRM Profiles

This forum was archived on 2017-11-26.