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) »
  • Problem with updating from 2.2.9 to 3.0.2
Pages: [1]

Author Topic: Problem with updating from 2.2.9 to 3.0.2  (Read 1604 times)

vshura

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 1
  • CiviCRM version: 4.6.0
  • CMS version: Wordpress 4.1.1
Problem with updating from 2.2.9 to 3.0.2
October 28, 2009, 03:03:29 pm
Hi all,

I'm having problems with upgrading from 2.2.9 to 3.0.2.  I suspect my database got a bit corrupt a while ago (somewhere around 2.2.5 or so) but I thought I had fixed it with a slight bit of sql editing.  But when 3.0.0 came out it didn't upgrade properly.

Since then I took the database, painstakingly checked the structure against a clean 2.2.9 install, and tried upgrading again.  This didn't work.  I then ran dbtools to check it and correct it, but while it identified and cleared up errors, when I tried to then upgrade there was still no joy.

The error message I'm getting when I try to upgrade it to 3.0.2 is this:

Code: [Select]
Sorry. A non-recoverable error has occurred.

DB Error: constraint violation

Database Error Code: Column 'option_group_id' cannot be null, 1048

and

Code: [Select]
Error Details:

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

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => -- Add New templates
    INSERT INTO civicrm_option_value
        (option_group_id, label, value, name, weight, description, is_active, component_id)
    VALUES
        (@option_group_id_report, 'Relationship Report', 'contact/relationship', 'CRM_Report_Form_Contact_Relationship', 23, 'Relationship Report', 1, NULL) [nativecode=1048 ** Column 'option_group_id' cannot be null]
    [type] => DB_Error
    [user_info] => -- Add New templates
    INSERT INTO civicrm_option_value
        (option_group_id, label, value, name, weight, description, is_active, component_id)
    VALUES
        (@option_group_id_report, 'Relationship Report', 'contact/relationship', 'CRM_Report_Form_Contact_Relationship', 23, 'Relationship Report', 1, NULL) [nativecode=1048 ** Column 'option_group_id' cannot be null]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="-- Add New templates
    INSERT INTO civicrm_option_value
        (option_group_id, label, value, name, weight, description, is_active, component_id)
    VALUES
        (@option_group_id_report, 'Relationship Report', 'contact/relationship', 'CRM_Report_Form_Contact_Relationship', 23, 'Relationship Report', 1, NULL) [nativecode=1048 ** Column 'option_group_id' cannot be null]"]
)

In the civicrm_option_value table, the definition of option_group_id is as follows:

Code: [Select]
`option_group_id` int(10) unsigned NOT NULL COMMENT 'Group which this option belongs to.',
I can't find any instance of option_group_id_report in the database, so I wonder if this is why there's a NULL value being put in, causing the error.  So the question might be why isn't this value there...

Any ideas?  Thanks in advance!

Sean.
[/code]

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: Problem with updating from 2.2.9 to 3.0.2
October 28, 2009, 04:24:36 pm

option_group_id_report is just a sql variable

which is defined in the upgrade files as

Code: [Select]
SELECT @option_group_id_report         := max(id) from civicrm_option_group where name = 'report_template';

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

vshura

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 1
  • CiviCRM version: 4.6.0
  • CMS version: Wordpress 4.1.1
Re: Problem with updating from 2.2.9 to 3.0.2
October 29, 2009, 05:27:18 am
Ok, thanks Donald.  What do you think causes the error then?

Sean.

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: Problem with updating from 2.2.9 to 3.0.2
October 29, 2009, 10:15:52 am

i suspect your database does not have an option group called 'report_template' and hence the error. that option group was introduced in 2.2.7

you might want to check:

CRM/Upgrade/Incremental/sql/2.2.7.mysql.tpl

and see what else might be missing

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

vshura

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 1
  • CiviCRM version: 4.6.0
  • CMS version: Wordpress 4.1.1
Re: Problem with updating from 2.2.9 to 3.0.2
October 29, 2009, 10:17:45 am
Great, thanks Donald.  Will do.

vshura

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 1
  • CiviCRM version: 4.6.0
  • CMS version: Wordpress 4.1.1
Re: Problem with updating from 2.2.9 to 3.0.2
November 03, 2009, 02:41:56 pm
Update: I went back and checked the database against a clean 2.2.6 install manually, upgraded ok to 2.2.9 and then 3.0.2, and everything's working ok, thankfully.

Thanks for all the help.

Sean.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Problem with updating from 2.2.9 to 3.0.2

This forum was archived on 2017-11-26.