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

database crashed.

Discussion in 'Troubleshooting and Problems' started by Panupat, Sep 13, 2011.

  1. Panupat

    Panupat Well-Known Member

    My forum is giving me this error

    Code:
    Server Error
    
    Mysqli prepare error: Table './afxenforo/xf_session' is marked as crashed and should be repaired
    
        Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
        Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
        Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
        Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
        Zend_Db_Adapter_Abstract->insert() in XenForo/Session.php at line 429
        XenForo_Session->save() in XenForo/Controller.php at line 386
        XenForo_Controller->updateSession() in XenForo/Controller.php at line 350
        XenForo_Controller->postDispatch() in XenForo/FrontController.php at line 317
        XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
        XenForo_FrontController->run() in /home/www/virtual/all-final.com/htdocs/index.php at line 13
    
    Can anyone help me please? What should I do? I've never repaired database before.
     
    Webby likes this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    If you use cPanel, click on MySQL Databases, then click Repair DB next to the one you wish to repair.

    Or if that doesn't work, you could probably just truncate the xf_session table as it's only temporary data anyway.
     
  3. bambua

    bambua Well-Known Member

    Have you tried in phpmyadmin or similar to do a:

    Code:
    repair table xf_session;
    
     
  4. MGSteve

    MGSteve Well-Known Member

    That's one the of the few myISAM tables, so not sure why it wouldn't accept being repaired...

    Just check the amount of disk space both on the drive where mysql's data is stored and the partition with the temp path on it (i.e. /var or c:\)
     
  5. Blue

    Blue Well-Known Member

    I'm no DB guy by any means but maybe if you could rebuild the search index from your ACP, being I see more than one error referencing xf_search_index
     
  6. Dodgeboard

    Dodgeboard Well-Known Member

    I've had some of my tables crash and was able to fix it with sypex right from the admincp.
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Most of XenForo's tables are InnoDB which don't support repair, so that error is normal. xf_session and xf_search_index are MyISAM tables which can be repaired.

    A simple repair should fix the problem. But if the corruption keeps recurring then you should contact your host as you have done.
     
  8. MGSteve

    MGSteve Well-Known Member

    tbh, unless there is some bug in mySQL when a database has mixed engine types, it shouldn't be corrupting the tables. Is this a new server or have you had the old incarnation of the forum on it as well?
     
  9. MGSteve

    MGSteve Well-Known Member

    The only reason I suggested it is that you can get some weird errors if the tmp partition gets full as mysql can't create any tmp files, which it needs to do when repairing a table. Likewise if the partition with the databases on it gets tight & there's not enough room to create a copy of the table.

    None of which appear to be the case going by what you said, but its useful info to know that may help someone in the future :)
     
  10. jgas

    jgas Active Member

    Hi! Until yesterday night everything was working fine on my forums... but today I got the same errors as in the first post.

    I tried everything but it's not working...
    on cpanel, it simply show nothing at the end of repair.

    if I truncate, I get this error message from phpmyadmin:

    import.php: Missing parameter: import_type[​IMG]
    import.php: Missing parameter: format[​IMG]

    the same error (import.php: Missing parameter: import_type[​IMG]
    import.php: Missing parameter: format[​IMG])
    if I repair the table!

    What should I do? Please help me out!
     
  11. Dodgeboard

    Dodgeboard Well-Known Member

    Have you tried restoring your database from a recent backup?
     
  12. jgas

    jgas Active Member

    Ehm nope, I moved to a new server last week and still didn't set up backups..
    So why am I having those errors in phpmyadmin? It's not normal...
     
  13. Dodgeboard

    Dodgeboard Well-Known Member

    What about the database you used a week ago for your move?
     
  14. MattW

    MattW Well-Known Member

    If it's just the session table, could you drop it and manually recreate it?
     
  15. jgas

    jgas Active Member

    i was able to "repair" the table but now I get this error:

    Fatal error: Method XenForo_Template_Public::__toString() must not throw an exception in /home/musicadi/public_html/internal_data/templates/S.16,L.2,node_category_level_1.php on line 0
     
  16. Jeremy

    Jeremy XenForo Moderator Staff Member

    Try turning off "Store Templates as Files" in your options.
     
  17. jgas

    jgas Active Member

    Done, but now I get this error:

    Fatal error: Method XenForo_Template_Public::__toString() must not throw an exception in /home/musicadi/public_html/library/XenForo/Template/Abstract.php(265) : eval()'d code on line 0

    It's jumping from one error to another!
     
  18. Jeremy

    Jeremy XenForo Moderator Staff Member

    What XenForo version are you on? Go into your styles and verify there is content in all of your node_category_level_1 templates.
     
  19. jgas

    jgas Active Member

    Last version... and yes there is content. But the STRANGE thing is that I did nothing... yesterday evening my website was working correctly, this morning I wake up and it's not working anymore...
     
    Webby likes this.
  20. Webby

    Webby Member

    Same here. I wake up and our site is messed up. All repairs fail. I don't know what to do, no one can post. Sometimes my site gets a server error as well.

    This is my error:

    Mysqli prepare error: Table './forumName_xenforo/xf_search_index' is marked as crashed and last (automatic?) repair failed
    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/Search/SourceHandler/MySqlFt.php at line 129
    5. XenForo_Search_SourceHandler_MySqlFt->_pushToIndex() in XenForo/Search/SourceHandler/MySqlFt.php at line101
    6. XenForo_Search_SourceHandler_MySqlFt->insertIntoIndex() in XenForo/Search/Indexer.php at line 44
    7. XenForo_Search_Indexer->insertIntoIndex() in XenForo/Search/DataHandler/Post.php at line 73
    8. XenForo_Search_DataHandler_Post->_insertIntoIndex() in XenForo/Search/DataHandler/Abstract.php at line 275
    9. XenForo_Search_DataHandler_Abstract->insertIntoIndex() in XenForo/DataWriter/DiscussionMessage.php at line760
    10. XenForo_DataWriter_DiscussionMessage->_insertOrUpdateSearchIndex() inXenForo/DataWriter/DiscussionMessage.php at line 739
    11. XenForo_DataWriter_DiscussionMessage->_indexForSearch() in XenForo/DataWriter/DiscussionMessage.php at line 585
    12. XenForo_DataWriter_DiscussionMessage->_postSave() in XenForo/DataWriter.php at line 1409
    13. XenForo_DataWriter->save() in XenForo/ControllerPublic/Thread.php at line 557
    14. XenForo_ControllerPublic_Thread->actionAddReply() in XenForo/FrontController.php at line 351
    15. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    16. XenForo_FrontController->run() in /home/forumName/public_html/forums/index.php at line 13

    I can't rebuild any search thingy in ACP either, I get the same error.
     
    Last edited: Dec 24, 2015

Share This Page