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) »
  • Upgrade from 4.2.8 to 4.3.3 fails on CREATE TRIGGER error
Pages: [1]

Author Topic: Upgrade from 4.2.8 to 4.3.3 fails on CREATE TRIGGER error  (Read 859 times)

rjlang

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 1
  • CiviCRM version: 4.2.8
  • CMS version: Drupal 6
  • MySQL version: 5.0.77
  • PHP version: 5.3.19
Upgrade from 4.2.8 to 4.3.3 fails on CREATE TRIGGER error
May 13, 2013, 07:09:46 pm
Using Drupal 7. In migrating from 4.2.8 to 4.3.3, after disabling civicrm module, replacing the codebase (and running drush updatedb to pick up any updates), we re-enable the civicrm module via drush, and at that point, an error is generated. The CiviCRM log entry is below.

Any idea what the problem is? A missing column, evidently, but no idea where it went missing. We've been using CiviCRM for quite some time so it's gone through several iterations of upgrades.

Code: [Select]
May 13 20:55:11  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -19
    [message] => DB Error: no such field
    [mode] => 16
    [debug_info] => CREATE TRIGGER civicrm_contact_before_insert before insert ON civicrm_contact FOR EACH ROW BEGIN 
SET NEW.created_date = CURRENT_TIMESTAMP;
 END [nativecode=1054 ** Unknown column 'created_date' in 'NEW']
    [type] => DB_Error
    [user_info] => CREATE TRIGGER civicrm_contact_before_insert before insert ON civicrm_contact FOR EACH ROW BEGIN 
SET NEW.created_date = CURRENT_TIMESTAMP;
 END [nativecode=1054 ** Unknown column 'created_date' in 'NEW']
    [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="CREATE TRIGGER civicrm_contact_before_insert before insert ON civicrm_contact FOR EACH ROW BEGIN 
SET NEW.created_date = CURRENT_TIMESTAMP;
 END [nativecode=1054 ** Unknown column 'created_date' in 'NEW']"]
)


May 13 20:55:11  [info] $backTrace =
#0 /mysite/sites/all/modules/civicrm/CRM/Core/Error.php(196): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /mysite/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /mysite/sites/all/modules/civicrm/packages/DB.php(969): PEAR_Error->PEAR_Error("DB Error: no such field", -19, 16, (Array:2), "CREATE TRIGGER civicrm_contact_before_insert before insert ON civicrm_contact...")
#4 /mysite/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-19, 16, (Array:2), "CREATE TRIGGER civicrm_contact_before_insert before insert ON civicrm_contact...")
#5 /mysite/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -19, NULL, NULL, "CREATE TRIGGER civicrm_contact_before_insert before insert ON civicrm_contact...", "DB_Error", TRUE)
#6 /mysite/sites/all/modules/civicrm/packages/DB/mysql.php(898): DB_common->raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'created_date' in 'NEW'")
#7 /mysite/sites/all/modules/civicrm/packages/DB/mysql.php(327): DB_mysql->mysqlRaiseError()
#8 /mysite/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("CREATE TRIGGER civicrm_contact_before_insert before insert ON civicrm_contact...")
#9 /mysite/sites/all/modules/civicrm/packages/DB/DataObject.php(2421): DB_common->query("CREATE TRIGGER civicrm_contact_before_insert before insert ON civicrm_contact...")
#10 /mysite/sites/all/modules/civicrm/packages/DB/DataObject.php(1613): DB_DataObject->_query("CREATE TRIGGER civicrm_contact_before_insert before insert ON civicrm_contact...")
#11 /mysite/sites/all/modules/civicrm/CRM/Core/DAO.php(155): DB_DataObject->query("CREATE TRIGGER civicrm_contact_before_insert before insert ON civicrm_contact...")
#12 /mysite/sites/all/modules/civicrm/CRM/Core/DAO.php(917): CRM_Core_DAO->query("CREATE TRIGGER civicrm_contact_before_insert before insert ON civicrm_contact...", FALSE)
#13 /mysite/sites/all/modules/civicrm/CRM/Core/DAO.php(1683): CRM_Core_DAO::executeQuery("CREATE TRIGGER civicrm_contact_before_insert before insert ON civicrm_contact...", (Array:0), TRUE, NULL, FALSE, FALSE)
#14 /mysite/sites/all/modules/civicrm/CRM/Core/DAO.php(1563): CRM_Core_DAO::createTriggers((Array:6))
#15 /mysite/sites/all/modules/civicrm/CRM/Core/Invoke.php(469): CRM_Core_DAO::triggerRebuild()
#16 /mysite/sites/all/modules/civicrm/drupal/civicrm.module(1167): CRM_Core_Invoke::rebuildMenuAndCaches(TRUE)
#17 [internal function](): civicrm_modules_enabled((Array:1))
#18 /mysite/includes/module.inc(857): call_user_func_array("civicrm_modules_enabled", (Array:1))
#19 /mysite/includes/module.inc(499): module_invoke_all("modules_enabled", (Array:1))
#20 /usr/lib/php/drush/commands/core/drupal/environment.inc(115): module_enable((Array:1))
#21 /usr/lib/php/drush/commands/pm/pm.drush.inc(904): drush_module_enable((Array:1))
#22 [internal function](): drush_pm_enable("civicrm")
#23 /usr/lib/php/drush/includes/command.inc(324): call_user_func_array("drush_pm_enable", (Array:1))
#24 /usr/lib/php/drush/includes/command.inc(198): _drush_invoke_hooks("pm-enable", (Array:1), "pm")
#25 [internal function](): drush_command("civicrm")
#26 /usr/lib/php/drush/includes/command.inc(165): call_user_func_array("drush_command", (Array:1))
#27 /usr/lib/php/drush/drush.php(92): drush_dispatch((Array:27))
#28 /usr/lib/php/drush/drush.php(61): _drush_bootstrap_and_dispatch()
#29 /usr/lib/php/drush/drush.php(16): drush_main()
#30 {main}

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Upgrade from 4.2.8 to 4.3.3 fails on CREATE TRIGGER error
May 13, 2013, 08:29:47 pm
See http://forum.civicrm.org/index.php?topic=28736
Try asking your question on the new CiviCRM help site.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Upgrade from 4.2.8 to 4.3.3 fails on CREATE TRIGGER error
May 13, 2013, 08:31:14 pm
Most likely your problem is not as complex as theirs, I suspect you just need to upgrade your version of MySQL. Looks like yours doesn't meet the minimum requirements.
Try asking your question on the new CiviCRM help site.

rjlang

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 1
  • CiviCRM version: 4.2.8
  • CMS version: Drupal 6
  • MySQL version: 5.0.77
  • PHP version: 5.3.19
Re: Upgrade from 4.2.8 to 4.3.3 fails on CREATE TRIGGER error
May 14, 2013, 11:54:19 am
thanks, Coleman, your reply #1 provided the needed missing information. Problem was trying to do the code upgrade with the CiviCRM module disabled; re-enabling it (to make /civicrm/upgrade&reset=1 available) was throwing the error because the db needed the upgrade to have already happened in order to do all the stuff that happens at enabling. So the solution was simply to leave the module enabled, replace the code, THEN run /upgrade (actually drush cvupdb, in our case), and all is working.

Thanks,

Robert

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Upgrade from 4.2.8 to 4.3.3 fails on CREATE TRIGGER error
May 14, 2013, 12:31:27 pm
Ah, missed that part of your description. Yes the civicrm module must be enabled if it is going to run its upgrades.
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Upgrade from 4.2.8 to 4.3.3 fails on CREATE TRIGGER error

This forum was archived on 2017-11-26.