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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Cannot delete or update a parent row
Pages: [1]

Author Topic: Cannot delete or update a parent row  (Read 1332 times)

rfenwick

  • I’m new here
  • *
  • Posts: 20
  • Karma: 1
Cannot delete or update a parent row
December 28, 2010, 06:03:15 am
I have just moved a live CiviCRM installation from one VPS to another, following the migration steps as closely as possible. 

The reason for the move was that the hosting co, while providing support for something else, installed a set of buggy MySQL 5.1 client libraries which severely limited a lot of command line functionality - for eg executing the SQL command USE 'dbname' would result in 'there is an error in your SQL syntax'

This meant that using tools like mysqldump for the migration was impossible.  Thankfully, PHP appeared to be using a working older MySQL 5.0 library, so I was able to use phpMyAdmin's SQL Export functionality to retrieve the database. I again used phpMyAdmin on the new server to recreate the database, tables, structure, and data.

So far, after a day's use, everything appears to be fine (contacts can be created, updated, participants registered at events etc) except for one thing. Attempting to delete a mailing in CiviMAIL results in the error:

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

       
Code: [Select]
=> -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => DELETE FROM civicrm_mailing  WHERE (  civicrm_mailing.id = 15 )  [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`ace-crm`.`civicrm_mailing_job`, CONSTRAINT `parent_id` FOREIGN KEY (`parent_id`) REFERENCES `civicrm_mailing_job` (`id`))]
    [type] => DB_Error
    [user_info] => DELETE FROM civicrm_mailing  WHERE (  civicrm_mailing.id = 15 )  [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`ace-crm`.`civicrm_mailing_job`, CONSTRAINT `parent_id` FOREIGN KEY (`parent_id`) REFERENCES `civicrm_mailing_job` (`id`))]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="DELETE FROM civicrm_mailing  WHERE (  civicrm_mailing.id = 15 )  [nativecode=1451 ** Cannot delete or update a parent row: a foreign key constraint fails (`ace-crm`.`civicrm_mailing_job`, CONSTRAINT `parent_id` FOREIGN KEY (`parent_id`) REFERENCES `civicrm_mailing_job` (`id`))]"]
)

Do you think this is a bug in 3.3.1, or an indication that something is more widely structurally wrong in the database?

Thanks for your help

Robin

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: Cannot delete or update a parent row
December 28, 2010, 08:22:20 am

This is a bug and has already been fixed in 3.3.2

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

rfenwick

  • I’m new here
  • *
  • Posts: 20
  • Karma: 1
Re: Cannot delete or update a parent row
December 28, 2010, 11:42:25 am
That's a great relief, thanks Donald. Is there a way I could have found that out without posting to the forum? I spent a fair bit of time on Google!

Mny thanks,

Robin

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: Cannot delete or update a parent row
December 28, 2010, 02:50:37 pm

we did file an issue but it was a bit cryptic and more specific to the root cause of the bug

http://issues.civicrm.org/jira/browse/CRM-7197

in future, u should ask on IRC to reduce search time :) u might get a faster answer

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Cannot delete or update a parent row

This forum was archived on 2017-11-26.