1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Server Error log.

Discussion in 'Troubleshooting and Problems' started by andybond, Sep 29, 2015.

  1. andybond

    andybond Active Member

    I am getting the following error when visiting the server error log :

    Mysqli prepare error: Table 'XY and Z.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 351
    8. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    9. XenForo_FrontController->run() in /home/turbipwd/public_html/admin.php at line 13
    My understanding is the table doesnt exist ;)

    How can I recreate ?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Recreating the table is easy enough but do you have any idea how it was deleted?
    CREATE TABLE `xf_error_log` (
    `error_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `exception_date` int(10) unsigned NOT NULL,
    `user_id` int(10) unsigned DEFAULT NULL,
    `exception_type` varchar(75) NOT NULL,
    `message` text NOT NULL,
    `filename` varchar(255) NOT NULL,
    `line` int(10) unsigned NOT NULL,
    `trace_string` mediumtext NOT NULL,
    `request_state` mediumblob NOT NULL,
    `ip_address` varbinary(16) NOT NULL DEFAULT '',
    PRIMARY KEY (`error_id`),
    KEY `exception_date` (`exception_date`)
    I would be more concerned with determining that.
  3. andybond

    andybond Active Member

    Fast response , thank you @Brogan.

    I have an idea on why the table was lost - but want to confirm a few things first.
  4. andybond

    andybond Active Member

    @Brogan .

    Recieve the error :

     #1146 - Table 'x y or z _xen.xf_error_log' doesn't exist
    when trying to run the SQL against the DB
  5. Mike

    Mike XenForo Developer Staff Member

    When trying to create the table?

    That points to server-level database corruption, possibly relating to a disk filling up. You may need to talk to your host for them to look into recovery options.
  6. andybond

    andybond Active Member

    Yeah, goto phpmyadmin , find the DB ( I have a few ) select it , then goto the query and create ..

    Looks like it executes , but delivers that error .
  7. andybond

    andybond Active Member

    I have downloaded a backup of the mysql , deleted it and then restored.

    An unexpected error occurred. Please try again later. is what I recieve now .

    If I goto the /install folder

    Mysqli prepare error: Table 'x y and z .xf_session_admin' doesn't exist

    Can I do a clean install , install the DB again and import the DB that is missing the tables onto it ?
  8. Brogan

    Brogan XenForo Moderator Staff Member

    If the issue is just those few tables then you may be able to get away with that.

    However, there could be other corruption so you may need to revert to an older backup which has no corruption.
  9. andybond

    andybond Active Member

    What would you recommend for the restore ?

    Get the quite old backup on , then import the db with the missing tables ?
  10. andybond

    andybond Active Member

    @Brogan could you advise on the sql to create the table that I mentioned ?
  11. Brogan

    Brogan XenForo Moderator Staff Member

    It really depends on the tables.
    If they are just session tables you can recreate them.
    If they are log tables, you can either recreate them or import them.

    Any other tables would be problematic though, depending on the content.
  12. Brogan

    Brogan XenForo Moderator Staff Member

    The xf_session_admin table?
    If so:
    CREATE TABLE `xf_session_admin` (
     `session_id` varbinary(32) NOT NULL,
     `session_data` mediumblob NOT NULL,
     `expiry_date` int(10) unsigned NOT NULL,
     PRIMARY KEY (`session_id`),
     KEY `expiry_date` (`expiry_date`)
    andybond likes this.
  13. andybond

    andybond Active Member

    Aw crumbs. Thanks for the pointers so far.

    I am curious what has caused the corruption. I suspect its at host level though
  14. Brogan

    Brogan XenForo Moderator Staff Member

    Definitely something at the server level.
  15. andybond

    andybond Active Member

    @Brogan just recreated that table and xf_user' doesn't exist now.

    I assume thats all the users ?
  16. Brogan

    Brogan XenForo Moderator Staff Member


    It sounds like your backup is no good.
  17. andybond

    andybond Active Member

    It does a bit.

    Ill have to dig out an older version of the mySQL

    Would it be risky after doing a sucessful restore , doing an import ontop of the restored DB?

    I appreciate stuff like the users registered between the older backup and now are lost ..
  18. Brogan

    Brogan XenForo Moderator Staff Member

    You can't import on top of an existing database.

    It's all or nothing.
  19. andybond

    andybond Active Member

    ok , thanks.
  20. andybond

    andybond Active Member

    well, back up and running.

    Is there any way of extracting any posts from the failed backup ?

Share This Page