1

We have had issues where we can't send a mailing. Trying to send a test mailing gets stuck on "saving".

I attempted to run the job to flush the smart group cache and the job log reports that it finished but the CiviCRM error log shows this error during that process. After this, I cleared CiviCRM caches but the site went down. Once it came back up, I ran the job again and got this error.

Mar 20 22:34:02  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => exceptionHandler
        )

    [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => 
        DELETE gc
        FROM civicrm_group_contact_cache gc
        INNER JOIN civicrm_group g ON g.id = gc.group_id
        WHERE g.cache_date <= '20190320222810'
       [nativecode=1205 ** Lock wait timeout exceeded; try restarting transaction]
    [type] => DB_Error
    [user_info] => 
        DELETE gc
        FROM civicrm_group_contact_cache gc
        INNER JOIN civicrm_group g ON g.id = gc.group_id
        WHERE g.cache_date <= '20190320222810'
       [nativecode=1205 ** Lock wait timeout exceeded; try restarting transaction]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="
        DELETE gc
        FROM civicrm_group_contact_cache gc
        INNER JOIN civicrm_group g ON g.id = gc.group_id
        WHERE g.cache_date <= '20190320222810'
       [nativecode=1205 ** Lock wait timeout exceeded; try restarting transaction]"]
)


Mar 20 22:34:02  [info] $backTrace = #0 /[site_root]/sites/all/modules/contrib/civicrm/CRM/Core/Error.php(948): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /[site_root]/sites/all/modules/contrib/civicrm/packages/PEAR.php(921): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 /[site_root]/sites/all/modules/contrib/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "\n        DELETE gc\n        FROM civicrm_group_contact_cache gc\n        INN...")
#3 /[site_root]/sites/all/modules/contrib/civicrm/packages/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "\n        DELETE gc\n        FROM civicrm_group_contact_cache gc\n        INN...")
#4 /[site_root]/sites/all/modules/contrib/civicrm/packages/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "\n        DELETE gc\n        FROM civicrm_group_contact_cache gc\n        INN...", "DB_Error", TRUE)
#5 /[site_root]/sites/all/modules/contrib/civicrm/packages/DB/common.php(1907): PEAR->__call("raiseError", (Array:7))
#6 /[site_root]/sites/all/modules/contrib/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-1, NULL, NULL, "\n        DELETE gc\n        FROM civicrm_group_contact_cache gc\n        INN...", "1205 ** Lock wait timeout exceeded; try restarting transaction")
#7 /[site_root]/sites/all/modules/contrib/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /[site_root]/sites/all/modules/contrib/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("\n        DELETE gc\n        FROM civicrm_group_contact_cache gc\n        INN...")
#9 /[site_root]/sites/all/modules/contrib/civicrm/packages/DB/DataObject.php(2415): DB_common->query("\n        DELETE gc\n        FROM civicrm_group_contact_cache gc\n        INN...")
#10 /[site_root]/sites/all/modules/contrib/civicrm/packages/DB/DataObject.php(1607): DB_DataObject->_query("\n        DELETE gc\n        FROM civicrm_group_contact_cache gc\n        INN...")
#11 /[site_root]/sites/all/modules/contrib/civicrm/CRM/Core/DAO.php(438): DB_DataObject->query("\n        DELETE gc\n        FROM civicrm_group_contact_cache gc\n        INN...")
#12 /[site_root]/sites/all/modules/contrib/civicrm/CRM/Core/DAO.php(1413): CRM_Core_DAO->query("\n        DELETE gc\n        FROM civicrm_group_contact_cache gc\n        INN...", TRUE)
#13 /[site_root]/sites/all/modules/contrib/civicrm/CRM/Contact/BAO/GroupContactCache.php(366): CRM_Core_DAO::executeQuery("\n        DELETE gc\n        FROM civicrm_group_contact_cache gc\n        INN...", (Array:1))
#14 /[site_root]/sites/all/modules/contrib/civicrm/CRM/Contact/BAO/GroupContactCache.php(437): CRM_Contact_BAO_GroupContactCache::flushCaches()
#15 /[site_root]/sites/all/modules/contrib/civicrm/api/v3/Job.php(712): CRM_Contact_BAO_GroupContactCache::deterministicCacheFlush()
#16 /[site_root]/sites/all/modules/contrib/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_job_group_cache_flush((Array:1))
#17 /[site_root]/sites/all/modules/contrib/civicrm/Civi/API/Kernel.php(169): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
#18 /[site_root]/sites/all/modules/contrib/civicrm/Civi/API/Kernel.php(100): Civi\API\Kernel->runRequest((Array:9))
#19 /[site_root]/sites/all/modules/contrib/civicrm/api/api.php(23): Civi\API\Kernel->runSafe("Job", "group_cache_flush", (Array:1), NULL)
#20 /[site_root]/sites/all/modules/contrib/civicrm/CRM/Core/JobManager.php(146): civicrm_api("Job", "group_cache_flush", (Array:1))
#21 /[site_root]/sites/all/modules/contrib/civicrm/CRM/Core/JobManager.php(113): CRM_Core_JobManager->executeJob(Object(CRM_Core_ScheduledJob))
#22 /[site_root]/sites/all/modules/contrib/civicrm/CRM/Admin/Page/Job.php(173): CRM_Core_JobManager->executeJobById("25")
#23 /[site_root]/sites/all/modules/contrib/civicrm/CRM/Core/Page/Basic.php(160): CRM_Admin_Page_Job->browse(NULL, NULL)
#24 /[site_root]/sites/all/modules/contrib/civicrm/CRM/Admin/Page/Job.php(156): CRM_Core_Page_Basic->run()
#25 /[site_root]/sites/all/modules/contrib/civicrm/CRM/Core/Invoke.php(309): CRM_Admin_Page_Job->run((Array:3), NULL)
#26 /[site_root]/sites/all/modules/contrib/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:16))
#27 /[site_root]/sites/all/modules/contrib/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#28 /[site_root]/sites/all/modules/contrib/civicrm/drupal/civicrm.module(445): CRM_Core_Invoke::invoke((Array:3))
#29 /[site_root]/includes/menu.inc(527): civicrm_invoke("admin", "job")
#30 /[site_root]/index.php(21): menu_execute_active_handler()
#31 {main}


Mar 20 22:34:02  [info] Retrying after Database lock encountered hit on attempt 1 at query : 
        DELETE gc
        FROM civicrm_group_contact_cache gc
        INNER JOIN civicrm_group g ON g.id = gc.group_id
        WHERE g.cache_date <= '20190320222810'

The test mailing did go through once the server was rebooted but the deadlock happened again after sending another test mailing.

Your Answer

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

Browse other questions tagged or ask your own question.