database crashed.

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.
 
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.
 
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:\)
 
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
 
clicked repair as you suggested Brogan however all the table are saying "The storage engine for the table doesn't support repair".

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.
 
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?
 
Thanks MG, plenty of disk space (my db is over 600meg), have about 30gig spare but perhaps some issue happened overnight with the backup to cause it. Will have to look into it, thanks
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 :)
 
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...
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.

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
import.php: Missing parameter: format

Have you tried in phpmyadmin or similar to do a:

Code:
repair table xf_session;

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

What should I do? Please help me out!
 
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...
 
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
 
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!
 
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...
 
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...
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:
Top Bottom