1

I am running CiviCRM 5.59.2 on Wordpress 6.2.

I am getting an occasional error in CiviCRM that I think has something to do with a timezone not being set correctly somewhere. In my Wordpress general settings, the timezone is set to Vancouver which is where the client is located. But the error suggests that somewhere the timezone is set to Berlin. Or, perhaps, I am misunderstanding this. I'm not a programmer :-)

I have spent quite a lot of time trying to figure this out, but obviously I haven't.

Can anyone please help me learn how to fix this? The more specific the instructions the better :-)

Thanks!

This is the error from the CiviCRM log:

[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] => SET time_zone = '-7:00' [nativecode=2006 ** MySQL server has gone away]
    [type] => DB_Error
    [user_info] => SET time_zone = '-7:00' [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="SET time_zone = '-7:00' [nativecode=2006 ** MySQL server has gone away]"]
)

This is the backtrace from the CiviCRM log:

bug] $backTrace = #0~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(954): CRM_Core_Error::backtrace("backTrace", TRUE)
#1~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(945): CRM_Core_Error::exceptionHandler(Object(DB_Error))
#2~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php(997): PEAR_Error->__construct("DB Error: unknown error", -1, 16, (Array:2), "SET @@time_zone = \"Europe/Berlin\" [nativecode=1298 ** Unknown or incorrect ...")
#3~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "SET @@time_zone = \"Europe/Berlin\" [nativecode=1298 ** Unknown or incorrect ...")
#4~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR::_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "SET @@time_zone = \"Europe/Berlin\" [nativecode=1298 ** Unknown or incorrect ...", "DB_Error", TRUE)
#5~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7))
#6~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(943): DB_common->raiseError(-1, NULL, NULL, "SET @@time_zone = \"Europe/Berlin\" [nativecode=1298 ** Unknown or incorrect ...", "1298 ** Unknown or incorrect time zone: 'Europe/Berlin'")
#7~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(413): DB_mysqli->mysqliRaiseError()
#8~/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("SET @@time_zone = \"Europe/Berlin\"")
#9~/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2696): DB_common->query("SET @@time_zone = \"Europe/Berlin\"")
#10~/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1829): DB_DataObject->_query("SET @@time_zone = \"Europe/Berlin\"")
#11~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(494): DB_DataObject->query("SET @@time_zone = \"Europe/Berlin\"")
#12~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1749): CRM_Core_DAO->query("SET @@time_zone = \"Europe/Berlin\"", TRUE)
#13~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component/Timestamps.php(39): CRM_Core_DAO::singleValueQuery("SET @@time_zone = \"Europe/Berlin\"")
#14~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check/Component.php(76): CRM_Utils_Check_Component_Timestamps->checkTimezoneAPIs(FALSE)
#15~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php(215): CRM_Utils_Check_Component->checkAll((Array:0), FALSE)
#16~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php(185): CRM_Utils_Check::checkStatus()
#17~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/Check.php(93): CRM_Utils_Check::checkAll()
#18~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Page.php(255): CRM_Utils_Check->showPeriodicAlerts()
#19~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Contact/Page/DashBoard.php(57): CRM_Core_Page->run()
#20~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(319): CRM_Contact_Page_DashBoard->run((Array:2), NULL)
#21~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:17))
#22~/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:2))
#23~/public_html/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke((Array:2))
#24~/public_html/wp-includes/class-wp-hook.php(308): CiviCRM_For_WordPress->invoke("")
#25~/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters("", (Array:1))
#26~/public_html/wp-includes/plugin.php(517): WP_Hook->do_action((Array:1))
#27~/public_html/wp-admin/admin.php(259): do_action("toplevel_page_CiviCRM")
#28 {main}

1 Answer 1

1

Visit the civi system status check page. It will give you a link to https://dev.mysql.com/doc/refman/8.0/en/mysql-tzinfo-to-sql.html. If you can't do that, civi will still work for the foreseeable future. Also when you upgrade to 5.61 the extra logging will go away.

3
  • 1
    Thanks for the answer Demerit. The hosting company has responded to my query with: "I am sorry but unfortunately its not possible to change the timezone on the shared server, In this case I suggest you upgrade the service to our cloud or dedicated server, so that you can change it accordingly." Oh well. Apr 8, 2023 at 15:42
  • 1
    At Demerit's suggestion I escalated with the hosting company (hostinguk.net) after getting the same reply. To my surprise they agreed to add timezones, so worth a try. I used the argument that it made their shared service more attractive/useful.
    – Andy Clark
    Apr 11, 2023 at 19:52
  • Thanks that could be a useful tip.
    – Demerit
    Apr 11, 2023 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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