3

this morning I started encountering database issues - the only thing I can think of is the upgrade to 5.9 that we did yesterday.

First discovery was the Cron error - via log.

    Jan 17 10:15:02  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => TRUNCATE TABLE civicrm_acl_contact_cache [nativecode=1932 ** Table 'tarabnyc_wordpress.civicrm_acl_contact_cache' doesn't exist in engine]
    [type] => DB_Error
    [user_info] => TRUNCATE TABLE civicrm_acl_contact_cache [nativecode=1932 ** Table 'tarabnyc_wordpress.civicrm_acl_contact_cache' doesn't exist in engine]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="TRUNCATE TABLE civicrm_acl_contact_cache [nativecode=1932 ** Table 'tarabnyc_wordpress.civicrm_acl_contact_cache' doesn't exist in engine]"]
)


    Jan 17 10:15:02  [info] $backTrace = #0 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(232): CRM_Core_Error::backtrace("backTrace", TRUE)
    #1 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error))
    #2 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "TRUNCATE TABLE civicrm_acl_contact_cache [nativecode=1932 ** Table 'tarabnyc_...")
    #3 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "TRUNCATE TABLE civicrm_acl_contact_cache [nativecode=1932 ** Table 'tarabnyc_...")
    #4 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "TRUNCATE TABLE civicrm_acl_contact_cache [nativecode=1932 ** Table 'tarabnyc_...", "DB_Error", TRUE)
    #5 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1907): PEAR->__call("raiseError", (Array:7))
    #6 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, "TRUNCATE TABLE civicrm_acl_contact_cache [nativecode=1932 ** Table 'tarabnyc_...", "1932 ** Table 'tarabnyc_wordpress.civicrm_acl_contact_cache' doesn't exist in...")
    #7 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
    #8 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("TRUNCATE TABLE civicrm_acl_contact_cache")
    #9 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2415): DB_common->query("TRUNCATE TABLE civicrm_acl_contact_cache")
    #10 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1607): DB_DataObject->_query("TRUNCATE TABLE civicrm_acl_contact_cache")
    #11 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(438): DB_DataObject->query("TRUNCATE TABLE civicrm_acl_contact_cache")
    #12 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1490): CRM_Core_DAO->query("TRUNCATE TABLE civicrm_acl_contact_cache", TRUE)
    #13 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/ACL/BAO/Cache.php(168): CRM_Core_DAO::singleValueQuery("TRUNCATE TABLE civicrm_acl_contact_cache")
    #14 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Contact/Utils.php(926): CRM_ACL_BAO_Cache::resetCache()
    #15 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.class.php(116): CRM_Contact_BAO_Contact_Utils::clearContactCaches()
    #16 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php(32): civicrm_cli->callApi()
    #17 {main}

Then the backtrace when trying to do anything.

pubic_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(190): CRM_Core_Error::backtrace()
#1 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error))
#2 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "TRUNCATE TABLE civicrm_acl_contact_cache [nativecode=1932 ** Table 'tarabnyc_...")
#3 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "TRUNCATE TABLE civicrm_acl_contact_cache [nativecode=1932 ** Table 'tarabnyc_...")
#4 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "TRUNCATE TABLE civicrm_acl_contact_cache [nativecode=1932 ** Table 'tarabnyc_...", "DB_Error", TRUE)
#5 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1907): PEAR->__call("raiseError", (Array:7))
#6 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, "TRUNCATE TABLE civicrm_acl_contact_cache [nativecode=1932 ** Table 'tarabnyc_...", "1932 ** Table 'tarabnyc_wordpress.civicrm_acl_contact_cache' doesn't exist in...")
#7 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("TRUNCATE TABLE civicrm_acl_contact_cache")
#9 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2415): DB_common->query("TRUNCATE TABLE civicrm_acl_contact_cache")
#10 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1607): DB_DataObject->_query("TRUNCATE TABLE civicrm_acl_contact_cache")
#11 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(438): DB_DataObject->query("TRUNCATE TABLE civicrm_acl_contact_cache")
#12 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1413): CRM_Core_DAO->query("TRUNCATE TABLE civicrm_acl_contact_cache", TRUE)
#13 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php(362): CRM_Core_DAO::executeQuery("TRUNCATE TABLE civicrm_acl_contact_cache")
#14 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Setting.php(145): CRM_Core_Config::clearDBCache()
#15 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Setting.php(103): CRM_Admin_Form_Setting->commonProcess((Array:0))
#16 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(489): CRM_Admin_Form_Setting->postProcess()
#17 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#18 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Setting_Debugging), "next", "Next")
#19 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Setting_Debugging), "next")
#20 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Setting_Debugging), "next")
#21 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next")
#22 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php(113): CRM_Core_Controller->run()
#23 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(282): CRM_Utils_Wrapper->run("CRM_Admin_Form_Setting_Debugging", "Debugging", (Array:0))
#24 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:15))
#25 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#26 /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm.php(1240): CRM_Core_Invoke::invoke((Array:4))
#27 /home5/tarabnyc/public_html/wp-includes/class-wp-hook.php(286): CiviCRM_For_WordPress->invoke("")
#28 /home5/tarabnyc/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters("", (Array:1))
#29 /home5/tarabnyc/public_html/wp-includes/plugin.php(453): WP_Hook->do_action((Array:1))
#30 /home5/tarabnyc/public_html/wp-admin/admin.php(224): do_action("toplevel_page_CiviCRM")

Lastly - when trying to upgrade from 5.9 to 5.9.1

Error: Finish Upgrade DB to 5.9.1]
Error Field Error Value
Type    DB_Error
Code    -1
Message DB Error: unknown error
Mode    16
UserInfo    TRUNCATE TABLE civicrm_acl_contact_cache [nativecode=1932 ** Table 'tarabnyc_wordpress.civicrm_acl_contact_cache' doesn't exist in engine]
DebugInfo   TRUNCATE TABLE civicrm_acl_contact_cache [nativecode=1932 ** Table 'tarabnyc_wordpress.civicrm_acl_contact_cache' doesn't exist in engine]
PEAR_Exception: DB Error: unknown error in /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php on line 921
- DB_Error: DB Error: unknown error in unknown on line unknown
Exception trace
#   Function    Location
0   CRM_Core_Error::exceptionHandler(Object(DB_Error))  /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php:921
1   PEAR_Error->__construct('DB Error: unknow…', -1, 16, Array, 'TRUNCATE TABLE c…')    /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php:985
2   DB_Error->__construct(-1, 16, Array, 'TRUNCATE TABLE c…')   /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php:575
3   PEAR->_raiseError(Object(DB_mysqli), null, -1, 16, Array, 'TRUNCATE TABLE c…', 'DB_Error', true)    /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php:223
4   PEAR->__call('raiseError', Array)   /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php:1907
5   DB_common->raiseError(-1, null, null, 'TRUNCATE TABLE c…', '1932 ** Table 't…') /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php:933
6   DB_mysqli->mysqliRaiseError()   /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php:403
7   DB_mysqli->simpleQuery('TRUNCATE TABLE c…') /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php:1216
8   DB_common->query('TRUNCATE TABLE c…')   /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php:2415
9   DB_DataObject->_query('TRUNCATE TABLE c…')  /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php:1607
10  DB_DataObject->query('TRUNCATE TABLE c…')   /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:438
11  CRM_Core_DAO->query('TRUNCATE TABLE c…', true)  /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:1490
12  CRM_Core_DAO::singleValueQuery('TRUNCATE TABLE c…') /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/ACL/BAO/Cache.php:168
13  CRM_ACL_BAO_Cache::resetCache() /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php:1448
14  CRM_Utils_System::flushCache()  /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Form.php:721
15  CRM_Upgrade_Form::doIncrementalUpgradeFinish(Object(CRM_Queue_TaskContext), '5.9.1', '5.9.0', '5.9.1', '/tmp/civicrm-pos…') /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Queue/Task.php:88
16  CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))  /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Queue/Runner.php:214
17  CRM_Queue_Runner->runNext(true) /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Queue/Page/AJAX.php:52
18  CRM_Queue_Page_AJAX::{closure}()    /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Queue/ErrorPolicy.php:106
19  CRM_Queue_ErrorPolicy->call(Object(Closure))    /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Queue/Page/AJAX.php:54
20  CRM_Queue_Page_AJAX::runNext()  /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:275
21  CRM_Core_Invoke::runItem(Array) /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:84
22  CRM_Core_Invoke::_invoke(Array) /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:52
23  CRM_Core_Invoke::invoke(Array)  /home5/tarabnyc/public_html/wp-content/plugins/civicrm/civicrm.php:1240
24  CiviCRM_For_WordPress->invoke('')   /home5/tarabnyc/public_html/wp-includes/class-wp-hook.php:286
25  WP_Hook->apply_filters('', Array)   /home5/tarabnyc/public_html/wp-includes/class-wp-hook.php:310
26  WP_Hook->do_action(Array)   /home5/tarabnyc/public_html/wp-includes/plugin.php:453
    27  do_action('toplevel_page_Ci…')  /home5/tarabnyc/public_html/wp-admin/admin.php:224
28  {main}
  • CiviCRM's reporting that some core tables are missing - would you check that you see the expected tables (MySQL: SHOW TABLES) in the expected database? Do you have WordPress and civicrm in the same DB? You might be able to restore that table from the pre upgrade backup, assuming one exists. – Chris Burgess Jan 17 at 18:51
  • civicrm_acl_contact_cache seems to be the issue - it appears when I use SHOW TABLES but if I try to drop the table - i get the error - civicrm_acl_contact_cache doesn't exist in engine. – themak Jan 17 at 20:18
  • I can't comment on the second part of this - but the first error IS fixed by upgrading to 5.9.1. – Jon G - Megaphone Tech Jan 17 at 21:45
  • I have seen issues where the table was visible in SHOW TABLES but not accessible as a table with data - roughly described in this SE Q&A. Bad times - you may be looking at a full DB restore, and possibly even a full restore of ibdata 😒 – Chris Burgess Jan 18 at 1:15
  • Try this workaround before you go too far! It may work out for you. A good time to check your backups & underlying systems (eg, are those disks healthy?). – Chris Burgess Jan 18 at 1:17
3

As established from the comments on your original question, this appears to have been a corrupted MySQL table.

CiviCRM was reporting in the backtrace that a core table did not exist:

TRUNCATE TABLE civicrm_acl_contact_cache [nativecode=1932 ** Table 'example.civicrm_acl_contact_cache' doesn't exist in engine]

You used MySQL to inspect the DB using SHOW TABLES (or SHOW TABLES LIKE 'name_of_missing_table'). MySQL reported the table was present. However, when you tried to drop the table, MySQL reported that the table was missing. 🙄

Since the table is a cache table which CiviCRM can regenerate from other data in the DB, it was possible to replace the corrupted table's disk files. The workaround I believe you used requires direct access to the files in the MySQL server's data directory - not an option for all sites.

  • These tables are write intensive and (aside from CiviCRM's log_* tables) in my experience are the most likely to fail due to disk corruption, have issues with deadlocks etc. If you feel bold enough, it might be good to investigate moving them to MEMORY storage, which should reduce disk writes / risk of disk corruption, and probably reduce the chances of deadlocks along the way. I haven't tried this myself. – Chris Burgess Jan 18 at 19:50
0

Something has deleted your ibdata1 file where InnoDB keeps the dictionary. Definitely it's not MySQL who does it.

Cheers

Pradeep

  • Can you update your answer to show how you determined that Pradeep? It seems odd to me that CiviCRM / WordPress had got that far in the boot process if the entire DB has been removed, so I'm wondering what clue you're seeing and I'm missing! – Chris Burgess Jan 17 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.