I'm trying to do some site development on my dev copy of the site, but I'm seeing the following error, both in the browser and in drush
commands like drush cc all
:
Sorry but we are not able to provide this at the moment.
DB Error: unknown error
I get this on every page in the browser, e.g. the home page. I'm suspecting CiviCRM is a culprit here, because I see that sites/all/modules/civicrm/packages/DB.php
defines DB_ERROR
as the string "unknown error"
.
How can I debug further? Can I get drush
or php
to give me a stack trace somehow?
I'm using Drupal 7.41 with CiviCRM 4.6.8.
EDIT: If I fire up a shell with php -a
and paste in the contents of index.php
, I get the error when it runs menu_execute_active_handler();
. However, if I run that function again then I get the home page, seemingly correctly rendered. Not sure what that means.
EDIT 2: Following up on Alan's suggestion, I did try manually adding database rows as follows, but it didn't give me any traces:
insert into civicrm_setting set group_name='Developer Preferences', name='backtrace',
value='s:1:"1";', domain_id=1, contact_id=NULL, is_domain=1, component_id=NULL;
insert into civicrm_setting set group_name='Developer Preferences', name='debug_enabled',
value='s:1:"1";', domain_id=1, contact_id=NULL, is_domain=1, component_id=NULL;
EDIT 3 @JitendraPurohit pointed me to a log file (I didn't realize CiviCRM had its own separate log directory!) that contains a stack trace, here it is:
Nov 02 08:22:43 [info] $Fatal Error Details = Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => -1
[message] => DB Error: unknown error
[mode] => 16
[debug_info] => SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/moduleFiles._', 3 ) [nativecode=3057 ** Incorrect user-level lock name 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/moduleFiles._'.]
[type] => DB_Error
[user_info] => SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/moduleFiles._', 3 ) [nativecode=3057 ** Incorrect user-level lock name 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/moduleFiles._'.]
[to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/moduleFiles._', 3 ) [nativecode=3057 ** Incorrect user-level lock name 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/moduleFiles._'.]"]
)
Nov 02 08:22:43 [info] $backTrace = #0 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Core/Error.php(235): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: unknown error", -1, 16, (Array:2), "SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/mo...")
#4 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-1, 16, (Array:2), "SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/mo...")
#5 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/mo...", "DB_Error", TRUE)
#6 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-1, NULL, NULL, NULL, "3057 ** Incorrect user-level lock name 'pantheon.1.cache.3a9e8c34426bc6dde01d...")
#7 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/mo...")
#9 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/mo...")
#10 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/mo...")
#11 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/mo...")
#12 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Core/DAO.php(1234): CRM_Core_DAO->query("SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/mo...", TRUE)
#13 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Core/Lock.php(151): CRM_Core_DAO::singleValueQuery("SELECT GET_LOCK( %1, %2 )", (Array:2))
#14 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/Civi/Core/Lock/LockManager.php(84): CRM_Core_Lock->acquire(NULL)
#15 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Core/BAO/Cache.php(154): Civi\Core\Lock\LockManager->acquire("cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/moduleFiles._")
#16 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Utils/Cache/SqlGroup.php(96): CRM_Core_BAO_Cache::setItem((Array:0), "3a9e8c34426bc6dde01d5581d9654dcf", "mapper/moduleFiles", NULL)
#17 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Extension/Mapper.php(321): CRM_Utils_Cache_SqlGroup->set("mapper/moduleFiles", (Array:0))
#18 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Core/PseudoConstant.php(1837): CRM_Extension_Mapper->getActiveModuleFiles(FALSE)
#19 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Utils/Hook.php(247): CRM_Core_PseudoConstant::getModuleExtensions()
#20 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Utils/Hook/DrupalBase.php(104): CRM_Utils_Hook->requireCiviModules((Array:0))
#21 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Utils/Hook/DrupalBase.php(83): CRM_Utils_Hook_DrupalBase->buildModuleList()
#22 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Utils/Hook.php(1043): CRM_Utils_Hook_DrupalBase->invoke(1, Object(CRM_Core_Config), NULL, NULL, NULL, NULL, NULL, "civicrm_config")
#23 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Core/Config.php(257): CRM_Utils_Hook::config(Object(CRM_Core_Config))
#24 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/drupal/civicrm.module(220): CRM_Core_Config::singleton()
#25 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/drupal/civicrm.module(862): civicrm_initialize()
#26 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/views/plugins/views_plugin_query_default.inc(1405): civicrm_views_query_alter(Object(view), Object(views_plugin_query_default))
#27 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/views/includes/view.inc(1049): views_plugin_query_default->alter(Object(view))
#28 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/views/plugins/views_plugin_display_page.inc(217): view->build()
#29 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/views/includes/view.inc(1345): views_plugin_display_page->execute()
#30 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/views/views.module(540): view->execute_display("page", (Array:0))
#31 [internal function](): views_page("frontpage", "page")
#32 /Users/ken/Documents/SIA/site-upgrade/includes/menu.inc(527): call_user_func_array("views_page", (Array:2))
#33 /Users/ken/Documents/SIA/site-upgrade/index.php(21): menu_execute_active_handler()
#34 {main}
CiviCRM log file (sites/default/files/civicrm/ConfigAndLog/<log_file>)
. If yes, can you paste the backtrace here ?