Answers.Body: <p><strong>Browser</strong> - From the browser, go to Administer > System Settings > Debugging and Error Handling and you can turn on Enable Debugging and Display Backtrace. That should provide you with more specific errors that you need to debug.</p>
  
  <p>Also, per the help item on "Enable Bugging" you can do the following to any Civi URL for a stack trace:</p>
  
  <blockquote>
    <p>Stack Trace - To display a stack trace listing at the top of a page,
    add <em>&amp;backtrace=1</em></p>
  </blockquote>
  
  <p>Since you're working on your dev copy, you don't have to worry about your production environment being affected.</p>
  
  <p><strong>Drush</strong> - For drush, you can enable debugging with this command:</p>
  
  <pre><code>drush civicrm-enable-debug
  </code></pre>
  
  <p>Source: <a href="http://drushcommands.com/drush-6x/civicrm/civicrm-enable-debug" rel="nofollow">http://drushcommands.com/drush-6x/civicrm/civicrm-enable-debug</a></p>
  
  <p><strong>Database</strong> - If you are locked out of Civi (no pages displaying) and Drush is not an option, you can also enable Debugging and BackTrace if you have access to your database.</p>
  
  <p>From the <code>civicrm_settings</code> table, find the lines with a <em>group name</em> of <code>Developer Preferences</code> and the <em>name</em> <code>debug_enabled</code> and <code>backtrace</code>. For the <em>value</em> of each line, change <code>s:1:"0";</code> to <code>s:1:"1";</code> and save.  That will enable them.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-31T21:42:11.513Z
Answers.Text: That produces the same error, apparently it's dying before it has a chance to turn on debugging.  Is there a way to do the same thing directly in the database?
Answers.UserDisplayName: Ken Williams
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-01T02:50:57.500Z
Answers.Text: I've added another option for using the database only.
Answers.UserDisplayName: Allen Hutchison
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-01T04:03:03.897Z
Answers.Text: The only `Developer Preferences` row I have is `fatalErrorTemplate` - so I presume I need to add rows with `name='debug_enabled'` and `name='backtrace'`, but I'm not sure what values to use for the other fields.
Answers.UserDisplayName: Ken Williams
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-03T05:50:30.147Z
Answers.Text: While trying to figure this out, I ended up just downloading PHPStorm and debugging there - MUCH better.  I could step through in a debugger like a real person, though it did still keep dying with no stack trace eventually.
Answers.UserDisplayName: Ken Williams
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-31T18:01:33.680Z
Answers.LastActivityDate: 2015-11-01T02:49:21.023Z
Answers.LastEditDate: 2015-11-01T02:49:21.023Z
Answers.UserDisplayName: Allen Hutchison
Answers.Body: <p>Sorry for the late post here, but this tip might help someone going forward with this error.</p>
  
  <p>I too was receiving this error on a fresh install of CiviCRM with WordPress. It was noted there were ajax errors. We guessed that the script was calling for more memory than the server had allotted. Memory allocation was increased and the error went away. It was that easy.</p>
  
  <p>Hope this helps someone else with the same problem.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-14T18:06:44.780Z
Answers.LastActivityDate: 2016-03-14T18:06:44.780Z
Answers.UserDisplayName: 406CODE
Answers.Body: <p>Based on the following line in the CiviCRM log file:</p>
  
  <pre><code>   [debug_info] =&gt; SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/moduleFiles._', 3 ) [nativecode=3057 ** Incorrect user-level lock name 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/moduleFiles._'.]
  </code></pre>
  
  <p>this appears to be an issue with Pantheon's database setup.  I would submit a ticket with Pantheon support to see if they can resolve it.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-02T15:17:56.623Z
Answers.Text: Actually, I don't use Pantheon.  The name of the database just happens to be "pantheon" as a holdover from when I was experimenting with using Pantheon.  My environment is just a local server & database running on my Macbook.
Answers.UserDisplayName: Ken Williams
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-02T15:20:02.360Z
Answers.Text: Did you copy the pantheon codebase/database to the local server instance?  Pantheon does make some subtle changes to their installation to accommodate their business model which may trip you up if you move it elsewhere.
Answers.UserDisplayName: DaveD
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-02T15:22:55.897Z
Answers.Text: It also looks like the error message was added to MySQL 5.7 (meaning that is the version you are running I think).  To the best of my knowledge, CiviCRM has not been tested w 5.7.  You should revert your MySQL version back to 5.5 (the most recent version tested I think) and try again.
Answers.UserDisplayName: DaveD
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-02T15:29:02.223Z
Answers.Text: My hosting provider (DreamHost) updated to MySQL 5.6, which precipitated this testing, so I updated my local test environment (because of other incompatibilities I was having).  I'll roll the test environment back to 5.6 and see if I can get that working.
Answers.UserDisplayName: Ken Williams
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-02T15:30:05.227Z
Answers.Text: Regarding the Pantheon codebase - I don't think I should have any of their codebase in my environment, I update Drupal using the stock Drupal releases.
Answers.UserDisplayName: Ken Williams
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-02T15:54:41.513Z
Answers.Text: Ken, with Pantheon I am usually more concerned with the changes needed to CiviCRM to make it work.  ;-)  As long as you installed from stock, no probs there.
Answers.UserDisplayName: DaveD
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-03T05:48:19.417Z
Answers.Text: After rolling back to mysql 5.6, things seem to work fine again.  So it looks like in my case at least, mysql 5.7 is a strict non-starter.  @DaveD, if you want to write that up as a quick answer, I'd mark it as the accepted one.
Answers.UserDisplayName: Ken Williams
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-02T15:16:13.043Z
Answers.LastActivityDate: 2015-11-02T15:16:13.043Z
Answers.UserDisplayName: DaveD
Answers.Body: <p>Reviewing the stack trace you provided, the line <code>[debug_info] =&gt; SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/moduleFiles._', 3 ) [nativecode=3057 ** Incorrect user-level lock name 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/moduleFiles._'.]</code> is the important one.</p>
  
  <p>I googled <code>nativecode=3057 ** Incorrect user-level lock name</code> and it reported to be an error added to MySQL in v5.7.</p>
  
  <p>To the best of my knowledge, CiviCRM has not been tested w 5.7. You should revert your MySQL version back to an earlier version (5.5 is the most recent version tested with CiviCRM I think) and try again. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-03T19:43:18.447Z
Answers.Text: After reverting to MySQL 5.6, everything started to work fine.
Answers.UserDisplayName: Ken Williams
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-03T21:37:59.630Z
Answers.Text: Glad you got it working!
Answers.UserDisplayName: Allen Hutchison
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-05T16:23:34.530Z
Answers.Text: There are changes in 5.6 -> 5.7 Get_Lock() and some bugs:
Answers.UserDisplayName: Sonicthoughts
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-05T16:37:13.190Z
Answers.Text: ref: https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en/upgrading-from-previous-series.html
Answers.UserDisplayName: Sonicthoughts
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-05T16:41:06.377Z
Answers.Text: See:"MySQL 5.7.5 and later enforces a maximum length on lock names of 64 characters. Previously, no limit was enforced." I noticed the lock name is 72 characters so that is something to take a look at.
Answers.UserDisplayName: Sonicthoughts
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-02T22:42:41.243Z
Answers.Text: Just something to note here is that it would appear that since April 2016 4.6 4.7 do support Mysql 5.7 https://issues.civicrm.org/jira/browse/CRM-17846
Answers.UserDisplayName: Seamus Lee
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-03T16:42:26.473Z
Answers.LastActivityDate: 2015-11-03T16:42:26.473Z
Answers.UserDisplayName: DaveD
Body: <p>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 <code>drush</code> commands like <code>drush cc all</code>:</p>
  
  <pre><code>Sorry but we are not able to provide this at the moment.
  DB Error: unknown error
  </code></pre>
  
  <p>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 <code>sites/all/modules/civicrm/packages/DB.php</code> defines <code>DB_ERROR</code> as the string <code>"unknown error"</code>.</p>
  
  <p>How can I debug further?  Can I get <code>drush</code> or <code>php</code> to give me a stack trace somehow?</p>
  
  <p>I'm using Drupal 7.41 with CiviCRM 4.6.8.</p>
  
  <p><strong>EDIT</strong>: If I fire up a shell with <code>php -a</code> and paste in the contents of <code>index.php</code>, I get the error when it runs <code>menu_execute_active_handler();</code>.  However, if I run that function <em>again</em> then I get the home page, seemingly correctly rendered.  Not sure what that means.</p>
  
  <p><strong>EDIT 2</strong>: Following up on Alan's suggestion, I did try manually adding database rows as follows, but it didn't give me any traces:</p>
  
  <pre><code>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;
  </code></pre>
  
  <p><strong>EDIT 3</strong> @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:</p>
  
  <pre><code>Nov 02 08:22:43  [info] $Fatal Error Details = Array
  (
      [callback] =&gt; Array
          (
              [0] =&gt; CRM_Core_Error
              [1] =&gt; handle
          )
  
      [code] =&gt; -1
      [message] =&gt; DB Error: unknown error
      [mode] =&gt; 16
      [debug_info] =&gt; SELECT GET_LOCK( 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/moduleFiles._', 3 ) [nativecode=3057 ** Incorrect user-level lock name 'pantheon.1.cache.3a9e8c34426bc6dde01d5581d9654dcf_mapper/moduleFiles._'.]
      [type] =&gt; DB_Error
      [user_info] =&gt; 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] =&gt; [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-&gt;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-&gt;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-&gt;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-&gt;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-&gt;mysqlRaiseError()
  #8 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql-&gt;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-&gt;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-&gt;_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-&gt;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-&gt;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-&gt;acquire(NULL)
  #15 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Core/BAO/Cache.php(154): Civi\Core\Lock\LockManager-&gt;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-&gt;set("mapper/moduleFiles", (Array:0))
  #18 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Core/PseudoConstant.php(1837): CRM_Extension_Mapper-&gt;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-&gt;requireCiviModules((Array:0))
  #21 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Utils/Hook/DrupalBase.php(83): CRM_Utils_Hook_DrupalBase-&gt;buildModuleList()
  #22 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/civicrm/CRM/Utils/Hook.php(1043): CRM_Utils_Hook_DrupalBase-&gt;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-&gt;alter(Object(view))
  #28 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/views/plugins/views_plugin_display_page.inc(217): view-&gt;build()
  #29 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/views/includes/view.inc(1345): views_plugin_display_page-&gt;execute()
  #30 /Users/ken/Documents/SIA/site-upgrade/sites/all/modules/views/views.module(540): view-&gt;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}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-02T05:32:28.660Z
Comments.Text: Do you see any backtrace in `CiviCRM log file (sites/default/files/civicrm/ConfigAndLog/<log_file>)`. If yes, can you paste the backtrace here ?
Comments.UserDisplayName: jitendra - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-11-02T13:25:22.590Z
Comments.Text: Thanks @JitendraPurohit !  I'll paste the log here.  Looks like it's having problems with locking.
Comments.UserDisplayName: Ken Williams
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-22T14:20:05.090Z
Comments.Text: Entro a una pajina y me aparese esro de error
Comments.UserDisplayName: Maria villalva
Tags: <debugging><drush>
Title: DB Error: unknown error
ThreadText: # DB Error: unknown error
  
  (Asked by: username_0 on 2015-10-31)
  
  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}
  
  **Tags:** debugging, drush
  
  > **Comments:**
  > **username_1**: Do you see any backtrace in `CiviCRM log file (sites/default/files/civicrm/ConfigAndLog/<log_file>)`. If yes, can you paste the backtrace here ?  
  > **username_0**: Thanks @JitendraPurohit !  I'll paste the log here.  Looks like it's having problems with locking.  
  > **username_2**: Entro a una pajina y me aparese esro de error  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_5 on 2015-11-03. Score: 6 | Accepted answer
  
  Reviewing the stack trace you provided, the line `[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._'.]` is the important one.
  
  I googled `nativecode=3057 ** Incorrect user-level lock name` and it reported to be an error added to MySQL in v5.7.
  
  To the best of my knowledge, CiviCRM has not been tested w 5.7. You should revert your MySQL version back to an earlier version (5.5 is the most recent version tested with CiviCRM I think) and try again.
  
  > **Comments:**
  > **username_0**: After reverting to MySQL 5.6, everything started to work fine.  
  > **username_3**: Glad you got it working!  
  > **username_6**: There are changes in 5.6 -> 5.7 Get_Lock() and some bugs:  
  > **username_6**: ref: https://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en/upgrading-from-previous-series.html  
  > **username_6**: See:"MySQL 5.7.5 and later enforces a maximum length on lock names of 64 characters. Previously, no limit was enforced." I noticed the lock name is 72 characters so that is something to take a look at.  
  > **username_7**: Just something to note here is that it would appear that since April 2016 4.6 4.7 do support Mysql 5.7 https://issues.civicrm.org/jira/browse/CRM-17846  
  
  ---
  
  ### Answer by username_3 on 2015-10-31. Score: 5
  
  Browser - From the browser, go to Administer > System Settings > Debugging and Error Handling and you can turn on Enable Debugging and Display Backtrace. That should provide you with more specific errors that you need to debug.
  Also, per the help item on "Enable Bugging" you can do the following to any Civi URL for a stack trace:
  
  Stack Trace - To display a stack trace listing at the top of a page,
    add &backtrace=1
  
  Since you're working on your dev copy, you don't have to worry about your production environment being affected.
  Drush - For drush, you can enable debugging with this command:
  drush civicrm-enable-debug
  
  Source: http://drushcommands.com/drush-6x/civicrm/civicrm-enable-debug
  Database - If you are locked out of Civi (no pages displaying) and Drush is not an option, you can also enable Debugging and BackTrace if you have access to your database.
  From the civicrm_settings table, find the lines with a group name of Developer Preferences and the name debug_enabled and backtrace. For the value of each line, change s:1:"0"; to s:1:"1"; and save.  That will enable them.
  
  > **Comments:**
  > **username_0**: That produces the same error, apparently it's dying before it has a chance to turn on debugging.  Is there a way to do the same thing directly in the database?  
  > **username_3**: I've added another option for using the database only.  
  > **username_0**: The only `Developer Preferences` row I have is `fatalErrorTemplate` - so I presume I need to add rows with `name='debug_enabled'` and `name='backtrace'`, but I'm not sure what values to use for the other fields.  
  > **username_0**: While trying to figure this out, I ended up just downloading PHPStorm and debugging there - MUCH better.  I could step through in a debugger like a real person, though it did still keep dying with no stack trace eventually.  
  
  ---
  
  ### Answer by username_4 on 2016-03-14. Score: 2
  
  Sorry for the late post here, but this tip might help someone going forward with this error.
  
  I too was receiving this error on a fresh install of CiviCRM with WordPress. It was noted there were ajax errors. We guessed that the script was calling for more memory than the server had allotted. Memory allocation was increased and the error went away. It was that easy.
  
  Hope this helps someone else with the same problem.
  
  
  ---
  
  ### Answer by username_5 on 2015-11-02. Score: 1
  
  Based on the following line in the CiviCRM log file:
     [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._'.]
  
  this appears to be an issue with Pantheon's database setup.  I would submit a ticket with Pantheon support to see if they can resolve it.
  
  > **Comments:**
  > **username_0**: Actually, I don't use Pantheon.  The name of the database just happens to be "pantheon" as a holdover from when I was experimenting with using Pantheon.  My environment is just a local server & database running on my Macbook.  
  > **username_5**: Did you copy the pantheon codebase/database to the local server instance?  Pantheon does make some subtle changes to their installation to accommodate their business model which may trip you up if you move it elsewhere.  
  > **username_5**: It also looks like the error message was added to MySQL 5.7 (meaning that is the version you are running I think).  To the best of my knowledge, CiviCRM has not been tested w 5.7.  You should revert your MySQL version back to 5.5 (the most recent version tested I think) and try again.  
  > **username_0**: My hosting provider (DreamHost) updated to MySQL 5.6, which precipitated this testing, so I updated my local test environment (because of other incompatibilities I was having).  I'll roll the test environment back to 5.6 and see if I can get that working.  
  > **username_0**: Regarding the Pantheon codebase - I don't think I should have any of their codebase in my environment, I update Drupal using the stock Drupal releases.  
  > **username_5**: Ken, with Pantheon I am usually more concerned with the changes needed to CiviCRM to make it work.  ;-)  As long as you installed from stock, no probs there.  
  > **username_0**: After rolling back to mysql 5.6, things seem to work fine again.  So it looks like in my case at least, mysql 5.7 is a strict non-starter.  @username_5, if you want to write that up as a quick answer, I'd mark it as the accepted one.  
  
  ---
  
  