0

I'm on wordpress 6.0, linux, upgrading from CiviCRM 5.36.0 to 5.50.3.

When I try and run the upgrade script i.e. wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fupgrade&reset=1

I get the following error in my debug and it crashes:

[22-Jun-2022 19:05:42 Europe/London] PHP Fatal error:  Uncaught <table style="border: 1px" cellspacing="0">
<tr><td colspan="3" style="background: #ff9999"> <b>PEAR_Exception</b>: DB Error: no database selected in <b>/var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php</b> on line <b>922</b></td></tr>
<tr><td colspan="3" style="background: #ff9999">- <b>DB_Error</b>: DB Error: no database selected in <b>unknown</b> on line <b>unknown</b></td></tr>
<tr><td colspan="3" style="background-color: #aaaaaa; text-align: center; font-weight: bold;">Exception trace</td></tr>
<tr><td style="text-align: center; background: #cccccc; width:20px; font-weight: bold;">#</td><td style="text-align: center; background: #cccccc; font-weight: bold;">Function</td><td style="text-align: center; background: #cccccc; font-weight: bold;">Location</td></tr>
<tr><td style="text-align: center;">0</td><td>CRM_Core_Error::exceptionHandler()</td><td>/var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php:922</td></tr>
<tr in /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php on line 955

Jun 22 20:55:26  [debug] $backTrace = #0 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(441): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(PEAR_Exception))
#2 /var/www/html/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke((Array:2))
#3 /var/www/html/wp-includes/class-wp-hook.php(307): CiviCRM_For_WordPress->invoke("")
#4 /var/www/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters("", (Array:1))
#5 /var/www/html/wp-includes/plugin.php(476): WP_Hook->do_action((Array:1))
#6 /var/www/html/wp-admin/admin.php(259): do_action("toplevel_page_CiviCRM")
#7 {main}


Jun 22 20:55:28  [error] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => exceptionHandler
        )

    [code] => -14
    [message] => DB Error: no database selected
    [mode] => 16
    [debug_info] => SELECT * 
 FROM   `civicrm_component`   
 
 
 
 
 
 [nativecode=2006 ** MySQL server has gone away]
    [type] => DB_Error
    [user_info] => SELECT * 
 FROM   `civicrm_component`   
 
 
 
 
 
 [nativecode=2006 ** MySQL server has gone away]
    [to_string] => [db_error: message="DB Error: no database selected" code=-14 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="SELECT * 
 FROM   `civicrm_component`   
 
 
 
 
 
 [nativecode=2006 ** MySQL server has gone away]"]
)


Jun 22 20:56:14  [debug] $backTrace = #0 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(954): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php(997): PEAR_Error->__construct("DB Error: no database selected", -14, 16, (Array:2), "SELECT * \n FROM   `civicrm_component`   \n \n \n \n \n \n [nativecode=2006 *...")
#3 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-14, 16, (Array:2), "SELECT * \n FROM   `civicrm_component`   \n \n \n \n \n \n [nativecode=2006 *...")
#4 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR::_raiseError(Object(DB_mysqli), NULL, -14, 16, (Array:2), "SELECT * \n FROM   `civicrm_component`   \n \n \n \n \n \n [nativecode=2006 *...", "DB_Error", TRUE)
#5 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7))
#6 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(936): DB_common->raiseError(-14, NULL, NULL, "SELECT * \n FROM   `civicrm_component`   \n \n \n \n \n \n [nativecode=2006 *...", "2006 ** MySQL server has gone away")
#7 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(391): DB_mysqli->mysqliRaiseError(-14)
#8 /var/www/html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("SELECT * \n FROM   `civicrm_component`   \n \n \n \n \n \n")
#9 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2696): DB_common->query("SELECT * \n FROM   `civicrm_component`   \n \n \n \n \n \n")
#10 /var/www/html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(451): DB_DataObject->_query("SELECT * \n FROM   `civicrm_component`   \n \n \n \n \n \n")
#11 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Component.php(74): DB_DataObject->find(FALSE)
#12 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Component.php(37): CRM_Core_Component::getComponents()
#13 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Component.php(116): CRM_Core_Component::_info(FALSE)
#14 /var/www/html/wp-content/plugins/civicrm-admin-utilities/includes/civicrm-admin-utilities-single.php(2269): CRM_Core_Component::getEnabledComponents()
#15 /var/www/html/wp-includes/class-wp-hook.php(307): CiviCRM_Admin_Utilities_Single->shortcuts_menu_add(Object(WP_Admin_Bar))
#16 /var/www/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, (Array:1))
#17 /var/www/html/wp-includes/plugin.php(524): WP_Hook->do_action((Array:1))
#18 /var/www/html/wp-includes/admin-bar.php(95): do_action_ref_array("admin_bar_menu", (Array:1))
#19 /var/www/html/wp-includes/class-wp-hook.php(307): wp_admin_bar_render("")
#20 /var/www/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters("", (Array:1))
#21 /var/www/html/wp-includes/plugin.php(476): WP_Hook->do_action((Array:1))
#22 /var/www/html/wp-admin/admin-header.php(267): do_action("in_admin_header")
#23 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/Base.php(312): require_once("/var/www/html/wp-admin/admin-header.php")
#24 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System.php(202): CRM_Utils_System_Base->theme("<div id=\"crm-container\" class=\"crm-container\" lang=\"en\" xml:lang=\"en\"...", FALSE, FALSE)
#25 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(452): CRM_Utils_System::theme("<div id=\"crm-container\" class=\"crm-container\" lang=\"en\" xml:lang=\"en\"...")
#26 /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(PEAR_Exception))
#27 /var/www/html/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke((Array:2))
#28 /var/www/html/wp-includes/class-wp-hook.php(307): CiviCRM_For_WordPress->invoke("")
#29 /var/www/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters("", (Array:1))
#30 /var/www/html/wp-includes/plugin.php(476): WP_Hook->do_action((Array:1))
#31 /var/www/html/wp-admin/admin.php(259): do_action("toplevel_page_CiviCRM")

any ideas?

2
  • Here is the entire backtrace:
    – Dan Jacobs
    Jun 22 at 19:57
  • Would really appreciated some suggestions, I have no idea what to do with this.
    – Dan Jacobs
    Jun 23 at 16:59

1 Answer 1

0

This indicates that MySQL has crashed. Check your MySQL log for details, and considering increasing the number of open connections.

6
  • Thanks, I tried that, then I noticed this odd error in the MySQL logs: [ERROR] /usr/sbin/mysqld: Out of memory (Needed 32 bytes) I certainly have 32 bytes free. Have been monitoring and plenty of free memory, no swapping happening.
    – Dan Jacobs
    Jun 24 at 18:08
  • @DanJacobs That error indicates that MySQL wanted 32 bytes more than it had available. Check /etc/mysql/my.cnf and files in /etc/mysql/conf.d for your MySQL settings (this is Debian/Ubuntu, not sure about other OSes/distros). Is this an old server? I see issues like this when I upgrade the OS but don't take the new default settings for MySQL and keep the old ones. "Reasonable" defaults for memory allocation have changed over time - and it sounds like you can spare more RAM to MySQL. Jun 26 at 2:30
  • Thanks, Jon, I had already massively upped the defaults. Didn't work.
    – Dan Jacobs
    Jun 26 at 11:38
  • upgraded the server to 4gb RAM and changed innodb_buffer_pool_size to 3G. Same problem.
    – Dan Jacobs
    Jun 26 at 12:47
  • ok, after upgrading the RAM and doing some more tuning of MySQL, I got the same error but also an error saying a table was corrupt (wordpress.log_civicrm_msg_template). I turned off logging and dropped the table. Now the upgrade has started to run!
    – Dan Jacobs
    Jun 26 at 13:32

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.