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) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.7 Release Testing »
  • DB Error on update to Civi 4.7
Pages: [1]

Author Topic: DB Error on update to Civi 4.7  (Read 1556 times)

ichi

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.31
  • MySQL version: 5.5.41-0+wheezy1
  • PHP version: 5.4.4-14+deb7u14
DB Error on update to Civi 4.7
January 27, 2016, 09:08:58 pm
Hello,

when updating Civi on Drupal 7.41 from CiviCRM 4.6.11 to CiviCRM 4.7, I encounter this fatal error :
CiviCRM_API3_Exception: DB Error: no such field in civicrm_api3() (line 45 of /home/site.com/public_html/sites/all/modules/civicrm/api/api.php).

Should the drush command drush updb be applied on Civi update before logging into the site ?

Best.
Ichi
« Last Edit: January 27, 2016, 09:10:30 pm by ichi »

mattallard

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.6.7
  • CMS version: 7.32-1+deb8u4build0.15.04.1
  • MySQL version: 5.6.25-0ubuntu0.15.04.1
  • PHP version: 5.6.4+dfsg-4ubuntu6.2
Re: DB Error on update to Civi 4.7
January 27, 2016, 09:17:43 pm
I am encountering an error as well from civicrm 4.6.11 on drupal 7.38-1 running the database upgrade script to 4.7

CiviCRM Upgrade Tasks
[Error: Upgrade DB to 4.7.alpha1: SQL]
Error Field   Error Value
Type   DB_Error
Code   -4
Message   DB Error: not found
Mode   16
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]
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]
PEAR_Exception: DB Error: not found in unknown on line unknown
- DB_Error: DB Error: not found in unknown on line unknown
Exception trace
#   Function   Location
0   CRM_Core_Error::exceptionHandler(Object(DB_Error))   unknown:unknown
1   call_user_func(Array, Object(DB_Error))   /usr/share/drupal7/modules/civicrm/packages/PEAR.php:931
2   PEAR_Error->PEAR_Error('DB Error: not fo…', -4, 16, Array, 'ALTER TABLE `civ…')   /usr/share/drupal7/modules/civicrm/packages/DB.php:976
3   DB_Error->DB_Error(-4, 16, Array, 'ALTER TABLE `civ…')   /usr/share/drupal7/modules/civicrm/packages/PEAR.php:564
4   PEAR->raiseError(null, -4, null, null, 'ALTER TABLE `civ…', 'DB_Error', true)   /usr/share/drupal7/modules/civicrm/packages/DB/common.php:1905
5   DB_common->raiseError(-4, null, null, null, '1091 ** Can't DR…')   /usr/share/drupal7/modules/civicrm/packages/DB/mysql.php:895
6   DB_mysql->mysqlRaiseError()   /usr/share/drupal7/modules/civicrm/packages/DB/mysql.php:328
7   DB_mysql->simpleQuery('ALTER TABLE `civ…')   /usr/share/drupal7/modules/civicrm/packages/DB/common.php:1216
8   DB_common->query('ALTER TABLE `civ…')   /usr/share/drupal7/modules/civicrm/CRM/Utils/File.php:321
9   CRM_Utils_File::sourceSQLFile('mysql://root:asd…', '-- Add new colum…', null, true)   /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Form.php:196
10   CRM_Upgrade_Form->source('-- Add new colum…', true)   /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Form.php:387
11   CRM_Upgrade_Form->processLocales('/usr/share/drupa…', '4.7.alpha1')   /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Form.php:421
12   CRM_Upgrade_Form->processSQL('4.7.alpha1')   /usr/share/drupal7/modules/civicrm/CRM/Upgrade/Incremental/Base.php:80
13   CRM_Upgrade_Incremental_Base::runSql(Object(CRM_Queue_TaskContext), '4.7.alpha1')   unknown:unknown
14   call_user_func_array(Array, Array)   /usr/share/drupal7/modules/civicrm/CRM/Queue/Task.php:88
15   CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))   /usr/share/drupal7/modules/civicrm/CRM/Queue/Runner.php:214
16   CRM_Queue_Runner->runNext(true)   /usr/share/drupal7/modules/civicrm/CRM/Queue/Page/AJAX.php:52
17   CRM_Queue_Page_AJAX::{closure}()   /usr/share/drupal7/modules/civicrm/CRM/Queue/ErrorPolicy.php:106
18   CRM_Queue_ErrorPolicy->call(Object(Closure))   /usr/share/drupal7/modules/civicrm/CRM/Queue/Page/AJAX.php:54
19   CRM_Queue_Page_AJAX::runNext()   unknown:unknown
20   call_user_func(Array)   /usr/share/drupal7/modules/civicrm/CRM/Core/Invoke.php:278
21   CRM_Core_Invoke::runItem(Array)   /usr/share/drupal7/modules/civicrm/CRM/Core/Invoke.php:86
22   CRM_Core_Invoke::_invoke(Array)   /usr/share/drupal7/modules/civicrm/CRM/Core/Invoke.php:54
23   CRM_Core_Invoke::invoke(Array)   /usr/share/drupal7/modules/civicrm/drupal/civicrm.module:454
24   civicrm_invoke('upgrade', 'queue', 'ajax', 'runNext')   unknown:unknown
25   call_user_func_array('civicrm_invoke', Array)   /usr/share/drupal7/includes/menu.inc:519
26   menu_execute_active_handler()   /usr/share/drupal7/index.php:21
27   {main}   

ichi

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.31
  • MySQL version: 5.5.41-0+wheezy1
  • PHP version: 5.4.4-14+deb7u14
Re: DB Error on update to Civi 4.7
January 27, 2016, 09:35:20 pm
The status of Drupal indicate :

Error
Database updates   Out of date
Some modules have database schema updates to install. You should run the database update script immediately.


When on updating the dabs via drush :

drush updb
 Civicrm  7401  Trigger cache clear to pick up TZ handling change from CRM-6877.
Do you wish to run all pending updates? (y/n): y
Performed update: civicrm_update_7401                                                                                                   [ok]
'all' cache was cleared.                                                                                                                [success]
Finished performing updates. 
               

But still : CiviCRM_API3_Exception: DB Error: no such field in civicrm_api3()         

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: DB Error on update to Civi 4.7
January 28, 2016, 06:14:57 am
ichi - drush updb only updates the drupal database.
To update the civi database, run the command drush cvupdb.
Try asking your question on the new CiviCRM help site.

ichi

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.31
  • MySQL version: 5.5.41-0+wheezy1
  • PHP version: 5.4.4-14+deb7u14
Re: DB Error on update to Civi 4.7
January 28, 2016, 01:37:00 pm
Thanks Coleman
I didn't know. Then I did run the command drush cvupdb.

Before I had the message :
messageCiviCRM_API3_Exception: DB Error: no such field in civicrm_api3() (line 45 of /home/photocontact/public_html/sites/all/modules/civicrm/api/api.php).

Then after some –long– time I had the following feed-back :

Upgrade outputs:
CiviCRM now includes the easy-to-use CKEditor Configurator. To customize
the features and display of your wysiwyg editor, visit the Display
Preferences [1] page. Learn more... [2]

Default version of the following System Workflow Message Templates have
been modified:

   * Personal Campaign Pages - Owner Notification

 If you have modified these templates, please review the new default
versions and implement updates as needed to your copies (Administer >
Communications > Message Templates > System Workflow Messages).

The custom fatal error template setting has been removed.

Links:
------
[1] http://default/civicrm/admin/setting/preferences/display?reset=1
[2] https://civicrm.org/blogs/colemanw/big-changes-wysiwyg-editing-47


Then : perfect !
The site works and it is powered by CiviCRM 4.7.0.

Thanks so much Coleman.

hajush

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 4.6
  • CMS version: Drupal6.35 + WordPress4.2.2
  • MySQL version: 5.1.56
  • PHP version: 5.4.37
Re: DB Error on update to Civi 4.7
September 05, 2016, 04:13:51 pm
I seem to be getting the same error upgrading CiviCRM 4.6.20 to 4.7.10, on Drupal 7.50.

[Error: Upgrade DB to 4.7.alpha1: SQL]
Error Field   Error Value
Type   DB_Error
Code   -4
Message   DB Error: not found
Mode   16
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]
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]

I've tried this several times. My Drupal database updates are all executed. Before running the upgrade, the civicrm_action_schedule table has an INDEX with the name, FK_civicrm_action_schedule_mapping_id. But when I execute SQL to list all foreign key constraints, there are none. I don't know if this makes a difference, but the table is empty. I don't have any rows in civicrm_action_schedule.

What could I be missing here? Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.7 Release Testing »
  • DB Error on update to Civi 4.7

This forum was archived on 2017-11-26.