1

This question already has an answer here:

I've been getting an error when I try and upgrade my database to CiviCRM 4.7.7 I've upgraded civi a few times, this is the first time I have a problem I can't solve when upgrading the database. I followed the directions here: https://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+Drupal+7 Hoping someone can help!

This is the error that I get when trying to upgrading my database from 4.6.x to 4.7.7:

drush civicrm-upgrade-db
PEAR_Exception: "DB Error: not found"
 * ERROR TYPE: DB_Error
 * ERROR CODE: -4
 * ERROR MESSAGE: DB Error: not found
 * ERROR MODE: 16
 * ERROR USERINFO: ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_schedule_mapping_id` [nativecode=1091 ** Can't DROP 'FK_civicrm_action_schedule_mapping_id'; check that column/key exists]
 * ERROR DEBUGINFO: ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_schedule_mapping_id` [nativecode=1091 ** Can't DROP 'FK_civicrm_action_schedule_mapping_id'; check that column/key exists]
#0 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#1 /usr/share/drupal7/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#2 /usr/share/drupal7/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: not found", -4, 16, (Array:2), "ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...")
#3 /usr/share/drupal7/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-4, 16, (Array:2), "ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...")
#4 /usr/share/drupal7/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -4, NULL, NULL, "ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...", "DB_Error", TRUE)
#5 /usr/share/drupal7/modules/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-4, NULL, NULL, NULL, "1091 ** Can't DROP 'FK_civicrm_action_schedule_mapping_id'; check that column...")
#6 /usr/share/drupal7/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#7 /usr/share/drupal7/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...")
#8 /usr/share/drupal7/modules/civicrm/CRM/Utils/File.php(332): DB_common->query("ALTER TABLE `civicrm_action_schedule` DROP FOREIGN KEY `FK_civicrm_action_sch...")
#9 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Form.php(196): CRM_Utils_File::sourceSQLFile("mysql://root:asdf@localhost/civicrm?new_link=true", "-- Add new columns for multilingual purpose\nALTER TABLE `civicrm_action_sche...", NULL, TRUE)
#10 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Form.php(387): CRM_Upgrade_Form->source("-- Add new columns for multilingual purpose\nALTER TABLE `civicrm_action_sche...", TRUE)
#11 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Form.php(421): CRM_Upgrade_Form->processLocales("/usr/share/drupal7/modules/civicrm/CRM/Upgrade/Incremental/sql/4.7.alpha1.mys...", "4.7.alpha1")
#12 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Incremental/Base.php(80): CRM_Upgrade_Form->processSQL("4.7.alpha1")
#13 [internal function](): CRM_Upgrade_Incremental_Base::runSql(Object(CRM_Queue_TaskContext), "4.7.alpha1")
#14 /usr/share/drupal7/modules/civicrm/CRM/Queue/Task.php(88): call_user_func_array((Array:2), (Array:2))
#15 /usr/share/drupal7/modules/civicrm/CRM/Queue/Runner.php(214): CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))
#16 /usr/share/drupal7/modules/civicrm/CRM/Queue/Runner.php(168): CRM_Queue_Runner->runNext()
#17 /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Headless.php(67): CRM_Queue_Runner->runAll()
#18 /usr/share/drupal7/modules/civicrm/drupal/drush/civicrm.drush.inc(707): CRM_Upgrade_Headless->run()
#19 [internal function](): drush_civicrm_upgrade_db()
#20 /usr/share/php/drush/includes/command.inc(334): call_user_func_array("drush_civicrm_upgrade_db", (Array:0))
#21 /usr/share/php/drush/includes/command.inc(208): _drush_invoke_hooks("civicrm-upgrade-db", (Array:0), "civicrm")
#22 [internal function](): drush_command()
#23 /usr/share/php/drush/includes/command.inc(175): call_user_func_array("drush_command", (Array:0))
#24 /usr/share/php/drush/drush.php(92): drush_dispatch((Array:27))
#25 /usr/share/php/drush/drush.php(61): _drush_bootstrap_and_dispatch()
#26 /usr/share/php/drush/drush.php(16): drush_main()
#27 {main}
WD php: PEAR_Exception: DB Error: not found in CRM_Core_Error::exceptionHandler() (line 913 of                                      [error]
/usr/share/drupal7/modules/civicrm/CRM/Core/Error.php).
Cannot modify header information - headers already sent by (output started at                                                       [warning]
/usr/share/drupal7/modules/civicrm/CRM/Upgrade/Headless.php:72) bootstrap.inc:1232
PEAR_Exception: DB Error: not found in CRM_Core_Error::exceptionHandler() (line 913 of /usr/share/drupal7/modules/civicrm/CRM/Core/Error.php).
Drush command terminated abnormally due to an unrecoverable error.                                                                  [error]

marked as duplicate by Jon G - Megaphone Tech, petednz - fuzion, Xavier, William Mortada, Joe Murray May 17 '16 at 14:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.