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) »
  • DB Error: constraint violation
Pages: [1]

Author Topic: DB Error: constraint violation  (Read 1368 times)

bstalcup

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla!
  • MySQL version: 5.5.36-cll-lve
  • PHP version: 5.3.29
DB Error: constraint violation
June 20, 2013, 01:43:03 pm
Hello,

When upgrading our site (version 4.2.9) to 4.3.4, we encountered an error when running the upgrade script for the database.  I have attached the screen of the error when it occurred.  I'm not sure what the problem is, any and all help would be greatly appreciated.

Thanks.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB Error: constraint violation
June 21, 2013, 05:06:13 am
Looks like a Contact was deleted but his dashboard settings record was not deleted. You would need SQL skills to fix this I think. :(

But for someone who has such, it's not hard. :)
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.

bstalcup

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla!
  • MySQL version: 5.5.36-cll-lve
  • PHP version: 5.3.29
Re: DB Error: constraint violation
June 21, 2013, 05:57:40 am
Any ideas on how one would begin to fix this?  What tables would be the ones of interest when searching for the problem?


Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB Error: constraint violation
June 21, 2013, 06:01:35 am
The civicrm_dashboard_contact table appears to have values in the contact_id column which do not appear in the id column of the civicrm_contact table. I'm not positive, but that's what it looks like.
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.

bstalcup

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla!
  • MySQL version: 5.5.36-cll-lve
  • PHP version: 5.3.29
Re: DB Error: constraint violation
June 21, 2013, 06:03:05 am
Alright, I will take a look at it and get back to you.  Thanks so much!

bstalcup

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla!
  • MySQL version: 5.5.36-cll-lve
  • PHP version: 5.3.29
Re: DB Error: constraint violation
June 21, 2013, 06:36:56 am
Alright so I went through and found all of the contact_id values in civicrm_dashboard_contact which did not correspond to a contact's id in civicrm_contact.  Now it appears my database is "partially upgraded." how should I proceed?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: DB Error: constraint violation
June 21, 2013, 06:45:33 am
Your DB is partially upgraded and it's quite hard to continue. You need to restore the full DB from a backup (first drop all tables and then restore) and then run the full upgrade again.
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.

bstalcup

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
  • CiviCRM version: 4.7.3
  • CMS version: Joomla!
  • MySQL version: 5.5.36-cll-lve
  • PHP version: 5.3.29
Re: DB Error: constraint violation
June 21, 2013, 08:00:06 am
Alright, thanks so much.  We got it taken care of.  Your help is greatly appreciated!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • DB Error: constraint violation

This forum was archived on 2017-11-26.