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 CiviContribute (Moderator: Donald Lobo) »
  • db error when trying to create pcp * solved *
Pages: [1]

Author Topic: db error when trying to create pcp * solved *  (Read 342 times)

lesley

  • I post occasionally
  • **
  • Posts: 64
  • Karma: 1
db error when trying to create pcp * solved *
February 16, 2014, 07:23:20 am
getting the following when saving  personal campaign page.
used same supporter profile as on demo site
works ok if already logged in so is it a permissions thing?

Solved: Found that civicrm-acl table only had 6 rows (as opposed to about 65 originally) don't know how this happened but restored from backup and all is groovy

leaving this in case it helps anyone else



Sorry but we are not able to provide this at the moment.

--------------------------------------------------------------------------------

DB Error: constraint violation


 Error Details


Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`conserva_civi2`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE), 1452

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

       
Code: [Select]
=> -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] =>
INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation )
SELECT      0 as user_id, contact_a.id as contact_id, 'View' as operation
          FROM civicrm_contact contact_a
WHERE     ( 1 )  AND (contact_a.is_deleted = 0)
GROUP BY contact_a.id
ON DUPLICATE KEY UPDATE
         user_id=VALUES(user_id),
         contact_id=VALUES(contact_id),
         operation=VALUES(operation) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`conserva_civi2`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] =>
INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation )
SELECT      0 as user_id, contact_a.id as contact_id, 'View' as operation
          FROM civicrm_contact contact_a
WHERE     ( 1 )  AND (contact_a.is_deleted = 0)
GROUP BY contact_a.id
ON DUPLICATE KEY UPDATE
         user_id=VALUES(user_id),
         contact_id=VALUES(contact_id),
         operation=VALUES(operation) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`conserva_civi2`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="
INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation )
SELECT      0 as user_id, contact_a.id as contact_id, 'View' as operation
          FROM civicrm_contact contact_a
WHERE     ( 1 )  AND (contact_a.is_deleted = 0)
GROUP BY contact_a.id
ON DUPLICATE KEY UPDATE
         user_id=VALUES(user_id),
         contact_id=VALUES(contact_id),
         operation=VALUES(operation) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`conserva_civi2`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]
)



 Return to home page.
 
« Last Edit: February 16, 2014, 09:55:13 pm by lesley »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • db error when trying to create pcp * solved *

This forum was archived on 2017-11-26.