XF 1.5 Error: Mysqli prepare error: Table 'example_fxxxx.xf_error_log' doesn't exist

ak38

Active member
Server Error
Mysqli prepare error: Table 'lifeinsu_freecanna.xf_error_log' doesn't exist
  1. Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
  2. Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
  3. Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
  4. Zend_Db_Adapter_Abstract->query() in XenForo/Model.php at line 219
  5. XenForo_Model->fetchAllKeyed() in XenForo/Model/Log.php at line 25
  6. XenForo_Model_Log->getServerErrorLogs() in XenForo/ControllerAdmin/Log.php at line 37
  7. XenForo_ControllerAdmin_Log->actionServerError() in XenForo/FrontController.php at line 369
  8. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 152
  9. XenForo_FrontController->run() in /home/lifeinsu/Fxxxxx.com/admin.php at line 13


I noticed the problem today when I logged into admin cp, not changed anything for last couple of weeks so not sure what's cause this.

Any help would be appreciated. Thanks guys!
 
Someone or something has deleted (or corrupted) the xf_error_log table.

In the first instance you should contact your host and ask them to investigate what happened - there may be other issues with the database.

The table can be recreated using:
SQL:
    CREATE TABLE xf_error_log (
        error_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
        exception_date INT UNSIGNED NOT NULL,
        user_id INT UNSIGNED DEFAULT NULL,
        ip_address VARBINARY(16) NOT NULL DEFAULT '',
        exception_type VARCHAR(75) NOT NULL,
        message TEXT NOT NULL,
        filename VARCHAR(255) NOT NULL,
        line INT UNSIGNED NOT NULL,
        trace_string MEDIUMTEXT NOT NULL,
        request_state MEDIUMBLOB NOT NULL,
        PRIMARY KEY (error_id),
        KEY exception_date (exception_date)
    ) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci

If the query fails to run with an error, that would imply the table exists but is corrupt.
Drop it first, then run the query.
 
Thanks Brogan,

I got this back from the server guys:

It is not a problem with disk space, somehow, your database got corrupted.

I can't delete the table or re-create it:

MariaDB [lifeinsu_freecanna]> DROP TABLE xf_error_log;
ERROR 1051 (42S02): Unknown table 'lifeinsu_freecanna.xf_error_log'

If I try to delete the database it fails and brings down MySQL service.


Any ideas/suggestions? Thanks
 
Top Bottom